Skip to content

Instantly share code, notes, and snippets.

@aniruddha27
Created August 15, 2020 05:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aniruddha27/8b0cd3a181d99fccd44806f0d462d933 to your computer and use it in GitHub Desktop.
Save aniruddha27/8b0cd3a181d99fccd44806f0d462d933 to your computer and use it in GitHub Desktop.
# Table creation
commands = (# Table 1
'''Create Table TwitterUser(User_Id BIGINT PRIMARY KEY, User_Name TEXT);''',
# Table 2
'''Create Table TwitterTweet(Tweet_Id BIGINT PRIMARY KEY,
User_Id BIGINT,
Tweet TEXT,
Retweet_Count INT,
CONSTRAINT fk_user
FOREIGN KEY(User_Id)
REFERENCES TwitterUser(User_Id));''',
# Table 3
'''Create Table TwitterEntity(Id SERIAL PRIMARY KEY,
Tweet_Id BIGINT,
Hashtag TEXT,
CONSTRAINT fk_user
FOREIGN KEY(Tweet_Id)
REFERENCES TwitterTweet(Tweet_Id));''')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment