Professional Documents
Culture Documents
IS222
IS222
Student Name:
The University of the South Pacific
Faculty of Science, Technology and Environment School of Computing, Information and Mathematical Sciences
Final Examination Semester 2, 2009
IS222
Database Management Systems
Time Allowed 3 hours plus 10 minutes reading
Instructions:
Write your Name and Student Id. Number in the space provided on each page.
You have three hours to answer this paper. You have 10 minutes reading time. Write all your answers in this booklet which you should submit in its entirety. If a single page is missing, you will be awarded zero marks.
Be precise, concise and relevant in your answers. Any extra, unneeded information in your answers will cause you to lose marks. Answer all questions.
There are 13 pages in this exam paper including this cover page. Total marks is 100.
Page 1 of 13
Student ID:
Student Name:
IS222 Final Exam Semester 2 2009
Answer the questions for I to 20 in the grid below. SHADE the letter corresponding to the best answer. (20 marks) Example of shade is
,.-- Q----r_-J---.-----B---.-----C----.----D-----,
Not
,~
c
D
Or Not even
,'--Q --.--, ~------r'-B----'----C -'--D-----'
Answer Grid
Q
1 a b c d
2 a b c d
3 a b c d
4 a b c d
5 a b c d
6 a b c d
7 a b c d
8 a b c d
9 a b c d
10 a b c d
11 a b c d
12 a b c d
13 a b c d
14 a b c d
15 a b c d
16 a b c d
17 a b c d
18 a b c d
19 a b c d
20 a b c d Questions
__ I.Data management is a discipline that focuses on the __ .
a. management of end users
b. generation, storage, and retrieval of data
c. help items to be used by end users
d. generation, storage, and retrieval of information
Page 2 of 13
Student ID:
Student Name:
2. All fields for a specific entity can be grouped together as a __ .
a. file c. record
b. field d. database
3. Which of the following is considered a data anomaly?
a. Inconsistency c. Timeliness
b. Modification d. Obsoletion
4. Which model operates at the lowest level of abstraction?
a. Conceptual c. External
b. Internal d. Physical
5. What type of relationship is expressed with the phrase "Painter paints Painting"?
a. l:M c. M:1
b. 1:1 d. M:N
6. What type of relationship is expressed with the phrase "Employee manages Store"?
a. l:M c. M:1
b. 1:1 d. M:N
7. What type of relationship is expressed with the phrase "Student takes Class"?
a. l:M c. M:1
b. 1:1 d. M:N
8. Nulls, ifused improperly, can create problems because they can represent __ .
a. a default value c. zero
b. a known, but missing, attribute value d. an unsortable value
9. The entity integrity rule requires that __ .
a. all primary key entries are unique
b. a part of the key may be null
c. foreign key values do not reference primary key values
d. duplicate object values are allowed
10. The referential integrity rule requires that __ .
a. every null foreign key value must reference an existing primary key value
b. an attribute have a corresponding value
c. every non-null foreign key value reference an existing primary key value
d. you delete a row in one table whose primary key does not have a matching foreign key value in another table
11. According to E.F. Codd, another word for the term "relation" is __ .
a. datafile c. table
b. data index d. data query
12. Each table must have a __ key.
a. pnmary
b. secondary
c. foreign
d. logical
13. Successful database design is, first and foremost, based on __ requirements.
a. designer c. end-user
b. programmer d. business
Page 3 of 13
Student ID:
Student Name:
14. Some attributes are classified as
a. simple
b. complex
c. defined
d. grouped
15. A derived attribute
a. must be stored physically within the database
b. need not be physically stored within the database
c. has many values
d. must be based on the value of three or more attributes
16. A relationship is an association between __ .
a. objects
b. entities
c. databases
d. fields
17. A __ key is a key that consists of more than one attribute.
a. pnmary
b. foreign
c. composite
d. domain
18. Normalization works through a series of stages called normal forms. Typically __ stages are processed.
a. 2 c. 4
b. 3 d. 5
19. A table that displays data redundancies yields __ .
a. inconsistencies c. fewer attributes
b. anomalies d. more entities
20. INF describes the tabular format in which all of the following are true except __ .
a. all the key attributes are defined
b. there are no repeating groups in the table
c. all attributes are dependent on the primary key
d. no attributes are dependent on the primary key
Answer questions 21 to 30 in the space provided.
Completion
Complete each statement.(10 marks)
21. A database language must enable the user to perform complex _
designed to transform the raw data into useful information.
22. If your RDBMS does not support the VCHAR and FCHAR format, use _
23. Any changes made to the table contents are not physically saved on disk until you use the
command.
-------------
Page 4 of 13
Student ID:
Student Name:
24. To list the contents of a table, you must use the command.
25. To restore the values of a table, provided you have not used the COMMIT command, you must use the command.
------------
26. To remove a row from the PRODUCT table you would use the conunand.
27. In order to develop an accurate data , the designer must have a thorough
understanding of the company's data types, extent, and uses.
28. A(n) rule is a brief and precise narrative of a policy, procedure, or principle
within a specific organization's environment.
29. Concurrency is a feature that allows simultaneous access to a database,
-------------
while preserving data integrity.
30. In the design stage, data modeling is used to create an abstract database structure
that represents real-world.
Page 5 of 13
Student ID:
Student Name:
Question 31. (7 marks) Resolve the following many to many relationship into one to many relationships by drawing an ERD that shows the resolved relationship: A customer may have many accounts in many banks. A bank may have many customers.
.____BA_N_K __ __,P>
<::1 CUSTOMER
You will be given marks for the right entities and the right primary/foreign keys.
Question 32. (2 marks). Give an example of a general case where a table will always be in the second normal form.
Page 6 of 13
Student ID:
Student Name:
Question 33. (5 marks). A.student has to be enrolled in at least one course. Each student has a unique student identity number. Each course has a unique course code. The enrollments for each student are stored in a table ENROLMENT that has the attributes student identity number and course code. How would you ensure that a student cannot enrol in a course if data about the student does not exist?
Question 34. (4 marks). A database table named EMPLOYEE has an attribute "NAME". An example of one of the values is "Jessica Smythe", where Jessica is the first name and Smythe is the second name.
What type of attribute is NAME? (simple, composite, compound, complex)
What problem could you face if you wished to access NAME or part of it?
How would you resolve the problem?
Page 7 of 13
Student ID:
Student Name:
Question 35. (3 marks)
What is a business rule? (1 mark)
Explain what is wrong with the following business rule and rewrite it correctly. (2 marks)
An employee can have only one time card for each week, but an employee can also have more than one timecard for each week.
Question 36. (8 marks) Study the following ERD carefully.
a. What is the primary key of employee? (1 mark)
Page 8 of 13
Student ID:
Student Name:
b. Is the relationship between Assignment and Employee mandatory? Explain why or why not. (2 marks)
c. Which of the above entities is a weak entity? (1 mark)
d. What is the maximum amount of projects an employee can be assigned to? (1 mark)
e. Is the relationship between Company and Project mandatory or not? Explain why or why not. (2 marks)
f. Which entity has a composite key? (1 mark)
Question 37. (13 marks) Scenario: At a video studio, a singer may make an appointment with an auditor. Each singer and each auditor has a unique id. Each singer has a unique singer name. A singer belongs only to one band. A singer makes only one appointment per day with anyone auditor. An auditor may audit many singers per day. A singer is audited only once per day. A band has a unique code.
Singer Id
Auditor Id Appoint
Day
Singer Name
Singer Band
a. What is the primary key for this table? Underline the primary key attributes. (3 marks)
Page 9 of 13
Student ID:
Student Name:
b. Show graphically one partial dependency in the diagram below. (2 marks)
Singer Id
Auditor Id Appoint Day
Day
Singer Name
Singer Band
c. Show graphically one transitive dependency in the diagram below. (2 marks)
Singer Id
Auditor Id
Day
Singer Name
Singer Band
d. Convert the table into the third normal form. (6 marks)
Page 100f13
Student ID:
Student Name:
Question 38. (18 marks)
A MySQL database is setup to store data about the courses a student has enrolled in for a given year.
A course is offered only once a year. For each enrolment a student is given an integer grade ranging from o to 4.
The three relational tables together with their respective attributes are:
COURSE (CourseCode, Year) STUDENT(StudentCode)
ENROLMENT(StudentCode, CourseCode, Year, Grade)
1. Write the SQL code to create the COURSE table. Identify primary key. (2 marks)
2. Write the SQL code to create the STUDENT table. Identify primary key (2 marks)
3. Write the SQL code to create the ENROLMENT table. Identify primary and foreign keys. (6 marks)
Page 11 of 13
Student ID:
Student Name:
4. Write the SQL Code to insert a row into the student table. (2 marks)
5. Write the SQL Code to delete the row from student with student code "123". (2 marks)
6. Write the SQL code that will update all rows in ENROLMENT table by changing all grades from 1 to 1.5 (4 marks)
Question 39. (4 marks)
What properties must each transaction display?
1.
2.
3.
4.
Page 12 of 13
Student ID:
Student Name:
Question 40. (6 marks) Show how the following transaction can result in lost update in a multi-user database.
Time Transaction Step Stored value(Balance Owed)
1 1 Read Balanced Owed 1000
Balance Owed = 1000
2 1 +200 1000
3 1 Write Balance Owed 1200
4 2 Read Balanced Owed 1200
Balanced Owed = 1200 -
5 2 500 1200
6 2 Write Balance Owed 700 Time Transaction Step Stored value(Balance Owed)
THE END
Page 13 of 13