Database Basics

The primary key of an employee table (emp_no, name, dept_code, dept_name) is emp_no, and every column holds a single value. The functional dependencies are emp_no → name, emp_no → dept_code and dept_code → dept_name. Which correctly states the normal form of this table?

  1. AIn second normal form but not in third normal form
  2. BIn first normal form but not in second normal form
  3. CIn third normal form
Show answer and explanation

Answer: A. In second normal form but not in third normal form

Every column holds a single, non-repeating value, so the table is in first normal form. Since the primary key is the single column emp_no, a partial functional dependency on part of the key cannot occur, so it is also in second normal form. However, dept_name is determined via dept_code, which is not the primary key, as in emp_no → dept_code → dept_name; this transitive functional dependency means the table is not in third normal form. As it stands, the department name is repeated in the row of every employee of the same department, and renaming a department requires rewriting many rows. Splitting off a department table (dept_code, dept_name) and keeping only dept_code in the employee table gives third normal form. The employee table's dept_code then becomes a foreign key referring to the department table.

  • A. Correct. There is a transitive functional dependency dept_code → dept_name, so it is not in third normal form.
  • B. The primary key is a single column, so there is no partial functional dependency and the condition for second normal form is met.
  • C. dept_name is determined via dept_code, which is not the primary key; this transitive functional dependency means it is not in third normal form.
Practice this topic Back to topic

Related calculators

Books on Database Basics Ad

As an Amazon Associate I earn from qualifying purchases.

More Database Basics questions

  1. In a database used mainly for reading and aggregation, normalized tables are sometimes deliberately merged into one so that the same data is held in duplicate (denormalization). Which correctly pairs an advantage and a disadvantage of this design?
  2. In an E-R diagram, there is a many-to-many relationship between students and courses: one student takes several courses, and one course is taken by several students. Which is an appropriate way to implement this relationship with relational database tables?
  3. In an account table, a transaction is started, and an UPDATE that subtracts 300 from account A's balance and an UPDATE that adds 300 to account B's balance are executed. Then ROLLBACK is executed instead of COMMIT. What happens to the account table?
  4. Among the ACID properties a transaction should have, which is the property that a transfer debiting account A and crediting account B is either carried out completely or not at all, even if a failure occurs partway through?
  5. The stock count of a product in a stock table is 10. Transaction T1 reads the stock count and writes back the value minus 3, and T2 reads the stock count and writes back the value minus 5. If they run without locks in the order T1 reads, T2 reads, T1 writes, T2 writes, what is the final stock count?