0% found this document useful (0 votes)
197 views11 pages

Mid Term Examination I: Questions Marks Out of

This document contains instructions for a midterm examination for an INFO 2312 Database Management Systems course. It provides details on the exam such as the date, time limit, number and types of questions, and total possible marks. The instructions state that no phones, internet, or collaboration are allowed and everything on the course website can be used as an aid. The exam contains 3 problems worth various marks: [1] Developing an ER diagram based on business documents, [2] Questions about normal forms and database transactions, and [3] Examining a table and deducing its normal form and normalization process.

Uploaded by

sherasaab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
197 views11 pages

Mid Term Examination I: Questions Marks Out of

This document contains instructions for a midterm examination for an INFO 2312 Database Management Systems course. It provides details on the exam such as the date, time limit, number and types of questions, and total possible marks. The instructions state that no phones, internet, or collaboration are allowed and everything on the course website can be used as an aid. The exam contains 3 problems worth various marks: [1] Developing an ER diagram based on business documents, [2] Questions about normal forms and database transactions, and [3] Examining a table and deducing its normal form and normalization process.

Uploaded by

sherasaab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

MID TERM EXAMINATION I

INFO 2312 - Database Management Systems


24 Jun 2021
Time Limit - 2 Hours 45 Minutes
Due: 6.45 PM
Max Marks – 30

Questions Marks Out of

1 10

2 15

3 5

Total 30

Instructions:

1. No mobile phones or internet is allowed.


2. The work you submit must be your own. You may not collaborate with another
person. Communicating with other students is not allowed and can result in an F
in this course.
3. Everything in Moodle Course Website can be used as an aid.
4. All questions must be answered in this in the space provided. ER diagram must be
pasted in the space provided.
5. Only one file can be submitted.
Problem 1. Develop an E-R Diagram based on the following information about the client’s small
business documents. [10 Marks]

Heather Sweeney is an interior designer who specializes in home kitchen design. She offers variety of
seminars at home shows, kitchen and appliance stores, and other public locations. The seminars are
free; she offers them as a way of building her customer base. She earns revenue by selling books and
videos that instruct people on kitchen design. She also offers custom-design consulting services.

After someone attends a seminar, Heather wants to leave no stone unturned in attempting to sell that
person one of her products or services. She would therefore like to develop a database to keep track
of customers, the seminars they have attended, the contacts she has made with them, and the
purchases they have made. She wants to use this database to continue to contact her customers and
offer them products and services.

Figure below shows the seminar customer list form that Heather or her assistant fills out at seminars.
This includes basic data about seminar as well as name, phone, and email address of each seminar
attendee. Each of her seminar has at least more than 10 customers. This gives two Entities, one
SEMINAR and the other CUSTOMER.

The sales invoice that Heather uses to sell books and videos is shown in Figure below. SALES INVOICE
itself needs to be an entity, and because the sales invoice has customer data it has a relationship back
to CUSTOMER. (Note that we do not duplicate the customer data because we can obtain data items
via the relationship; if data items are missing, we add them to CUSTOMER).

Because Heather runs her computer with minimal security, she decided that she did not want to
record credit card numbers in her computer. Instead, she records only the PaymentType value in the
database and does not record the rest. Product details are stored in a separate entity PRODUCT with
a productid and is related to the INVOICE.
Based on the information above, please help Heather to construct an ER Diagram using the Crow’s
Foot notation. You can draw the ER diagram offline and paste a picture below.
Problem 2.

(a) Regional Labs is a company that conducts research and development work on a contract basis
for other companies and organizations.

This data is stored in a relation (table) named PROJECT:


PROJECT (ProjectID, EmployeeName, EmployeeSalary)

Here ProjectID and EmployeeName form a composite primary key. Determine the Normal Form
of the table PROJECT. Show reasoning as to why a certain normal form is chosen. [2 Marks]

Write Your answer in the space provided.


As given in this relation, projectID and employeeName are composite keys. As Employee
salary is non- key attribute and its depend on one of composite key or both of them.

1NF:-foe being in 1NF, there should be non-multigroup and no repeating values in relation
record and that is difficult to determine by column name only as this relation show. But with
composite key(projectID and EmployeeName) it should possible to remove duplicacy in rows.

2NF:- two condition should follow;


1. relation ahould be in 1NF: that’s is true as above mention .

2. there will be no partial dependency( composites key must identify non-key column
rather than one key of composite key) :- In this relation, if EmployeeSalary is identified by
both Composite key( projectID and EmployeeName) then there should be 2NF form .

But I believe EmployeeSalary is determined by the EmployeeName only so there is not in


2NF

Example EmployeeName->EmployeeSalary

(b) Database transactions are governed by the ACID properties (Atomicity, Consistency, Isolation
& Durability). Consider the following Transactions applied on a Database table TestDB?
Suppose there are 2 rows X and Y. Also assume one of the rows of X has value 500 and one
of the rows of Y has value 100 (The values are provided just for reference).

Consider two transactions T and T” performed on X and Y.

Suppose transaction T has been executed till Read (Y) when T’’ starts. This results in an error.
From the ACID properties, find out which property this operation on T and T’’ violates and what
needs to be done to correct it. The example values of X and Y as mentioned above can be
used to solve this question. [5 Marks]

Write Your answer in the space provided.


Databse transaction has four main properties 1.atomiticity(entire transaction take place at
once) 2. Consistency ( database muat be cosnsistence before and after completion of
transaction) 3. Isolation(multiple transaction run independently without interference)4.
Duralibility(changes successfully occurs when system is failures)

But in this example T run till READ Y then T’’ run. Here isolation properties violate that
serailaization of one transaction. It cause the error like Transaction T has x value
(500*100=50000) write it , read y . at the same time T” starts where it read the data of x=
50000 and y=100. But actualy end of T the y value is y(100-50)= 50. It make inconsistency
in database.

(c) Every weak entity set can be converted to a strong entity set by simply adding appropriate
attributes. Why, then, do we have weak entity sets? [3 Marks]

Write Your answer in the space provided.

Weak entity is entity that has non independent. It dependent on strong entity for existence.
Two types of weak entity:- Id dependent and Non id dependent.

If there is wek entity that is no exit without its own existence like (no primary key)it has no
primary key then there is possibility to derived primary key of another table(strong entity)
but still it will be weak entity with id dependent for example

Bulding is strong entity it has buldinigNo primary key

Room is weak entity has just roomno. Its existence depended on building entity and we can
identifies it attributes with adding new attribute from strong entity like building No+roomNo
two identifiers.

buildingNo -foreign key of strong entity building

roomNo -primary key of itself

but still it will be weak entity(isd dependent).


(d) Consider the Purchase Table below:
There is no primary key of the above table. The phone attribute is Vendor’s phone numbers and is
dependent on the Vendor attribute. Find out the Normal Form (NF) of the table?

Describe and illustrate the process of normalizing the data shown in this table to third normal form
(3NF)? Basically, design the tables with its attributes and keys which will be formed because of the
table being converted to reach 3NF. Show the resulting tables below. You can use crows foot notation
if needed to display the tables. Displaying data is not mandatory. Proper display of the resulting #NF
normalised Table Schema is what is needed. [5 Marks]

This table is in 1Nf form , to bring it into 2,3 Nf , there si no primary key.
Step 1 determine functional dependency.

Fd1= vendor-> phone


Fd2=vendor, purchaseitem-> price
Fd3=vendor,purchase date->purchaseitem

1Nf to 2Nf
Split the table

Table 1
vendor phoneNo

Vendor is primary key

Table 2

Pur hase Purchase purchasedate vendor


item price

Table1;-
Vendor(pk)-> phone no

Table2
Vendor,purchaseitem,purchasedate price
Vendor(fk)
Purchaseitem, purchadsedate,
key so there is no partial dependency because theres is only one primary key vendor nad
other composite keys a

2Nf to 3NFthere is dependency

Vendor is primary key and purchase item is non primary kkey.

Vendor phoneNo

Pur hase Purchase purchasedate vendor


item price
Problem 3.

Examine the table shown below.

staffNo and branchNo are the composite primary key pair of the table. Deduce the following:

a) Identify the Normal Form of the Table? Mention step by step reasoning. [2 Marks]
This relation is in its 1NF because there is no reapeating groups and no
multigroup values.

Step 2;- there are composite keys like staffNo and branchNo

Functional dependencyas follows;-

Fd1=satffNo->name

Fd2=branchNo-> branch address

So there is partial depency.

Step 3: to remove partial dependency split the table;-

staffNo name

branchNo branchaddress

staffNo branchNo position Hour per week

Staff and branch are composite ekeys

b) Describe and illustrate the process of normalizing the data shown in this table to third
normal form (3NF)? Basically, design the tables with its attributes and keys which will be
formed because of the tables converted to achieve 3NF. Show the resulting tables below.
You can use crows foot notation if needed to display the tables. Displaying data is not
mandatory. Proper display of the resulting #NF normalised Table Schema is what is
needed. [3 Mark]
1Nf to 2NF:- This relation is in its 1NF because there is no reapeating groups
and no multigroup values.
To bring it into 2NF , split the table into three tables as follow

Table 1
Staff->name

Staff-(PK)

Table2

branchNo is PK

2NF to3NF
:- above realtion is in already in 3NF because all non prime attributes are
identified by composite keys there is no non-prime attribute mentioned by any
non prime attribute.

Fd1=satffNo(pk)->name

Fd2=branchNo(pk)-> branch address

Fd3= satffNo(fk), branchNo(fk) position ->hours per week.

staffNo name
Staffno-Fk

branchNo branchaddress

staffNo branchNo position Hour per week

You might also like