Sei sulla pagina 1di 8

Self-test RDBMS concepts

Document: e1034test.fm 19/04/2012

ABIS Training & Consulting P.O. Box 220 B-3000 Leuven Belgium

TRAINING & CONSULTING

INTRODUCTION SELF-TEST RDBMS CONCEPTS


With this self-test you can see for yourself if you have enough background on relational database concepts to follow more advanced courses in this domain. The test is based on topics treated in the RDBMS concepts course. This test consists of 20 multiple choice questions. Write down your responses and compare them with the solutions given on the last page. This test will take about fifteen minutes.

19/04/2012

Self-test RDBMS concepts

QUESTIONS SELF-TEST RDBMS CONCEPTS


1. Indicate whether this statement is true or false.

The domain of a column containing the month number of the date of birth of employees differs from the domain of a column with the day number of that date.
O (a) O (b) 2. true false
The domain of month numbers goes from 1 to 12, so differs from the domain of day numbers. However, the datatype might be the same (INT or SMALLINT).

Indicate whether this statement is true or false.

Restricting the domain of a numeric column to non-negative values can be implemented with a check constraint.
O (a) O (b) 3. true false
Except with a before-trigger, this is the only way to restrict a value to the positive range, since there is no datatype as a POSITIVEINT.

Indicate whether this statement is true or false.

The restriction on the domain for the date of birth must be implemented with a check constraint when the aim is that for every employee the date of birth must be known.
O (a) O (b) 4. true false
A check constraint cant specify a NOT NULL condition. Thats why there is a NOT NULL option in the definition of each column.

Indicate whether this statement is true or false.

A NULL value means that a value is not known, or that a feature does not apply to a certain individual.
O (a) O (b) 5. true false

Indicate whether this statement is true or false.

The primary key column must contain unique values.


O (a) O (b) 6. true false
Of course, only in the assumption that were talking about a single column PK. This seems to be the case, since theres written The primary key column instead of A primary key column.

Indicate whether this statement is true or false.

The primary key column may contain NULL values.


O (a) O (b) true false

19/04/2012

Self-test RDBMS concepts

7.

Indicate whether this statement is true or false.

A foreign key column must contain unique values.


O (a) O (b) 8. true false

Indicate whether this statement is true or false.

A foreign key column may contain NULL values.


O (a) O (b) 9. true false

Indicate whether this statement is true or false.

A view is an alternative method to store data.


O (a) O (b) 10. true false
A VIEW is a virtual table, a alternate views on the data, not an alternate storage of data.

Indicate whether this statement is true or false.

A stored procedure is only executed when asked for explicitly.


O (a) O (b) 11. true false
This in opposition to a trigger, where the execution is always automatic.

Indicate whether this statement is true or false.

A trigger can be used instead of a foreign key to implement referential integrity.


O (a) O (b) 12. true false
Obviously this isnt the regular way of enforcing referential integrity. However, a before trigger can consult another table with a subquery to check if the to be inserted value is allowed, and to refuse the insert if it isnt.

Indicate whether this statement is true or false.

A trigger can be used instead of a check constraint.


O (a) O (b) true false
A before-trigger can implement the exact same condition as a check constraint.However, the reverse is not true: a condition referring to another row besides the being-inserted or being-upfated row, can only be implemented by a before-trigger.

19/04/2012

Self-test RDBMS concepts

13.

Can the following construction be used in a relational system, if we want to assign a single name (first name and last name) and one or more telephone numbers to a certain person?
person number 1 2 3 name Wouters Peter Peeters Jan Janssens Wouter phone number 016/549216, 0498/526984 0488/965235 03/5214963, 0478/625398

O (a) O (b) 14.

yes no
A single field cant contain a list of values, at least not in the first base table form.

Can the following construction be used in a relational system, if we want to assign a single name (first name and last name) and one or more telephone numbers to a certain person?
person number 1 1 3 3 2 name Wouters Peter Wouters Peter Janssens Wouter Janssens Wouter Peeters Jan phone number 016/549216 0498/526984 03/5214963 0478/625398 0488/965235

O (a) O (b) 15.

yes no
The same PERSON NUMBER and/or NAME refers to the same person, each time with a different PHONE NUMBER. Take notice PERSON NUMBER isnt the PK for this table.

Can the following construction be used in a relational system, if we want to assign a single name (first name and last name) and one or more telephone numbers to a certain person?
person number 1 1 2 2 3 3 name Wouters Peter Peeters Jan Janssens Wouter phone number 016/549216 016/549216 0488/965235 0488/965235 03/5214963 03/5214963

O (a) O (b)

yes no
In this case theres no way to distinguish between firt and last name.

19/04/2012

Self-test RDBMS concepts

16.

Can the following construction be used in a relational system, if we want to assign a single name (first name and last name) and one or more telephone numbers to a certain person?
person number 1 1 2 3 3 phone number 016/549216 0498/526984 0488/965235 03/5214963 0478/625398 person number 1 2 3 name Wouters Peter Peeters Jan Janssens Wouter

O (a) O (b) 17.

yes no
The first column of each table guarantees the link, respectively FK and PK. The PK of the first table isnt the first column; its either the second or the combination of first and second.

Can the following construction be used in a relational system, if we want to assign a single name (first name and last name) and one or more telephone numbers to a certain person?
PK ID 1 2 3 4 5 Foreign Key person number 2 1 3 1 3 phone number 0488/965235 016/549216 03/5214963 0498/526984 0478/625398 Primary Key person number 1 2 3 name Wouters Peter Peeters Jan Janssens Wouter

O (a) O (b) 18.

yes no
The order of the rows isnt relevant. The occurance of an artificial PK isnt necessary, but it is possible.

Can the following construction be used in a relational system? The domain of the language column is {N,F,E}.
person number 1 2 3 name Wouters Peter Peeters Jan Janssens Wouter language N N F

O (a) O (b)

yes no
Not every possible value of a domain must be present in the actual column.

19/04/2012

Self-test RDBMS concepts

19.

Can the following construction be used in a relational system? The delete rule for both primary keys is on delete cascade.
PK ID 1 2 3 4 5 Foreign Key person number 1 1 2 3 3 phone number 016/549216 0498/526984 0488/965235 03/5214963 0478/625398 Primary Key person number 1 2 3 name Wouters Peter Peeters Jan Janssens Wouter

O (a) O (b) 20.

yes no

Can the following construction be used in a relational system? The domain of the married column is {Y,N}.
person number 1 2 3 name Wouters Peter Peeters Jan Janssens Wouter married N NULL Y

O (a) O (b)

yes no
A NULL-value is possible, independent of any limitations due to domain definition.

19/04/2012

Self-test RDBMS concepts

EVALUATION.
Here are the correct answers to all questions: 1. 2. 3. 4. 5. 6. 7. 8. 9. a a b a a b b a b

10. a 11. a 12. a 13. b 14. a 15. b 16. a 17. a 18. a 19. a 20. a Give yourself 1 point for each correctly answered question. If you have less than 14 correct answers, we advise you to follow the RDBMS concepts course. If you have more than 17 correct answers, it is not useful anymore to follow this course. You can immediately register for other database courses (SQL fundamentals, DB2, Oracle, MySQL or SQLServer ...). You may check your SQL background first with our selftest SQL and our self-test SQL workshop. If your score is between 14 and 17, you have already some background knowledge on relational databases, but you will certainly still learn a lot in the RDBMS concepts course.

19/04/2012

Self-test RDBMS concepts

Potrebbero piacerti anche