# Assignment DATABASE MANAGEMENT SYSTEM DMS 1314

DUEDATE ON 15 APRIL 2014

Question 1

a. Explain 1NF, 2NF, 3NF and BCNF with suitable example.
First Normal Form (1NF):
 A row of data cannot contain repeating group of data.
 Each column must have a unique value.
 Each row of data must have a unique identifier Primary key.
 For example consider a table which is not in First normal form.
Student Table:
S_id S_Name subject
402 Alex Maths
403 Stuart Maths
You can clearly see here that student name Adam is used twice in the table and subject math
is also repeated.
This violates the First Normal form. To reduce above table to First Normal forms break the
table into two different tables

Second Normal Form (2NF):
 A table to be normalized to Second Normal Form should meet all the needs of First
Normal Form.
 Must not be any partial dependency of any column on primary key.
 It means that for a table that has concatenated primary key, each column in the table that is
not part of the primary key must depend upon the entire concatenated key for its existence.
 If any column depends only on one part of the concatenated key, then the table fails Second
normal form. For example, consider a table which is not in Second normal form.
Customer Table:
Assignment DATABASE MANAGEMENT SYSTEM DMS 1314
DUEDATE ON 15 APRIL 2014
customer_id Customer_Name Order_id Order_name Sale_detail
102 Alex 12 order3 sale3
103 Stuart 13 order4 sale4
 In Customer table concatenation of Customer_id and Order_id is the primary key.
 This table is in First Normal form but not in Second Normal form because there are partial
dependencies of columns on primary key.
 Customer_Name is only dependent on customer_id, Order_name is dependent on Order_id
and there is no link between sale_detail and Customer_name.
 To reduce Customer table to Second Normal form break the table into following three
different tables.
Third Normal Form (3NF)
Third Normal form applies that every non-prime attribute of table must be dependent on
primary key. The transitive functional dependency should be removed from the table. The table
must be in Second Normal form. For example, consider a table with following fields.
Student_Detail Table :
Student_id Student_name DOB Street city State Zip
In this table Student_id is Primary key, but street, city and state depends upon Zip. The
dependency between zip and other fields is called transitive dependency. Hence to apply 3NF,
we need to move the street, city and state to new table, with Zip as primary key.

New Student_Detail Table :
Student_id Student_name DOB Zip
Zip Street city state

Assignment DATABASE MANAGEMENT SYSTEM DMS 1314
DUEDATE ON 15 APRIL 2014
The advantage of removing transtive dependency is,
 Amount of data duplication is reduced.
 Data integrity achieved.

Boyce and Codd Normal Form (BCNF)
Boyce and Codd Normal Form is a higher version of the Third Normal form. This form deals
with certain type of anamoly that is not handled by 3NF. A 3NF table which does not have
multiple overlapping candidate keys is said to be in BCNF.

b. Define the term distributed database management system and
mention the issues to be considered in the design of the same.

Question 2

a. Hierarchical database model
b. Network database model
c. Relational database model

Question 3

Consider the following relations with key underlined,

Item (I#, Iname, Price, Weight)
Order CO#, C#, I#, Quatity)

Write SQL queirs for the following:

a. List the names of cutomers who have ordered items weighting more than
1000 any only those.

Assignment DATABASE MANAGEMENT SYSTEM DMS 1314
DUEDATE ON 15 APRIL 2014
b. List the name of customers who have ordered atleast one item priced
over Rm 2500.

c. Create a view called “order” that has the total cost of every order.

Question 4
Consider the following statement of a manufacturing company:

What type of relationship in this diagram?

Question 5

ER Diagram

Design a conceptual schema for Notown and draw an ER diagram for your schema. The
following information describes the situation that the Notown database must model. Be sure to
indicate all key and cardinality constraints and any assumptions you make. Notown Records
has decided to store information about musicians who record songs in their studio in adatabase.
The company has wisely chosen to hire you as a database designer.

 Each musician that records at Notown has an SSN, a name, an address, and a phone
number. SSN uniquely identifies a musician.Each instrument used in songs recorded at
Notown has a unique identification number, a name(e.g., guitar, synthesizer, flute) and a
musical key (e.g., C, B‐flat, E‐flat).

 Each song recorded at Notown has a title and a date. A song is uniquely identified by a song
id.

 There are two types of musicians recording a song: singers (vocalists) and instrumentalists.

 Each instrumentalist may play several instruments, and a given instrument may be played
by several instrumentalists. Each instrumentalist plays at least one musical instrument. Each
instrument must be played by some instrumentalist.

 Each song is performed by one or more musicians, and a musician may perform a number
of songs.

 Each musician who performs a song receives a stipend.

SHIP
Parts Supplier
Assignment DATABASE MANAGEMENT SYSTEM DMS 1314
DUEDATE ON 15 APRIL 2014
 Each song must be performed by some musician.

 A singer has a type, (e.g., baritone, tenor, soprano).

 Singers do not play any instrument.

 The set of singers and the set of instrumentalists are disjoint.

Musicians
ssn
name phone
s
performs
ms
Songs
stipend
title
date
ISA ISA
Singer Instrumentalist
type
Instruments
Play
s
id name
Musical key