Академический Документы
Профессиональный Документы
Культура Документы
Page 1 of 4
Question no 01: [06 Marks]
Answer the following.
i) Is it possible that during the physical database design and creation step of
database development you might want to return to the logical database design
activity? Why or why not? If it is possible, give an example of what might arise
during physical database design and creation that would cause you to want to
reconsider the conceptual and external database designs from prior steps.
ii) Composite keys are useful to represent M:N relationships and weak (strong
identifying) entities. Justify this term with some real world example.
iii) Our database have the advantage of security so why we give permissions to user
using grant in database. Explain your answer.
a) Draw an Extended Entity Relationship diagram for the following scenario. Show
complete relationships between entities having attributes. Also show multiplicity and
specify the key and participation constraints for each relationship set. (8 Marks)
Page 2 of 4
b) Identify the problems in the above ERD and walk through the steps of normalizing our
data model to the third normal form (3NF) to eliminate redundancies. (5 marks)
c) Implement the above ERD scenario using Data Definition Language. (10 marks)
d) Write down the DML statement for the following queries. (2 Marks)
i) Write a query to insert the details of three instructor into the Instructor table
ii) Write a query to insert the details of prerequisite for each of the Course.
1. Find out how many times ‘Chai’ product has been ordered?
2. Make a complete list of customers, the OrderID and date of any orders they have
made. Include customers who have not placed any orders.
3. Create a parameterized query that has the user enter a city and then list the
customers or suppliers from that city.
4. Make a list of products and the number of orders in which the product appears.
Put the most frequently ordered item at the top of the list and so on to the least
frequently ordered item.
Following are few tables given from the database of Online Shopping System.
Employee:
EmployeeID Name Title TitleOfCourtesy Salary
1 Nancy Sales Representative Ms. 29540
2 Andrew Vice President, Sales Dr. 22540
3 Janet Sales Representative Ms. 31190
4 Margaret Sales Representative Mrs. 18610
5 Steven Sales Manager Mr. 17440
Customer:
CustomerID Name City
ALFKI Maria Anders Berlin
ANATR Ana Trujillo Mxico D.F.
ANTON Antonio Moreno Mxico D.F.
AROUT Thomas Hardy London
BERGS Christina Berglund Lule
Order:
OrderID CustomerID EmployeeID ProductID OrderDate ShipName
10248 ALFKI 1 3 7/4/1996 Ernst Handel
10249 ANTON 2 2 7/5/1996 Toms Spezialitten
10250 ANATR 2 2 7/8/1996 Hanari Carnes
10251 AROUT 4 1 12/1/1996 Suprmes dlices
10252 AROUT 3 5 9/2/1996 Hanari Carnes
Page 3 of 4
Product:
ProductID ProductName Quantity Price
1 Chai 10 boxes 20 bags 180
2 Chang 24 - 12 oz bottles 192
3 Aniseed Syrup 12 - 550 ml bottles 107
4 Ikura 12 - 200 ml jars 310
5 Queso Cabrales 1 kg pkg. 210
Page 4 of 4