T490 Spring 2009 Final


Part I, True/False Questions :

1. In procedural languages the developer must specify the sequence of a set of commands.
True. False.

2. The sort order of SQL query results can be changed according to user requirements.
True. False.

3. General purpose programming languages, such as Java and C# are still used in relational database application development despite the invention of Structured Query Language (SQL).
True. False.

4. There is no way to store procedural code persistently within the database.
True. False.

5. Unlike tables created using the INSERT INTO Statement, the output obtained by VIEWs, will always be up-to-date in response to changes in the underlying data.
True. False.

6. Data triggers can only be set to activate after a change occurs in a value in a row.
True. False.

7. Views can be used exactly like tables in any retrieval query
True. False.

8. When a class participates in a reflexive relationship, it should always use the same role on both ends of the association.
True. False.

9. The primary key can never have the null value but may be duplicated if necessary
True. False.

10. A class should never be linked back to itself as this creates endless loops in class diagrams.
True. False.

11. The Relations in a relational database should be designed to appeal to the end user since the user may use them directly without forms
True. False.

12. Normalization usually results in fewer tables in the database and therefore a simpler and better design.
True. False.

13. Including computed attributes in database tables is always a good idea as they save computation time.
True. False.

14. If a user wishes to print a category name next to each row of output of a SQL query depending on certain classification criteria, the CASE function can be used.
True. False.

15. Overlapping subclasses in a class diagram result in the same object appearing in more than one subclass, and therefore should not be allowed.
True. False.

16. The UNION operation requires the operand tables to be union-compatible, while the INTERSECT command does not require them to have this property.
True. False.

17. A view cannot be used exactly like a table when there is a need to update the view.
True. False.

18. A Row alias is a well known mechanism to control the naming of rows in query results
True. False.

19. In database technology, existing applications should always be re-coded in response to changes in storage structures and/or access techniques.
True. False.

20. Dependency information can never be accidentally lost in a table through deletion anomaly, even if the table is not in 2NF.
True. False.

21. Columnar forms differ form Tabular forms in the way they present the data to the user.
True. False.

22. 2NF does not necessarily require the table to have a simple primary key.
True. False.

23. Class diagrams used in relational modeling are related to the object-oriented approach
True. False.

24. Report headers differ from page headers in the frequency and locations in which the headers will appear in the final report.
True. False.

Use the following to answer question 25:
The following functional dependencies apply to an assembly line relation in a factory database:
Functional Dependency 1: Supervisor Task
Functional Dependency 2: (EmpID, Task) Supervisor, Supervisor-Evaluation
Relation: Employee-Task (EmpID, Task, Supervisor, Supervisor-Evaluation)
25. An employee can be assigned to the same task under many supervisors.
True. False.


Part II, Multiple Choice Questions:


26. Which of the following statements best describes a foreign key?
A) A simple, non-composite attribute
B) An attribute that is unrelated to the current table
C) A non-unique attribute linked to a primary key in another table
D) None of the above

27. In transaction processing, the term "Atomicity" is used to means that:
A) Other transactions cannot see or access intermediate states
B) Either all of the tasks of a transaction are performed or none of them are
C) The transaction consists of many small subtransactions
D) The database remains in a consistent state before and after the transaction is executed

28. Which of the following modeling constructs are most related conceptually, but not identical?
A) Generalization and reflexive association
B) Aggregation and reflexive association
C) Composition and aggregation
D) None of the above

29. Optimistic locking is most appropriate when:
A) Most transactions are highly related
B) Most transactions are unrelated
C) There is a large number of users
D) There is a small number of users

30. Which of the following best applies to feedback in human-computer interactions?
A) Helps users know when the computer has received their input
B) It speeds up system performance
C) Should be avoided because it slows down user entry of data
D) It confuses the user sometimes

31. If there are no repeating attributes or groupings of attributes, a table is said to be:
A) In Boyce-Codd Normal Form
B) Un-normalized
C) In first Normal Form
D) Redundant

32. SQL is mostly used in
A) Object-Oriented databases
B) Java
C) C++
D) Relational databases

33. If you wish to allow the user to enter a value on a form or choose from a list, you should use:
A) A combo box control
B) A drop-down list control
C) An edit (text) box
D) A menu control

34. Which of the following are characteristics of Graphical User Interfaces (GUIs)?
A) Is user friendly for most users
B) Limits access for users facing some physical challenge
C) Slows down professional users who can use command line interface efficiently
D) All of the above

35. BCNF requires that:
A) The relation must be in 2NF
B) No non-key attribute can determine part of the primary key
C) The relation must be in 1NF
D) All of the above

36. Which of the following reasons best describe the reason why the following query will not run against the Student table shown?

SELECT * FROM Student WHERE StudentCity = "Amman" GROUP BY DepartmentID;

Student (StudentID, StudentName, StudentAddress, StudentCity, StudentTel, DepartmentID)
A) It selects attributes outside the grouping attributes
B) DepartmentID is not defined
C) There is a type mismatch in the query
D) It is syntactically incorrect

37. According to DeMorgan's Law, the boolean expression NOT ((NOT A) OR (NOT B)) is equivalent to:
A) NOT (A AND NOT B)
B) NOT(A OR B)
C) (A AND B)
D) (NOT A) AND (NOT B)

38. What will be the result of executing the following query
SELECT A1.AnimalID, A1.Name, A1.Category, SaleAnimal.SalePrice
FROM Animal As A1 INNER JOIN SaleAnimal
ON A1.AnimalID = SaleAnimal.AnimalID
WHERE (SaleAnimal.SalePrice > (SELECT Avg(SaleAnimal.SalePrice)
FROM Animal As A2 INNER JOIN SaleAnimal
ON A2.AnimalID = SaleAnimal.AnimalID
WHERE (A2.Category = A1.Category) ) );
A) The animals that have sold for a price higher than the average "SalePrice" of "SaleAnimals".
B) The query will not run correctly. It contains syntax errors.
C) The query will run but will produce an empty result.
D) The animals that have sold for a price higher than the average for animals in that Category.

39. A marriage relation is said to be in third normal form when:
A) All attributes are dependent only on the bride (wife) ID
B) All attributes are dependent on a third attribute other than the groom ID or the bride ID
C) All attributes are dependent only on the groom (husband) ID
D) All attributes are dependent only on both the groom and bride IDs

40. Which of the following best describes the need for N-ary associations?
A) They cannot be easily replaced by binary associations
B) They are essential in reducing redundancy in the tables
C) They simplify the class diagram
D) None of the above

41. Many-to-Many associations are only permitted in high-level class diagrams because:
A) They cannot be implemented directly in a relational database
B) They cannot be translated into a pair of one to many associations
C) They complicate the class diagram
D) None of the above

42. Which SQL keyword is used to sort the query results?
A) ORDER BY
B) GROUP BY
C) SORT
D) DISTINCT

43. Which of the following describes triggers in databases?
A) Fire automatically when the condition is satisfied
B) Contain both a condition part and an action part
C) Allow the developer to save some of the application logic in the database
D) All of the above

44. Which of the following best describes a subform?
A) A form that displays data from two tables that have a one-to-many relationship
B) A form that displays data from two tables that have a one-to-one relationship
C) Is a subset of columns and rows in a larger form
D) A form that is smaller in size than the original from from which it is derived

45. Which of the following best describes the LEFT OUTER JOIN?
A) Presents all data from the right side of a join and only matching data from the left side
B) Presents data from the left side of a join only and no matching records form the right
C) Presents no data from the left side of a join but presents matching records form the right
D) Presents all data from the left side of a join and matching records from the right side

46. In which of the following situations would you definitely choose the relational database technology over the old file system method?
A) An airline reservation system
B) A simple home shopping list application
C) A missile guidance system which requires speed but with no need for user queries, sharing or data independence
D) A phone book application with one table containing 200 records

47. Which of the following are SQL DDL commands?
A) DROP TABLE, CREATE INDEX, DROP INDEX
B) CREATE VIEW
C) CREATE SCHEMA, CREATE TABLE, ALTER TABLE
D) All of the above

48. A correlated subquery is inefficient because:
A) The subquery syntax is more complicated
B) The user must enter each correlated value manually
C) Calculations in the subquery must be recomputed for each entry in the main table.
D) Both B and C above

49. To specify that all matching records in a referring relation should be deleted whenever the matching record in the referenced relation is deleted, it is best to use:
A) Cascade delete
B) Host language programming code
C) SQL delete statement
D) None of the above

50. Compared to the database approach, the old file system approach offers these unique advantages:
A) Simplicity and occasionally faster response time
B) Minimal data redundancy and ease of application development
C) The ability to store and retrieve data
D) Access to data through application programs and user queries

Quiz script provided by
JavaScriptKit.com