Professional Documents
Culture Documents
02 RDD CG 2D
02 RDD CG 2D
02 RDD CG 2D
EXPERIMENT
Exercise 1
Shopping Spree is a leading departmental store in New Jersey. The store has a
number of regular customers who purchase bulk items. The store also conducts
regular feedback sessions to analyze customer satisfaction levels. Jim Lewis, the
customer analyst of Shopping Spree has to make the E/R diagram to represent the
above situation and then map the E/R diagram to corresponding tables.
INSTRUCTOR NOTES
Solution
FEEDBACK-DATE
CUST- PURCHASE-
CODE DATE
PROD-NO
CUSTOMER
PURCHASE
Exercise 2
Steve Irving is the database designer of New Publications Library. The library has
three sections: Academics, Magazines, and Fiction. The higher-level entity is displayed
as follows:
PHYSICS SUSPENSE
BOOKS TIME
THRILLERS
MAGAZINE
Steve needs to draw the specialization diagram for the given entity.
Solution
Exercise 3
Don Allen is the sales supervisor of a departmental store. He needs to review the
weekly sales record of the store. The computer operator has created a table that
consists of all relevant fields. Don needs to normalize the table and form independent
tables that convey unique type of information.
INSTRUCTOR NOTES
Solution
The given Sales Data table is already in 1 NF.
In this table, C_Name depends only on C_ID. Therefore, we need to create a separate
table, Customer as follows:
CUSTOMER
C_ID C_Name
Also, in the Sales Data table, Item, Qty, and Rate depend only on Order_No.
Therefore, we need to create a separate table, Order. This table will be as follows:
ORDER
In addition, Bill_Amt and Bill_Dt depend only on Bill_No. Therefore, we need to create
another table, Bill as follows:
Therefore after 2 NF, we have three tables, Customer, Order, and Bill as shown above.
Now, in the Order table, Rate depends on Item. Therefore, we need to create another
table Item as follows:
ITEM
C_ID C_Name
BILL
ITEM
Exercise 1
New Heights is a training institute that provides courses on various non-technical
subjects, like personality improvement and foreign languages. Tim, the database
designer at the institute, has made the following relation to represent the data about
students, batches, and modules covered in the batches.
STUD-ID: Student’s id (unique)
NAME: Name of student
BATCH-NO: Batch number (one student can belong to only one batch)
SLOT: Time and day during which the batch of students attends the class
MODULE: Module or subject (one batch will do several modules)
MARKS: Marks obtained in a module test
Tim now needs to simplify the above relation by normalizing it.
INSTRUCTOR NOTES
Solution
The table that comes from the given relation is:
STUDENT
BATCH
BATCH-NO SLOT
Now, in the STUDENT table, MODULE and MARKS depend only on STUD_ID.
Therefore, we need to create another table, MARKS to normalize the tables to 3 NF.
The MARKS table is as follows:
MARKS
BATCH
BATCH-NO SLOT
MARKS
Exercise 2
National Bank is located in Chicago. This bank has two types of customers, people and
organizations. These organizations can be business companies, nonprofit
organizations, churches, and government agencies. Mary Peterson is a database
designer at the bank. She has been asked to draw an E/R diagram that distinguishes
between the two types of customers. The bank wants to keep a record of the birth
dates of individual customers. For organizations, the bank wants to maintain
information about the type of organization and the contact person.
Solution
CUST-CODE
CUST-
ADDRESS
CUSTOMER
ORGANIZATION
INDIVIDUAL
ORGANIZATION
CONTACT -TYPE
BIRTH-DATE PERSON
1. Which type of relationship is established when multiple students can enroll for
one course?
a. One-to-One
b. One-to-Many
c. Many-to-One
d. Many-to-Many
2. Which of the following types of relationship enables you to merge two tables
for faster access?
a. One-to-One
b. Many-to-One
c. One-to-Many
d. Many-to-Many
3. Which of the following specifies a key that is made up of more than one
attribute?
a. Primary key
b. Foreign key
c. Alternate key
d. Composite key
4. Which of the following keys is an attribute that is a candidate for the primary
key but is not the primary key?
a. Alternate key
b. Foreign key
c. Candidate key
d. Composite key
5. Which of the following is the result of taking the union of two or more lower-
level entity sets to produce a higher-level entity set?
a. Relationship
b. Specialization
c. Supertype
Solutions
1. c
2. a
3. d
4. a
5. d
6. c
7. d
8. a
9. b
10. d