FINAL PAPER FP304 DATABASE SYSTEM

4,111 views

Published on

Published in: Education
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,111
On SlideShare
0
From Embeds
0
Number of Embeds
30
Actions
Shares
0
Downloads
262
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

FINAL PAPER FP304 DATABASE SYSTEM

  1. 1. CONFIDENTIAL FP304 DATABASE SYSTEM Page 2 of 20 SECTION A OBJECTIVE QUESTIONS (50 marks) INSTRUCTION: This section consists of FORTY (40) objective questions. Answer ALL questions in the answer booklet. 1. “A software system that enable user to define, create and maintain the database”. This statement describes [CLO 1] A. Oracle 10g B. Microsoft Office Access 2007 C. Database Management System D. Data warehouse 2. The function of a database is to ____________. [CLO 1] A. collect and organize input data B. check all input data C. check all spelling D. output data 3. Choose the software that is commonly used in database. [CLO 1] A. Oracle B. SQL Access C. SQL desktop D. Linux 4. Internal Schema is one of the three-schema architecture. Which one is true about Internal Schema? [CLO 1] A. It hides the details of physical storage structures and concentrates on describing entities, data types, relationships, user operations, and constraints. B. Uses a physical data model and describes the complete details of data storage and access paths for the database.
  2. 2. CONFIDENTIAL FP304 DATABASE SYSTEM Page 3 of 20 C. Implementation of data model D. The part of the database that a particular user is interested in and hides the rest of the database from user 5. A _____________ is the set of allowable values for one or more attributes. [CLO 1] A.Cardinality B.Tuple C.Degree D.Domain 6. Within a table, the primary key must be unique so that it will identify each row. When this is the case, the table is said to exhibit ________ integrity. [CLO 1] A. Referential B. Entity C. Enforced D. Key 7. The data type of values that appear in each column is represented by _________________ of possible values. [CLO 1] A. Range B. Product C. Domain D. Function
  3. 3. CONFIDENTIAL FP304 DATABASE SYSTEM Page 4 of 20 8. Based on Figure 1, identify which one is the Candidate Key? Figure 1 [CLO 1] A. W B. X C. Y D. Z 9. All companies operate four departments in their organization. This relationship represents a _______________. [CLO 1] A. one-to-one relationship. B. one-to-many relationship. C. many-to-one relationship. D. many-to-many relationship. 10. __________________works on a single relation R and defines a relation that constrains only those tuples (rows) of R that satisfy the specified condition (predicate). [CLO 1] A. Cartesian product B. Difference C. Selection D. Intersection
  4. 4. CONFIDENTIAL FP304 DATABASE SYSTEM Page 5 of 20 11. _________________ works on a single relation R and defines a relation that contains a vertical subset of R, extracting the values of specified attributes and eliminating duplicates. [CLO 1] A. Projection B. Cartesian Product C. Difference D. Intersection 12. The ______________set operator combines all tuples from two relations excluding duplicates. [CLO 1] A. Union B. Intersect C. Difference D. Divide 13. The ___________ operator returns all tuples in one relation that are not found in other relation. [CLO 1] A. Intersect B. Product C. Select D. Difference 14. What is meant by the term union compatibility? [CLO 1] A. When two or more tables share the same number of columns B. When two or more tables have the same degree C. When two or more tables share the same domains D. When two or more tables share the same number of columns and when they share the same domain
  5. 5. CONFIDENTIAL FP304 DATABASE SYSTEM Page 6 of 20 15. What is meant by the following relational algebra statement? STUDENT x COURSE [CLO 1] A. Compute the natural join between the STUDENT and COURSE relations. B. Compute the left outer join between the STUDENT and COURSE relations. C. Compute the Cross Product between the STUDENT and COURSE relations. D. Compute the outer join between the STUDENT and COURSE relations. Question 16,17 and 18 are based on Figure 2 : Figure 2 16. A relational algebra operator applied to tables of EMPLOYEES and DEPARTMENT produces the following result as in Table 1 Table 1 The operator is: [CLO 3] A. An outer join operator B. The project operator C. The cross product operator D. The natural join operator
  6. 6. CONFIDENTIAL FP304 DATABASE SYSTEM Page 7 of 20 17. A relational algebra operator applied to tables of EMPLOYEES and DEPARTMENT produces the following result as in Table 2 Table 2 The operator is: [CLO 3] A. An outer join operator B. The project operator C. The cross product operator D. The natural join operator 18. A relational algebra operator applied to tables of EMPLOYEES and DEPARTMENT produces the following result as in Table 3 Table 3 The operator is: [CLO 3] A. An outer join operator B. The project operator C. The cross product operator D. The natural join operator 19. Which clause would you use in a SELECT statement to limit the display to those employees whose salary is greater than 5000? [CLO 3] A. WHERE SALARY > 5000 B. HAVING SALARY > 5000
  7. 7. CONFIDENTIAL FP304 DATABASE SYSTEM Page 8 of 20 C. ORDER BY SALARY > 5000 D. GROUP BY SALARY > 5000 20. You use this SQL statement to retrieve data from a table for ______________. [CLO 1] A. Viewing B. Deleting C. Inserting D. Updating 21. Which are Data Manipulation Language (DML) statements? i. SELECT ii. ALTER iii. DROP iv. DELETE [CLO 1] A. i, iv B. ii, iii C. i, ii, iii D. ii, iii, iv 22. What happens if the WHERE clause is omitted from a DELETE statement? [CLO 1] A. All records from the table are deleted B. No record from the table will be deleted C. First record of the table will be deleted D. The statement will not be executed and will give a syntax error SELECT * FROM orders;
  8. 8. CONFIDENTIAL FP304 DATABASE SYSTEM Page 9 of 20 23. You need to produce a report for mailing labels for all customers. The mailing label must have only the customer name and address. The CUSTOMERS table has these columns: CUST_ID NUMBER(4) NOT NULL CUST_NAME VARCHAR2(100) NOT NULL CUST_ADDRESS VARCHAR2(150) CUST_PHONE VARCHAR2(20) Which SELECT statement accomplishes this task? [CLO3] A. SELECT *FROM CUSTOMERS; B. SELECT CUST_NAME, CUST_ADDRESS, CUST_PHONE FROM CUSTOMERS; C. SELECT CUST_ID,CUST_NAME,CUST_ADDRESS, CUST_PHONE FROM CUSTOMERS; D. SELECT CUST_NAME, CUST_ADDRESS FROM CUSTOMERS; 24. Which INSERT statement is correct to insert a new row into table of employees? A. INSERT INTO employees (employee_id) VALUES (1000); B. INSERT INTO employees VALUES (NULL, ‘John’, ‘Smith’); C. INSERT INTO employees (first_name, last_name) VALUES (‘John’, ‘Smith’); D. INSERT INTO employees (first_name, last_name, employee_id) VALUES (100, ‘John’, ‘Smith’);
  9. 9. CONFIDENTIAL FP304 DATABASE SYSTEM Page 10 of 20 25. How to select all the records from a table named ‘Persons’ where the value of the column “FirstName” starts with an “a” using SQL statement? [CLO 3] A. SELECT * FROM Persons WHERE FirstName LIKE ‘%a’; B. SELECT * FROM Persons WHERE FirstName= ‘a’; C. SELECT * FROM Persons WHERE FirstName LIKE ‘a%’; D. SELECT * FROM Persons WHERE FirstName LIKE ‘%a%’; 26. In UPDATE statement, choose the correct answer to update firstname = Mary to firstname = Marry from a table named "staff". [CLO 3] A. UPDATE RECORD staff SET FName = 'Marry' WHERE LName = 'Mary'; B. UPDATE staff SET FName = 'Marry' WHERE LName = 'Mary'; C. UPDATE staff SET INTO FName = 'Marry' WHERE LName = 'Mary'; D. UPDATE RECORD staff SET INTO FName = 'Marry' WHERE LName = 'Mary'; 27. A goal of normalization is to minimize _____________. [CLO 1] A. the number of relationships B. the number of entities C. the number of tables D. data redundancy 28. A table that satisfies 2NF ___________________. [CLO 1] A. always satisfies 1NF B. may violate 1NF C. always satisfies 3NF D. always satisfies BCNF 29. On an entity-relationship diagram, a diamond represents a ___________.
  10. 10. CONFIDENTIAL FP304 DATABASE SYSTEM Page 11 of 20 [CLO 1] A. multivalued attribute B. data flow C. entity D. relationship 30. A person, place, object, event, or concept in the user environment about which the organization wishes to maintain data refers to a(n): ___________________ . [CLO 1] A. Cardinality B. Attribute C. Relationship D. Entity 31. When applying the optional 1-M relationship rule for converting an ERD into a relational table design, which of the following statements is true? [CLO1] A. Each 1-M relationship with 0 for the minimum cardinality on the parent side becomes a new table. B. The primary key of the new table is the primary key of the entity type on the child (many) side of the relationship. C. The new table contains foreign keys for the primary keys of both entity types participating in the relationship. D. Both foreign keys in the new table do not permit null values. 32. What type of relationship is expressed with the phrase "Student takes Class"? [CLO 1] A. 1 : M B. M : 1 C. 1 : 1 D.M : N 33. When applying the M-N relationship rule for converting an ERD into a relational table design, which of the following statements is true?
  11. 11. CONFIDENTIAL FP304 DATABASE SYSTEM Page 12 of 20 i. Each M-N relationship becomes a separate table ii. The foreign keys must not allow null values. iii. The primary key of the table is a combined key consisting of the primary keys of the entity types participating in the M-N relationship. iv. The primary key of the table is the primary key of the entity type participating in the M-N relationship which has the most attributes. [CLO 1] A. i,ii B. i,iii C. i,ii,iii D. ii,iii,iv 34. Based on Figure 3 the BOOKS and MEMBER entities are related to each other. The relationship on the MEMBER side indicates that: Figure 3 [CLO 1] A. A BOOKS may be borrowed by one or more MEMBER. B. A MEMBER may borrow one BOOKS. C. A BOOKS may be borrowed by zero or one MEMBER only. D. A MEMBER may borrow zero or more BOOKS.
  12. 12. CONFIDENTIAL FP304 DATABASE SYSTEM Page 13 of 20 35. Choose the correct Entity Relationship Model diagram based on the situation given. “Each INSTRUCTOR may teach one or more CLASS” “Each CLASS is taught by one INSTRUCTOR” [CLO 1] A. B. C. . D. 36. ______________ refers to the requirement that other operations cannot access data that has been modified during a transaction that has not yet been completed. [CLO 2] A. Consistent B. Isolated C. Durable D. Atomic C INSTRUCTOR CLASS teach 1 1 ((0, N) (1,1) C INSTRUCTOR CLASS teach (1,N) (1,1) 1 M C INSTRUCTOR CLASS teach (0,1) (1,1) 1 1 C INSTRUCTOR CLASS teach (0,N) (1,1) 1 M
  13. 13. CONFIDENTIAL FP304 DATABASE SYSTEM Page 14 of 20 37. _____________is the ability of the DBMS to recover the committed transaction updates against any kind of system failure. [CLO 2] A. Consistent B. Isolated C. Durable D. Atomic 38. Deadlocks are possible only when one of the transactions wants to obtain a (n) _________________ lock on a data item. [CLO 2] A. Binary B. Exclusive C. Shared D. Complete 39. Which of the following term below refers to the statement stated below? [CLO 2] A. Consistent B. Durable C. Atomic D. Isolated  All of the tasks of a database transaction must be completed  If incomplete due to any possible reasons, the database transaction must be aborted.
  14. 14. CONFIDENTIAL FP304 DATABASE SYSTEM Page 15 of 20 40. If locking is not available and several users access a database concurrently, problems may occur if their transactions use the same data at the same time. Concurrency problems include i. Lost or buried updates. ii. Uncommitted dependency iii. Inconsistent analysis iv. Transaction Log [CLO 2] A. i B. ii,iii C. i,ii,iii D. i,iii,iv
  15. 15. CONFIDENTIAL FP304 DATABASE SYSTEM Page 16 of 20 SECTION B STRUCTURED QUESTIONS (50 marks) INSTRUCTION: This section consists of TWO (2) structured questions. Answer ALL questions. QUESTION 1 a) ANSI-SPARC Architecture, is an abstract design standard for a Database Management System (DBMS), first proposed in 1975. Given ANSI- SPARC architecture in Figure 1.1, explain each level. Figure 1.1 [CLO 1] (3 marks) b) Database is a collection of persistent data that can be shared and interrelated. i. Explain TWO (2) properties of database. ii. Explain TWO (2) features of Database Management System. [CLO 1] (4 marks) [CLO 1] (2 marks) c) Illustrate THREE (3) most common relationships in E-R models. [CLO 1] (3 marks)
  16. 16. CONFIDENTIAL FP304 DATABASE SYSTEM Page 17 of 20 STUDENT STU_NUM STU_LNAME 321452 Bowser 324257 Smithson ENROLL CLASS_CODE STU_NUM ENROLL_GRADE 10014 321452 C 10014 324257 B 10018 321452 A 10018 324257 B 10021 321452 C 10021 324257 C CLASS CLASS_CODE CRS_CODE CLASS_SECTION CLASS_TIME CLASS_ROOM PROF_NUM 10014 ACCT-211 3 THUR, 2:30- 3.45PM BUS252 342 10018 CIT-220 2 MON, 9:00- 9:50PM KLR211 114 10021 QM-261 1 WED, 8:00- 8:50AM KLR200 114 d) Study the tables STUDENT, ENROLL and CLASS in Figure 1.2: Figure 1.2 i. Determine primary key for each table ii. Determine foreign keys for these tables iii. Write suitable command to create a new table consisting of class code, student number, class room and class time [CLO 3] (2 marks) [CLO 3] (2 marks) [CLO3] (4 marks)
  17. 17. CONFIDENTIAL FP304 DATABASE SYSTEM Page 18 of 20 e) Draw the ER Diagram for relational schemes in Figure 1.3: PRODUCT ( product_code, product_name, price, brand) BUYS ( recipt_no, product_code, quantity, discount, sub_total) RECIPT ( receipt_no, date, customer_no) CUSTOMER ( customer_no, name, address, phone_no) Figure 1.3 [CLO 3] (5 marks) QUESTION 2 a) i) Explain TWO (2) properties of database transaction. ii) Explain TWO (2) types of recovery tools. [CLO 1] (4 marks) [CLO 2] (2 marks) b) Identify THREE (3) DDL statements in SQL and the function of each statement. [CLO 1] (3 marks) c) Describe the terms below: i. Normalization ii. Second Normal Form (2NF) iii. Third Normal Form (3NF) [CLO 1] (3 marks)
  18. 18. CONFIDENTIAL FP304 DATABASE SYSTEM Page 19 of 20 d) Generate the output for the following SQL statements based on Table 2.1. Table 2.1 i. SELECT vehicleID, platNo, yearProduce, model FROM vehicle WHERE yearProduce >= 2000 ORDER BY yearProduce asc ii. SELECT vehicleID, platNo, model FROM vehicle WHERE model LIKE “Perodua%” iii. SELECT vehicleID, platNo, yearProduce FROM vehicle WHERE price < 20000 iv. SELECT SUM(price) FROM vehicle [CLO 3] (2 marks) (2 marks) (2 marks) (2 marks)
  19. 19. CONFIDENTIAL FP304 DATABASE SYSTEM Page 20 of 20 e) Table 2.2 shows a list of patient appointments with the doctor. Each patient is given the time and date of appointment with doctors in a particular room. Show the steps on how you make the process of normalization stage 1NF, 2NF and 3NF. Appointment [CLO 3] (5 marks) Table 2.2 NoBilik Tarikh Masa AT020123 Kamal 1/12/2002 10.00 S15 AT00111 Jamaliah 1/12/2002 12.00 S15 CT00456 Sudin 1/12/2002 10.00 S10 CT00456 Sudin 14/1/2002 14.00 S10 AT00111 Jamaliah 14/1/2002 16.30 S15 AT00103 Abu 15/1/2002 18.00 S13 NamaPesakit Temujanji 8765 Shamsul 8602 Maizul 8111 Aziz Staff# Nama_Doktor Pesakit#

×