233683__shahzaib database lab
233683__shahzaib database lab
Muhammad Shahzaib
Reg id:
233683
depaRtment:
BSSE 2nd semester
Submitted to:
Prof:Abdul Ghani
question 1: Find the salesperson and customer who reside
in the same city. Return Salesman, cust_name and city.
question 2: Find those orders where the order amount
exists between 500 and 2000. Return ord_no, purch_amt,
cust_name, city.
Question 15: For those customers from the existing list who put
one or more orders, or which order have been placed by the
customer who is not on the list, create a report containing the
customer name, city, order number, order date, and purchase
amount.
Question 16: Write a SQL statement to generate a report with
the customer name, city, order no. orderdate, purchase amount
for only those customers on the list who must have a grade and
placed one
or more orders or which order(s) have been placed by the
customer who neither is on the list nor has a grade.
Question 17: Write a SQL query to combine each row of the
salesman table with each row of the customer table.
Question 18 : Write a SQL statement to create a Cartesian
product between salesperson and customer, i.e.each
salesperson will appear for all customers and vice versa for that
salesperson who belongs to that city.
Question 19 : Write a SQL statement to create a Cartesian
product between salesperson and customer, i.e. each
salesperson will appear for every customer and vice versa for
those salesmen who belong to a city and customers who
require a grade.
Question 20 : Write a SQL statement to make a Cartesian
product between salesman and customer i.e. each salesman
will appear for all customers and vice versa for those salesmen
who must belong to a city which is not the same as his
customer and the customers should have their own grade.
…………………….the end……