Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Mock interview s ql 1
1. 1. Retrieve the listof unique order cities from the Orders table
SELECT DISTINCTorder_city
FROMorder;
2. Get the listof customers and their orders ifthe city of their residence is differentfrom the order city
SELECT a.cust_name,a.city,b.Point, b.ord_date,Cust_idAS"OrderCity",c.name FROMcustomeraLEFT
OUTER JOIN ordersb ON a.Cust_id=b.Cust_id
LEFT OUTER JOIN orderc ON c.Cust_id=b.Cust_id;
Where o.order_city!=c.city / Where o.order_city<> c.city
3. Get the orders sold month over month
Selectcount(order_id),month(order_date) as'month'fromorderso joincustomerc
On o.cust_id=c.cust_id
dens_rank() over(partitionbymonthorderbycust_id)