Documente Academic
Documente Profesional
Documente Cultură
Requirement a foreign key may have either a null entry, as long as it is not part of its tables primary key, or an entry that matches the primary
key value in a table to which it is related.
Purpose It is possible for an attribute not to have a corresponding value, but it will be impossible to have an invalid entry. The enforcement of
the referential integrity rule makes it impossible to delete a row in one table whose primary key has mandatory matching foreign key values in
another table
Example A customer might not yet have an assigned sale rep (number), but it will be impossible to have an invalid sales representative
(number)
CUSTOMERS (Customer#; First Name, Last Name, Address, Order#, Amount Due)
ORDERS (Order#, Order Date, Order Total in $ )
PRODUCTS (Product#, Product Name, Quantity On hand)
ORDER-LINE (Order#, Product#, product name, quantity ordered)
1. Which of the following tables has a composite key?
(a) CUSTOMER (b) ORDERS (c) PRODUCTS (d) ORDER-LINE
2. Which of the following is a weak entity?
(a) CUSTOMER (b) ORDERS (c) PRODUCTS (d) ORDER-LINE
3. Which of the following pairs of tables have a strong or identifying relationship?
(a) CUSTOMER and ORDERS (b) ORDERS and PRODUCTS
(c) ORDERS and ORDER-LINE (d) none of the above
4. Which of the following is a multi-valued attribute in CUSTOMER table?
(a) customer# (b) customer name (c) order# (d) none of the above
5. Which of the following would be the most appropriate PK for a SUPPLIER table?
(a) Supplier-ID (b) Supplier-Name (c) a combination of supplier ID and supplier name (d) supplier phone number (e) none of the
above
6. To create a relationship between CUSTOMER and ORDERS tables, what would you do?
(a) include Customer# column in ORDERS table as a FK column
(b) include Order# column in CUSTOMER table as a FK column
(c) include Order# column in CUSTOMER table and Customer# column in ORDERS table
(d) combine the two tables
7. Which of the following is a FK column in ORDER-LINE table?
(a) Order# (b) Product# (c) both a and b above (d) neither is a FK column in ORDER-LINE
8.
Which of the following attributes in the customers table is a composite attribute?
(a) Customer# (b) First Name (c) Address (d) Amount Due
9.
Which of the following tables has a composite primary key?
(a) customers (b) orders (c) order-line (d) products (e) none of the above
10.
What normal form is the ORDER-LINE table in? (a) 0NF (b) 1NF (c) 2NF (d) 3NF
11.
What normal form is the ORDERS table in? (a) 0NF (b) 1NF (c) 2NF (d) 3NF
12.
Which of the following functional dependence is not valid in a typical business environment?
(a) invoice# --> customer# (b) invoice# --> invoice date (c) invoice# --> product-code
13.
In a unary relationship, the relationship is between/among the instances of:
( a) two entities (b) one entity (c) three entities
14.
Is the relationship between ORDERS and ORDER-LINE tables in the above database
strong? (a) yes (b) no
15.
Are ORDERS and PRODUCTS tables union compatible? ? (a) yes (b) no
16.
Can we perform an inner join of CUSTOMERS and ORDERS tables? (a) yes (b) no
17.
What normal form is the CUSTOMERS table in? (a) 0NF (b) 1NF (c) 2NF (d) 3NF