소개
- SQL 쿼리 작성 못함
- 연습 필요
- 테이블 생성 및 데이터는 깃헙에 있음
- Exercises 에 대한 내용도 깃헙에 있음
- 깃헙링크
Relational Schema
Exercises
Select the names of all the products in the store.
Select the names and the prices of all the products in the store.
Select the name of the products with a price less than or equal to $200.
Select all the products with a price between $60 and $120.
Select the name and price in cents (i.e., the price must be multiplied by 100).
Compute the average price of all the products.
Compute the average price of all products with manufacturer code equal to 2.
Compute the number of products with a price larger than or equal to $180.
Select the name and price of all products with a price larger than or equal to $180, and sort first by price (in descending order), and then by name (in ascending order).
Select all the data from the products, including all the data for each product's manufacturer.
Select the product name, price, and manufacturer name of all the products.
Select the average price of each manufacturer's products, showing only the manufacturer's code.
Select the average price of each manufacturer's products, showing the manufacturer's name.
Select the names of manufacturer whose products have an average price larger than or equal to $150.
Select the name and price of the cheapest product.
Select the name of each manufacturer along with the name and price of its most expensive product.
Add a new product: Loudspeakers, $70, manufacturer 2.
Update the name of product 8 to "Laser Printer".
Apply a 10% discount to all products.
Apply a 10% discount to all products with a price larger than or equal to $120.
'데이터베이스 > SQL 쿼리 학습' 카테고리의 다른 글
20180601 MySQL : Function Example (0) | 2018.06.01 |
---|---|
20180530 MySQL : INTERVAL 'd' DAY (0) | 2018.05.30 |
20180522 SQL Exercises : Employee management (0) | 2018.05.22 |