Last active
April 14, 2020 05:14
-
-
Save aniruddha27/10067cd269694c722838f8dbbf5c7e59 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# connect to existing database | |
conn = sqlite3.connect('.\sql_db\Demo_table.db') | |
cur = conn.cursor() | |
# create table in database | |
cur.execute('''CREATE TABLE CUSTOMER( | |
User_ID INTEGER PRIMARY KEY NOT NULL, | |
Product_ID INTEGER NOT NULL, | |
Name TEXT NOT NULL, | |
Gender TEXT NOT NULL, | |
AGE INTEGER NOT NULL, | |
CITY TEXT); | |
''') | |
# commit and save changes to database | |
conn.commit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment