Created
August 15, 2020 05:34
-
-
Save aniruddha27/8b0cd3a181d99fccd44806f0d462d933 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
# 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