Database Worksheet 2
Database Worksheet 2
Q1.Write a SQL statement to make a join on the tables salesman, customer and orders in such
a form that the same column of each table will appear once and only the relational rows will
come.
Q2. Write a SQL statement to make a list in ascending order for the customer who works
either through a salesman or by own. Make use of left join.
Sample table: customer
customer_id | cust_name | city | grade | salesman_id
-------------+----------------+------------+-------+-------------
3002 | Nick Rimando | New York | 100 | 5001
3007 | Brad Davis | New York | 200 | 5001
3005 | Graham Zusi | California | 200 | 5002
3008 | Julian Green | London | 300 | 5002
3004 | Fabian Johnson | Paris | 300 | 5006
3009 | Geoff Cameron | Berlin | 100 | 5003
3003 | Jozy Altidor | Moscow | 200 | 5007
3001 | Brad Guzan | London | | 5005