Queries with Joins and Aggregations (044)
CREATE TABLE users(
id SERIAL PRIMARY KEY,
username VARCHAR(50)
);
CREATE TABLE photos (
id SERIAL PRIMARY KEY,
url VARCHAR(200),
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE
);
CREATE TABLE comments (
id SERIAL PRIMARY KEY,
contents VARCHAR(240),
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE,
photo_id INTEGER REFERENCES photos(id) ON DELETE CASCADE
);
INSERT INTO users (username)
VALUES
('Reyna.Marvin'),
('Micah.Cremin'),
('Alfredo66'),
('Gerard_Mitchell42'),
('Frederique_Donnelly');
INSERT INTO photos (url, user_id)
VALUES
('https://santina.net', 3),
('https://alayna.net', 5),
('https://kailyn.name', 3),
('http://marjolaine.name', 1),
('http://chet.net', 5),
('http://jerrold.org', 2),
('https://meredith.net', 4),
('http://isaias.net', 4),
('http://dayne.com', 4),
('http://colten.net', 2),
('https://adelbert.biz', 5),
('http://kolby.org', 1),
('https://deon.biz', 2),
('https://marina.com', 5),
('http://johnson.info', 1),
('https://linda.info', 2),
('https://tyrique.info', 4),
('http://buddy.info', 5),
('https://elinore.name', 2),
('http://sasha.com', 3);
THERE IS ANOTHER INSERT INTO MISSING, CHECK THE SUBSEQUENT VIDEOS COMMENTS FOR IT.
-
58:07
The Why Files
1 day agoProject 8200 Exposed | CIA Psychics Find Alien Bases Underground
47.3K52 -
24:04
Stephen Gardner
7 hours ago🔴BREAKING: CNN Jake Tapper gets HORRIBLE NEWS | Trump SECRET PLAN outted!
44.7K120 -
1:35:18
Kim Iversen
9 hours agoAssange Is On US Soil, Is He Finally A Free Man? Kenyans Violently Protest After Being Declared “Major Non-NATO Ally”
70.3K102 -
1:16:27
Glenn Greenwald
11 hours agoMyths and Lies About Julian Assange Endure After Plea Deal Reached Securing His Freedom | SYSTEM UPDATE #289
104K178 -
2:26:55
Laura Loomer
9 hours agoEP54: Islamic Jihadists Threaten to Shut Down First Presidential Debate!
61.1K51 -
58:16
Edge of Wonder
14 hours agoHow a Philadelphia Experiment Whistleblower Mysteriously Vanished Forever
66.5K19 -
2:10
One Bite Pizza Reviews
1 day agoBarstool Pizza Review - The Slice Spot (West Chicago, IL)
71.4K32 -
2:03:40
Revenge of the Cis
14 hours agoEpisode 1343: Fatty Positivity
101K36 -
15:51
VIVA TV
17 hours agoJake Paul Is About To Get Bare Knuckled | Barstool Boxing | Large
90.3K15 -
2:09:32
RamseySolutions
20 hours agoThe Ramsey Show (June 25, 2024)
70.4K5