Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 18

Relational Database and Design

SECTION A [ 40 marks ]
Answer ALL questions in this section

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

A1.
[40]

(a)

List and explain five of the disadvantages of a traditional (file-based) application system? [10]

Uncontrolle d redundancy [1] - Each application has its own file which resulted in duplication of data. This will resulted in wastage of storage space, multiple updating of a data and inconsistent data. [1] -

Inconsisten cies of data [1] Data are duplicated and stored at multiple location which leads to inconsistent data which will undermine user's confidence over the integrity of the data. [1] - Inflexibility [1] Produces documents and reports routinely and effectively provided that the output were anticipated in the original design of the system. Files processing system cannot respond easily to new or redesigned product. This leads to user frustration.[ 1] - Limited Data Sharing [1] Each application

has its own file. User have little opportunity to share data outside their own application. This will lead to duplication of data when designing new application program. Thus multiple updating resulted in inconsistent data. [1] - Poor enforcemen t of standards [1] Design and operation has been decentralis ed resulted in poor standardiza tion. Two problems of inconsisten cies of data will arise synonym and homonym. [1] - Excessive program maintenanc e [1] Description of files records and data item

are embedded within the individual program. Changes to data such as name, type and length requires that the program also be modified.[1 ]

(b)

In the context of database management systems, give a definition of each of the following terms: i. Information ii. Relationship iii. Attribute iv. Entity v. Composite Keys vi. Artificial keys vii. Primary key viii. Normalization ix. Multi-valued attribute [18]

i.Data that has been processed and presented in a form suitable for human interpretatio n [1] often with the

purpose of revealing tends or patterns [1]. ii. An association between the instances of one more entity types [1] that is of interest to the organisatio n.[1] iii. An attribute is a property of an entity [1] that describe quantify, qualify, classify, specify or give a status of the entity they belong to.[1] iv. An entity is category of things that are important for business,[1 ] about which information must be kept. It is class or type of things.[1] . v. A primary key that made up of more

than one attribute is known as a composite key .[2] . vi. An artificial key is one that has no meaning to the business or organizatio n . [2] . vii. Primary key is an attribute [1] or a set of attributes that uniquely identify a specific instance of an entity. [1] viii. Normalizati on is a process of removes redundant data from existing set of tables or table definitions [1], thereby increasing the integrity of the database design [1]. ix. An attribute that can have more than one value [1] for each entity instance

[1].

(c)
Identificatio n of data objects and relationship s.[1] Drafting the initial ER diagram with entities and relationship s [1] Refining the ER diagram [1] Add key attributes to the diagram documentat ion .[1] Adding non-key attributes. [1] Diagrammi ng Generalizat ion Hierarchies . [1] Validating the model through normalizati on.[1] Adding business and integrity

Identify the eight sequence steps for building Data Model. [8]

rules to the Model [1]

(d)

For each of the following relations, indicate the normal form in which the relation has been written. Functional dependencies (other than those implied by the primary key) are shown where appropriate. (i). CLASS (COURSE NO, SECTION NO) [1] (ii). CLASS (COURSE NO, SECTION NO, ROOM) [1] (iii). CLASS (COURSE NO, SECTION NO, ROOM, CAPACITY) ROOM CAPACITY [1] (iv). CLASS (COURSE NO, SECTION NO, COURSE NAME, ROOM, CAPACITY) ROOM CAPACITY COURSE NO COURSE NAME [1] [4]

i) 3NF ii) 3NF iii) 2NF iv) 1NF

SECTION B [ 60 marks ]
Answer ANY 2 questions in this section

B1
[30 marks] (a)

(i) With respect to referential integrity rules, what is an insertion rule? Give an example to illustrate your answer. [4] (ii) What is deletion rule? Describe, using examples as necessary, three types of deletion rules.

[8] [12]
i) Insertion rule state that a row should not be inserted into referencing table unless there already exist a matching entity in referenced table. [2 marks] Two marks for example with illustration Example: PART

PNO PDESCRIPTION SNO 1 Coke 40 2 7UP 50


SUPPLIER

SNO 40 45

SNAME CHOP HUP SING CHO

With reference to the tables, 2 7UP 50 should not be inserted into PART table (referencing table) due to SNO =50 does not exist in SUPPLIER table (referenced table). ii) Deletion rule state that a row should not be deleted from the referenced table, if there exists a matching row in referencing table. [1] T hree types of deletion rule are: - restrict, cascade, and nullify. [1] Two marks for each type of example with illustration Example: PART

PNO 1 2 3

PDESCRIPTION RED NUT BLUE NUT GREEN NUT

SNO 40 40 45

SUPPLIERS

SNO 40 45 55

SNAME BINGO LINGO KING

Restrict By using the example shown, supplier with number 40 and 45 cannot be deleted, but supplier with number 55 can be deleted from SUPPLIER table. Cascade If supplier number 45 have to be deleted from SUPPLIER table, PART information that referenced supplier number 45 will be deleted too. Nullify If supplier number is 40 is deleted from SUPPLIER table, PART's SNO 40 referenced by Part number 1 and 2 will be NULL.

(b) List three situations when generalization hierarchies should be used.

[3]
One mark should be awarded for each situation A large number of entities appear to be of the same type [1] Attributes are repeated for multiple entities [1] The model is continually evolving. [1] Other valid answers should also receive credit. (c)

A table of records of University student gave below. With reference to the table answer the following: StdSSN S1 S1 S2 S2 StdCity SEATTLE SEATTLE BOTHELL BOTHELL StdClass JUN JUN JUN JUN OfferNo O1 O2 O3 O2 OffTerm FALL FALL WINTER FALL OffYear 2003 2003 2003 2003 EnrGrade 3.5 3.3 3.1 3.4 CourseNo C1 C2 C3 C2 CrsD DB VB OO VB

(i). Using the normalization rules, normalize the STUDENT RECORD above to 3NF. Show

from UNF to 3NF. [12] (ii). Briefly list down three steps involved in transforming a relation to third normal form. [3] [15]
i)

UNF StdSSN StdCity StdClass OfferNo OffTerm OffYear EnrGrade CourseNo CrsDesc (1 mark)

1NF StdSSN StdCity StdClass StdSSN OfferNo OffTerm OffYear EnrGrade CourseNo CrsDesc (2 marks)

2NF StdSSN StdCity StdClass StdSSN OfferNo EnrGrade OfferNo OffTerm OffYear CourseNo CrsDesc (3 marks)

3NF StdSSN StdCity StdClass StdSSN OfferNo EnrGrade OfferNo OffTerm OffYear CourseNo CourseNo CrsDesc (4 marks)

UNF - 1 mark for each correct relations [max 1 marks] INF - 1 mark for each correct relations [max 2 marks] 2NF - 1 mark for each correct relation [max 3 marks] 1 mark for primary keys shown 3NF - 1 mark for each correct relation [max 4 marks]

1 mark for primary keys shown ii) 1NF: Any-repeating groups are removed, so that there is a single value at the intersection of each row and column of the table. [1] 2NF:Any partial functional dependencies are removed.[1] 3NF:Any transitive dependencies are removed.[1]

B2
[30 marks] (a)

Consider the Entity Relationship Diagram below:


The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again.

(i). How many PAYMENT there are make to a CUSTOMER? [1] (ii) What is the minimum number of PAYMENT can be assign to each CUSTOMER? [1] (iii) Name two subtype found in the diagram. [2] (iv) Name one supertype found in the diagram [1] [5]

i) One and only one [1] ii) ONE [1] iii) CARD [1] CASH [1] iv) EMPLOYEE [1]

(b) Briefly describe five benefits of the database approach.

[5]
- Minimal data redundancy : Data files are integrated into a single logical structure [1] - Consistency of data: By controlling data redundancy, the opportunities for inconsistency are greatly reduced [1] - Integration of data: Data is organised in a single, logical structure with logical relationships existing between entities, this makes it easy for users to relate items of data [1] - Sharing of data: It is usually possible for multiple users to share a database concurrently [1] - Ease of application development : The cost and time needed to develop new applications is greatly reduced [1]

(c) Give five reasons for creating a data model.

[5]
It describes exactly the Information needs of the business [1] It facilitates discussion [1] It helps to prevent mistakes, misunderstanding [1] It forms Important "ideal system" documentation [1] It forms a sound basis for physical database design [1] It is a very good practice with many practitioners [1]

(d)

The following form shows a user view of the class list for Informatics Computer School. Convert this user view to a set of 3NF relations. You may make the following assumptions: (i). Each instructor has a unique location (ii). Each student has a unique major (iii). Each course has a unique title

The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again.

[13]
Two mark for primary key show, and One mark for all correct

UNF [1 marks] Course no

1NF [2 marks] Course no

2NF [3 marks] Course no

3NF [4 marks] Course no

Course title Instructor name Instructor location Student No Student Name Major Grade

Course title Instructor name Instructor location Course no Student No Student Name Major Grade

Course title Instructor name Instructor location Course no Student No Grade Student No Student Name Major

Course title Instructor name Instructor name Instructor location Course no Student No Grade Student No Student Name Major

(e) What is meant by a referential integrity constraint?

[2]
Referential Integrity Constraint states that object of a data structure is related with other object of another data structure. [2]

B3
[30 marks] (a) Normalize the employee record, showing clearly the UNF, 1NF, 2NF and 3NF. State any assumptions that you make. [13] UNF Employee (Employee#, Employee-name, Employee-address, Date-of-birth, {Course#, Coursedescription, Location, Date-attended, Pass-level}, {Job-title, Department-code, Department-name, Dateappointed, Salary}) [1] 1NF Employee (Employee#, Employee-name, Employee-address, Date-of-Birth) [1] Emp-Course (Employee#, Course#, Course-description, Location, Date-attended, Pass-level) [1] Emp-post (Employee#, Job-title, Department-code, Department-name, Date-appointed, Salary) [1]

2NF Employee (Employee#, Employee-name, Employee-address, Date-of-Birth) [1] Emp-course (Employee#, Course#, Location, Date-attended, Pass-level) [1] Course (Course#, Course-description) [1] Emp-post (Employee#, Job-title, Department-code, Department-name, Date-appointed, Salary) [1] 3NF Employee (Employee#, Employee-name, Employee-address, Date-of-Birth) [1] Emp-course (Employee#, Course#, Location, Date-attended, Pass-level) [1] Course (Course#, Course-description) [1] Emp-post (Employee#, Job-title, Department-code,Date-appointed, Salary) [1] Department (Department-code, Department-name) [1]

(b) What is the objectives of Denormalisation? Why should it be carried out with great care?

[2]
The objectives of denormalization is to reduce the number of physical databases tables to be accessed, by reducing the number of joins needed to derive the answer to a query. [1] However, denormalized rows are larger, which means that fewer rows can fit into a given secondary memory block and this may cause slower processing time. [1] (c)

Convert the conceptual design below to relations

The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again.

[5]
Applicant (ICNumber, name, address, contactNo) [1] Job(Jobnumber, job_title, supervisor) [1] Application_detail(ICNumber, Job_number, date) [1] Employment_history(ICNumber, history) [2] 1 mark for multiple value attribute form a relation (Employment_history) 1 mark for correct primary key assigned (IC number) (d)

For the following relations, indicate the normal form for that relation. If the relation is not third normal form, decompose it into 3NF relations. Functional dependencies are shown where appropriate. ORDER ( ORDER NO , ORDER DATE, PART NO, PART NAME, PART DESCRIPTION, UNIT PRICE, QTY, CUST NO, CUST NAME, CUST ADDRESS ) PART NO PART NAME

PART NO CUST NO CUST NO

PART DESCRIPTION CUST NAME CUST ADDRESS [10]

UNF [1] 1NF ORDER (ORDER NO, ORDER DATE, CUST NO, CUST NAME, CUST ADDRESS)[1] ORDER PART (ORDER NO, PART NO, PART NAME, PART DESCRIPTION, UNIT PRICE, QTY) [1] 2NF ORDER (ORDER NO, ORDER DATE, CUST NO, CUST NAME, CUST ADDRESS)[1] ORDER PART (ORDER NO, PART NO, UNIT PRICE, QTY) [1] PART ( PART NO, PART NAME, PART DESCRIPTION,) [1] 3NF ORDER (ORDER NO, ORDER DATE, CUST NO)[1] CUSTOMER (CUST NO, CUST NAME, CUST ADDRESS)[1] ORDER PART (ORDER NO, PART NO, UNIT PRICE, QTY) [1] PART ( PART NO, PART NAME, PART DESCRIPTION) [1]

<style> v\:* {behavior:url(#default#VML);}

You might also like