In this assignment, you will make queries from shared databases:
- Sakila database
shared_sakila
- Sales database:
shared_sales
Write all queries in SQL. Use SHOW TABLES
and SHOW CREATE TABLE
statements to understand the schema.
The queries may be simple single-table SELECT
statements, SELECT
statements with subqueries, or queries with inner joins.
Some queries will require ORDER BY
and LIMIT
clauses but will NOT require aggregation operators such as MAX
, AVG
, SUM
, etc.
The queries will NOT require outer joins or GROUP BY
clauses.
-
List all stores including their full address and their manager names.
-
List all payments over $11.00, including the payment date, the customer name, and the staff name.
-
List all customers who have made single payments of $11.00 or more.
-
Display all products and their categories.
-
Display the product names, number ordered, and total amount for each item on order 160.
-
Display all customers who have ever ordered a bicycle .
-
Display the names of products that have never been ordered.
-
Display the names of customers who have never ordered anything.
-
Show the customer/employee pairs who share the same last names.
-
Show the names of all vendors who sell clothing.
-
Show all products that have not sold since the end of 2017.
-
Show all product names offered by Texas vendors.
-
Show the name of the customer who ordered a bicycle most recently.
-
Show the name of the vendor who sells the most expensive product.
- Show all countries where more than 25% of the population speak Spanish.
-
List all airlines including the names of their home aiport.
-
List all flights scheduled to depart from the Airport named "LA SARRE".
-
List all flights that departed from LA SARRE in September 2015.
-
List the types of airplanes that have have ever departed from LA SARRE.
-
List the types of airplaes that have never flown.