Designing Database - CompanyDB

📝 Designing Database - CompanyDB

Total Questions: 3
Click an answer to select it, then click "Check Answers" to see your results.
Question 1

What is the purpose of the **FOREIGN KEY** constraint on DeptID in the Employees table?

A.

A) To ensure DeptID values are unique in Employees

B.

B) To link Employees to valid DeptID values in Departments

C.

C) To automatically delete employees when departments are removed

D.

D) To sort employees by department

Question 2

What data type is used for **Salary** in Employees, and why?

A.

A) INT, for whole numbers only

B.

B) VARCHAR(50), for text formatting

C.

C) DECIMAL(10,2), for precise monetary values

D.

D) DATE, for salary history

Question 3

In the companyDB schema, which table structure correctly implements a **many-to-many** relationship between employees and projects?

A.

A) Adding ProjectID to Employees table

B.

B) Adding EmpID to Projects table

C.

C) Creating EmployeeProjects with EmpID and ProjectID as composite primary key

D.

D) Adding both EmpID and ProjectID to Departments

Quiz Complete!

Score: 0 / 3