MIS 246 SQL -1 (1)

MIS 246 SQL -1 (1) - 1) Select orderid, customerid, freight...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
1) Select orderid, customerid, freight from Northwinds.Orders where freight between '600' and '700'; 2) Select orderid, customerid, shippeddate from Northwinds.orders Where shippostalcode='5020' or shippostalcode='5022' Order by customerid, shippeddate; 3 Select shippostalcode, count(orderid) from Northwinds.orders Where shippostalcode='5020' or shippostalcode='5022' Group by shippostalcode; 4) Select orderid, customerid, employeeid, shippeddate, shipcity, shipcountry from Northwinds.orders Where (shippostalcode='5020'or shippostalcode='5022')and employeeid='4' Order by shippeddate desc; 5) Select companyname,lastname, shippeddate, shipcity, shipcountry from Northwinds.orders, Northwinds. customers, Northwinds. employees Where employees.employeeid=orders.employeeid and orders.customerid=customers.customerid and (shippostalcode ='5020' or shippostalcode='5022') and orders.employeeid='4' Order by shippeddate desc; 6) Select shippostalcode,count(orderid) as ordertotal, avg(freight) from Northwinds.orders Where (shippostalcode ='5020' or shippostalcode='5022') and to_char(shippeddate,'yyyy')=2010 group by shippostalcode 7 ) Select unitcost*quantity as "totalcost" from Northwinds.products, Northwinds.OrderDetails
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

MIS 246 SQL -1 (1) - 1) Select orderid, customerid, freight...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online