diff --git a/src/hello_postgres/__main__.py b/src/hello_postgres/__main__.py index 1f3cfb7..225ed79 100644 --- a/src/hello_postgres/__main__.py +++ b/src/hello_postgres/__main__.py @@ -24,8 +24,15 @@ def main(): course_instructor VARCHAR (100) NOT NULL, topic VARCHAR (20) NOT NULL); """) + print("Creating some records...") + cursor.execute("INSERT INTO datacamp_courses(course_name, course_instructor, topic) VALUES('Introduction to SQL','Izzy Weber','Julia')"); + cursor.execute("INSERT INTO datacamp_courses(course_name, course_instructor, topic) VALUES('Analyzing Survey Data in Python','EbunOluwa Andrew','Python')"); + cursor.execute("INSERT INTO datacamp_courses(course_name, course_instructor, topic) VALUES('Introduction to ChatGPT','James Chapman','Theory')"); + cursor.execute("INSERT INTO datacamp_courses(course_name, course_instructor, topic) VALUES('Introduction to Statistics in R','Maggie Matsui','R')"); + cursor.execute("INSERT INTO datacamp_courses(course_name, course_instructor, topic) VALUES('Hypothesis Testing in Python','James Chapman','Python')"); print("Committing the table to the database...") - print("Closing the connection adn the cursor...") + conn.commit() + print("Closing the connection and the cursor...") cursor.close() conn.close() # cursor.execute("SELECT * FROM DB_table WHERE id = 1")