Identify relationships and specify cardinality

Assignment Help Database Management System
Reference no: EM131956306

Question 1:

The diagram below is an ERD for a public library database.

NOTE: There are two types of catalog items - Book and DVD. A customer can check out one item at a time.

608_database.jpg

Study the ERD and answer the following questions:

I. Identify all relationships and specify cardinality and business rules. For example: 1:M between Library and Branch: a library has many branches; a branch belongs to one and only one library.

II. For each entity, identify primary key and foreign key, if any. For foreign key, also specify parent entity and matching attribute in parent entity.

III. Write SQL DDL statements to create tables in Oracle and also implement primary key, foreign key, and NOT NULL constraint. Include all columns listed with the correct data type. This step is important, as in Question 2 you will run INSERT statements to populate the tables you created and then write SELECT statement to query those tables.

IV. Write SQL statement for the following scenario:
a. Add a new customer Eric Short with Customer_ID 10 and Customer_Zip 23456.
b. Save changes permanently.
c. Change customer Eric Short zip from 23456 to 20231.
d. Cancel the change made in step c, restore data to its original status prior to step c.
e. Delete customer Eric Short.
f. Save changes permanently.

For SQL code, submit both source statements and results of running your statements.

Question 2:

Continue Question 1 above. It is important for you to create those tables with the exact table/column name and exact column data type/length as shown in the ERD.

Run the script DBST651_final_Part2_q2.sql attached and then respond the following SQL problems:

Create SQL statements for the following scenarios. Your response should include SQL statement, output and any other assumptions you have made to arrive at the solution. Please provide a single SQL query for each problem.

a. For each book in the catalog, display its title, publisher, ISBN, release date, number of pages, and whether it's carried in any library ("Yes" or "No"). Sort results by title. Make sure there is no duplicate information.

b. For a book with ISBN 9780756404079, display it's title, publisher, ISBN, which library (not branch) has it, and total number of copies each library has. Do not show libraries that don't carry it. Sort results by number of copies in decending order.

c. For each DVD in the catalog, display it's title, length, release_date, and how many times it has been checked out by all customers across all libraries. Include those that have not been checked out yet (display as 0). Sort results by title.

d. Display those customers who have checked out the same catalog item more than once. Show customer name, and for each catalog item show title, type, number of check out times, first check out date and last check out date for the item. Sort results by customer first/last name and catalog item title.

e. Show all customers who have checked more books than DVDs. Display customer name, total book checkouts and total DVD checkouts. Sort results by customer first name and last name.

Attachment:- part.rar

Reference no: EM131956306

Questions Cloud

Two moles of a gas to the left bulb : Suppose that we add two moles of a gas to the left bulb and then open the valve. Which statement about this event is not correct?
Equation differ from the ideal pressure : By what percent does the pressure calculated using the van der Waals' equation differ from the ideal pressure? For Kr gas, a = 2.318 L2atm/mol2
Can sustainability be economically viable for interface : What environmental vision do you communicate to your task force? In other words, what social responsiveness strategy will you adopt at Interface?
Compute annual after-tax cash flows related to cad project : Assume that United Technologies is evaluating a proposal to change the company's manual. Compute the annual after-tax cash flows related to the CAD project.
Identify relationships and specify cardinality : DBST 651 - Identify all relationships and specify cardinality and business rules. For example: 1:M between Library and Branch: a library has many branches
Calculate the theoretical yield percentage : Given that the silicon is 92% pure, calculate the theoretical yield percentage if 1.0 t of impure silicon produces 2.33 t of silicon (IV) chloride.
True about kinetic energy : Pentane, C5H12, boils at 35°C. Which of the following is true about kinetic energy, Ek, and potential energy
What role did the ethical intensity of the decision play : As a team, examine the situation through the lens of each of the principles of ethical decision making. What is your final decision?
Develop a plan of action : What are the risks of waiting for unequivocal proof before beginning to take action? What are the risks of acting decisively based on your "gut" sense?

Reviews

Write a Review

Database Management System Questions & Answers

  Knowledge and data warehousing

Design a dimensional model for analysing Purchases for Adventure Works Cycles and implement it as cubes using SQL Server Analysis Services. The AdventureWorks OLTP sample database is the data source for you BI analysis.

  Design a database schema

Design a Database schema

  Entity-relationship diagram

Create an entity-relationship diagram and design accompanying table layout using sound relational modeling practices and concepts.

  Implement a database of courses and students for a school

Implement a database of courses and students for a school.

  Prepare the e-r diagram for the movie database

Energy in the home, personal energy use and home energy efficiency and Efficient use of ‘waste' heat and renewable heat sources

  Design relation schemas for the entire database

Design relation schemas for the entire database.

  Prepare the relational schema for database

Prepare the relational schema for database

  Data modeling and normalization

Data Modeling and Normalization

  Use cases perform a requirements analysis for the case study

Use Cases Perform a requirements analysis for the Case Study

  Knowledge and data warehousing

Knowledge and Data Warehousing

  Stack and queue data structure

Identify and explain the differences between a stack and a queue data structure

  Practice on topic of normalization

Practice on topic of Normalization

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd