In first lab, am I correct that the tables created in the lab from data frames do not have the primary key(s) identified?
Hello @msoreco
I did a little research, and I guess you are right. According to this post, one can create the primary key constraint after calling the to_sql
method using the following syntax:
with engine.connect() as con:
con.execute('ALTER TABLE `example_table` ADD PRIMARY KEY (`ID_column`);')
Thanks Amir for checking into it, that’s what I suspected.