CMPUT 291 Final Examination over view question – Dec University of Alberta Section: A1 Name Signature Instructions: 1. Turn off your cell phone. 2. Sign your name on the signature line. 3. Place your student id number in the designated spot on the top of the next page. 4. The time for this test is 3 hours. 5. The exam is “closed -book”, i.e., no references, notes, books, calculators, or smart phones are allowed. 6. Place all answers in this booklet and do not hand in any other work. CMPUT 291 Midterm Exam Page 2 of 16 Student Id Number: Marks obtained: Part 1 Part 2 Part 3 Part 4 Total /20 /20 /30 /20 /90 Part 1 [20 marks] 1. [4 marks] Consider the following statements about data models for databases: 1. Logical Data Independence means that data can be accessed independently and concurrently by different users. 2. Physical data independence means that the physical schema can be changed without changing applications. 3. Physical data independence means that the conceptual schema can be changed without changing the physical schema . 4. Physical Data Independence is a special case of Logical Data Independence. Which of the following assertions is correct? Select only one. Statements 1, 2, and 4 are correct, and statement 3 is incorrect. Statements 2 and 4 are correct, and statements 1 and 3 are incorrect. Statements 3 and 4 are correct, and statements 1 and 2 are incorrect. Statement 2 is correct, and statements 1, 3 and 4 are incorrect. Statement 3, is correct, and statements 1, 2, and 4 are incorrect. All are correct. All are incorrect. CMPUT 291 Midterm Exam Page 3 of 16 2. [4 marks] Consider the following statements related to keys: 1. If a superkey consists of only one attribute, then the superkey must also be a candidate key. 2. If a superkey consists of more than one attribute, then it cannot be a candidate key because it is not minimal. 3. Assume a relation R(A,B,C,D) where all fields are numeric and A is the primary key. The following two SQL statements always return the same result: - select C from R where C = 2*A - select distinct C from R where C = 2*A 4. Every Relation has at least one key. Which of the following assertions is correct? Select only one. Statements 1, 2, are correct, and statements 3 and 4 are incorrect. Statements 1 and 3 are correct, and statements 2 and 3 are incorrect. Statements 2 and 3 are correct, and statements 1 and 4 are incorrect. Statements 1, 3, 4 are correct, and statement 2 is incorrect. Statements 1, 2, 3 are correct, and statement 4 is incorrect. All are correct. All are incorrect. 3. [4 marks] Consider the following statements about NULL values: 1. If no attribute of a relation is allowed to contain NULL values, then the combination of all attributes is a candidate key for that relation. 2. A field with a foreign key constraint can contain NULL values. 3. Assume that A is equal to NULL, B is equal to 70, and C is equal to 30. Then, the following expression evaluates to unknown : NOT ( (A > B) OR (B+C = 100) ). 4. Assume that A is equal to NULL, B is equal to 70, and C is equal to 30. Then, the following expression evaluates to unknown : ( (A < B) AND (B+C = 100) ). Which of the following assertions is correct? Select only one. Statements 1, 2, and 4 are correct, and statement 3 is incorrect. Statements 2, 3, and 4 are correct, and statement 1 is incorrect. Statements 3 and 4 are correct, and statements 1 and 2 are incorrect. Statements 2 and 4 are correct, and statements 1 and 3 are incorrect. Statement 2 is correct, and statements 1, 3, and 4 are incorrect. All are correct. All are incorrect.