This repository was archived by the owner on Jan 10, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 187
Expand file tree
/
Copy pathSQL-week-2.txt
More file actions
33 lines (21 loc) · 1.51 KB
/
SQL-week-2.txt
File metadata and controls
33 lines (21 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
1) select name,address from customers where country='United States';
2) select * from customers order by name;
3) select * from products where unit_price>100;
4) select * from products where product_name like '%socks%';
5)
6) select product_name,unit_price,supplier_name from products inner join suppliers on suppliers.id=products.supplier_id;
7) select product_name,supplier_name from products inner join suppliers on suppliers.id=products.supplier_id where suppliers.country='United Kingdom';
8) select order_date,name,city,country from orders inner join customers on customers.id=orders.customer_id where customers.id=1 ;
9) select order_date,name,city,country from orders inner join customers on customers.id=orders.customer_id where customers.name='Hope Crosby' ;
10) select product_name,unit_price, quantity from order_items inner join products on products.id=order_items.product_id where
order_id=6;
11) select order_reference,order_date,product_name,supplier_name,name, quantity from
orders inner join order_items on order_items.order_id=orders.id
inner join products on products.id=order_items.product_id
inner join customers on customers.id=orders.customer_id
inner join suppliers on suppliers.id=products.supplier_id;
12) select supplier_name,name from
orders inner join order_items on order_items.order_id=orders.id
inner join products on products.id=order_items.product_id
inner join customers on customers.id=orders.customer_id
inner join suppliers on suppliers.id=products.supplier_id where suppliers.country='China';