Skip to content

Instantly share code, notes, and snippets.

@desmondrawls
Created June 6, 2013 08:27
Show Gist options
  • Save desmondrawls/5720117 to your computer and use it in GitHub Desktop.
Save desmondrawls/5720117 to your computer and use it in GitHub Desktop.
CREATE TABLE user (
id INTEGER PRIMARY KEY,
address TEXT,
email TEXT,
phone INTEGER
);
CREATE TABLE listing (
id INTEGER PRIMARY KEY,
property_type TEXT,
accommodates INTEGER,
room_type TEXT,
bedrooms INTEGER,
title TEXT,
description TEXT,
currency TEXT,
user_id INTEGER
);
INSERT INTO user (id, address, email, phone)
VALUES
(1, "390 2nd st brooklyn", "slow.al@oldslope.com", 1234567),
(2, "45 sunset blvd la", "quick.alex@latraffic.com", 7654321),
(3, "buffalo buffalo buffalo", "silly.bill@badjoke.com", 5554673),
(4, "netherworld", "sand.man@sleepcountryusa.com", 7776666),
(5, "narnia", "ice.queen@neverxmas.com", 8383838),
(6, "closet under the stairs", "spoiled.kid@gonnagetit.com", 1231111);
INSERT INTO listing (id, property_type, accommodates, room_type, bedrooms, title, description, currency, user_id)
VALUES
(1, "apartment", 4, "entire house", 4, "lucky 13", "evil landlord, prone to flooding", "usd", 1),
(2, "loft", 1, "shared room", 1, "walk of shame", "only DD hotties need apply", "usd", 2),
(3, "plane", 5, "shared room", 1, "crash landing", "we didn't know what else to do after this plane crash landed in our backyard", "usd", 3),
(4, "cave", 1, "entire house", 2, "gates of horn and ivory", "watch out for rap-battling demons", "usd", 4),
(5, "cabin", 3, "shared room", 1, "always winter", "just don't piss me off or else...", "usd", 5),
(6, "house", 1, "private room", 1, "no magic please", "absolutely no elf servants and no owls", "usd", 6),
(7, "igloo", 2, "entire house", 1, "bring your pet lion", "the queen is not liable if a centaur kills your lion", "usd", 5),
(8, "castle", 1, "private room", 100, "all that power", "forget about your friends they're holding you back come live in my castle", "usd", 5),
(9, "villa", 1, "entire house", 1000, "eternity is a long time", "what if you couldn't tell the difference between a dream and reality?", "usd", 4),
(10, "apartment", 3, "private room", 3, "pretend you're famous", "watch actual celebrities walking their dogs", "usd", 2);
------------------------------------QUESTIONS----------------------------------------
--1. Who are you chilling with if you're stuck in a villa for eternity?? (look at the email address)
--2. What is the phone number of the user with the most postings?
--3. Find all the postings by the user from question 2.
--4. How does the user at 390 2nd st. describe their apartment?
--5. What type of property is it that accommodates the most people?
@desmondrawls
Copy link
Author

------------------------------------QUESTIONS----------------------------------------
--1. Who are you chilling with if you're stuck in a villa for eternity?? (look at the email address)
--2. What is the phone number of the user with the most postings?
--3. Find all the postings by the user from question 2.
--4. How does the user at 390 2nd st. describe their apartment?
--5. What type of property is it that accommodates the most people?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment