24 lines
803 B
SQL
24 lines
803 B
SQL
|
|
-- *** The Lost Letter ***
|
|
-- Get the address id of sender ==> id 432, type Residential
|
|
SELECT * FROM "addresses" WHERE "address" = "900 Somerville Avenue";
|
|
|
|
-- Get the address id of receiver ==> id 854, type Residential
|
|
SELECT * FROM "addresses" WHERE "address" LIKE "2 Fin%Street";
|
|
|
|
-- Get the id and contents from the parcel send by sender to receiver
|
|
SELECT * FROM "packages" WHERE "from_address_id" = 432 AND "to_address_id" = 854;
|
|
|
|
-- *** The Devious Delivery ***
|
|
-- Get the delivery address of the parcel with missing "from_address_id"
|
|
SELECT * FROM "packages" WHERE "from_address_id" IS NULL;
|
|
|
|
-- Get info about the package
|
|
SELECT * FROM "scans" WHERE "package_id" = 5098;
|
|
|
|
-- Get info about where the parcel ended up
|
|
SELECT * FROM "addresses" WHERE "id" = 348;
|
|
|
|
-- *** The Forgotten Gift ***
|
|
|