Write SQL queries for the followingrelations CUSTOMER( custId , name, address,ci
ID: 3612694 • Letter: W
Question
Write SQL queries for the followingrelations
CUSTOMER(custId, name, address,city, province, postalCode, phone)
ORDER (orderNo,custId, invNo, datePlaced, datePromised, terms,status)
ORDER_LINE(orderLineNo, orderNo,pCode, qty)
INVOICE (invNo,custId, orderNo, date, status)
INVOICE_LINE(invLineNo, invNo, pCode,qtyShip)
PRODUCT (pCode,pName, pDescription)
a) Deletea customer’s record whose name is zafar and city isKarachi.
b) Listall the product names in descending order whose quantity shipped isless than 5000.
c) Listall the invoice numbers whose product code is 12.
d) Listall the order numbers whose quantity is more than2500.
e) Createa view containing the following attributes from the CUSTOMER andORDER relations.
CUSTOMER (custId, name, address)
Explanation / Answer
(a)Delete from customer where name=’zafar’ andcity=’karachi;
(b)Select pname from product p, invoice_line i wherei.pcode=p.pcode and qtyship<5000 order by pname desc;
(c)Select invNo from Invoice_line where pcode=12;
(d)Select orderNo from orderline where Quantity >2500
(e)Create view [customer_order] as select custid,name, address,orderNo, dateplaced, status from customer, order
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.