Skip to content

Instantly share code, notes, and snippets.

@tomplex
Created April 12, 2017 02:37
Show Gist options
  • Save tomplex/a69b03015529ea8f2ac49c3df16b76db to your computer and use it in GitHub Desktop.
Save tomplex/a69b03015529ea8f2ac49c3df16b76db to your computer and use it in GitHub Desktop.
CREATE TABLE users(user_id SERIAL PRIMARY KEY, user_name TEXT);
CREATE TABLE mentions(mention_id SERIAL PRIMARY KEY, mention_symbol TEXT, mention_user INT REFERENCES users(user_id), mention_date TIMESTAMP DEFAULT now());
INSERT INTO users (user_name) VALUES ('Tom Taylor'), ('Tom Caruso'), ('Other Rando User');
INSERT INTO mentions (mention_symbol, mention_user) VALUES ('AMD', 2);
INSERT INTO mentions (mention_symbol, mention_user) VALUES ('APPL', 1);
INSERT INTO mentions (mention_symbol, mention_user) VALUES ('BLPD', 1);
INSERT INTO mentions (mention_symbol, mention_user) VALUES ('GALT', 1);
INSERT INTO mentions (mention_symbol, mention_user) VALUES ('AKRX', 2);
INSERT INTO mentions (mention_symbol, mention_user) VALUES ('AMD', 3);
INSERT INTO mentions (mention_symbol, mention_user) VALUES ('AMD', 2);
INSERT INTO mentions (mention_symbol, mention_user) VALUES ('AMD', 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment