Sei sulla pagina 1di 3

Course: Database Management Systems (B-C) (Fall 2010)

Resource Person: Muhammad Usman Afzal

17-January-2011

ASSIGNMENT 3

(Simple Queries)
Total Points: 50 Submission Due: Monday 24th January, 2011 Before the Start of the Class

Instructions: Please Read Carefully!


This is an individual assignment and work submitted must be entirely your own. Please do not copy the assignment. All copies will be awarded a straightforward ZERO. You are expected to submit the assignment solution as a word (.doc or .docx) or a pdf document. Please name your file as: Your ID.doc / Your ID.docx / Your ID.pdf The first page should be the title page and include the university name, course code, course title, student ID, student name, and the words Assignment-3. Email your assignment to usman.afzal.gbs@gift.edu.pk: The subject of the email should be: CS-211 DBMS-(B or C) Assignment-3 Submission. Attach the file to the email. Keep the body of the email as empty.

Assignment is to be submitted before the start of the class on Monday, 24th January 2011. Late submissions will attract a 25% penalty! No assignment will be submitted after Tuesday 25th January 2011.

Use the Northwind 2007 Database and Write SQL Queries of the Following: [50]
HINT: It would be better to create and run these queries in Access 2007 to make sure that they produce the desired outputs. Then, you might want to write the SQL text in your solution. You do NOT need to send the Access database file with the solution. Table: Customers [10] List all customers whose first names start with a. List all customers who live in New York, Los Angeles, or Miami. List the names and job titles of all customers who are owners. List all customers whose states are not WA, CA and NY. List all customers who last names end on n.

Table: Order Details [10] List the quantity and unit price of orders whose order id is not between 40 and 55.s List all orders whose status is either Allocated or No Stock. List all orders whose purchase order ids are empty. Which products have the product of quantity and unit price (quantity * unit price) less than 1000? List all products having the word chocolate in their names.

Table: Orders [10] List all orders whose order date is later than 2/23/2006 and their ship name is Karen Toh. List all orders whose shipping fee is more than $5.00 and their payment type is Check or Credit card. List all orders whose paid dates are not empty. Which orders have the status id New or Shipped and their paid dates are empty? List all orders taken by the employee Jan Kotas.

Table: Products [10] List all products having the category Oil and Beverages. List all products having names Syrup, Olive Oil and Coffee. List all products where the difference of List Price and Standard Cost (List Price Standard Cost) is more than 10. Whisch products have jars as quantity per unit? Which products have the minimum reorder level and which ones have maximum target level?

Table: Purchase Orders [10] List all purchase orders whose status is Submitted. List all purchase orders approved before 4/25/2006. List all purchase orders whose id is at least 100 and were supplied by Supplier A. How many orders were placed by Supplier B? List all purchase orders supplied by Supplier F and created by Robert Zare.

END OF ASSIGNMENT

Potrebbero piacerti anche