Which of these designs represents a normalized schema that meets the project requirements?

You have been tasked to create a database that will store a list of all managers and the
employees who report directly to them. The following is stipulated:
• No manage is managing more than three people.
• No employee can work for more than one manage.
Which of these designs represents a normalized schema that meets the project
requirements?

You have been tasked to create a database that will store a list of all managers and the
employees who report directly to them. The following is stipulated:
• No manage is managing more than three people.
• No employee can work for more than one manage.
Which of these designs represents a normalized schema that meets the project
requirements?

A.
CREATE TABLE ‘manager’
‘manager’ varchar (50) DEFAULT NULL,
‘employee2’ varchar (50) DEFAULT NULL,
‘employee’ varchar (50) DEFAULT NULL,
UNIQUE ( ‘manager ‘, ‘employee1’, ‘employee2, ‘employee3’)
)

B.
CREATE TABLE ‘managers’ (
“id’ int(11) NOT NULL AUTO_INCREMENT,
‘manager’ varchar (50) DEFAULT NULL ,
PRIMARY KEY (‘id’)
)
CREATE TABLE “employees’ (
‘id’ int(11) NOT NULL AUTO _INCREMENT,
‘manager_id’ int(11) DEFAULT NULL,
‘employee varchar (25) DEFAULT NULL,
PRIMARY KEY (‘id’)
)

C.
CREATE TABLE ‘manager’ (
‘manager’ varchar (50) DEFAULT NULL,
‘employee_list’varchar (150) DEFAULT NULL,
)

D.
CREATE TABLE ‘message’ (
‘id’ int(11) NOT NULL AUTO_INCREMENT,
‘manager’ varchar(50) DEFAULT NULL,
PRIMARY KEY (“id’)
)
CREATE TABLE ‘employees’ (
‘id int (11) NOT NULL AUTO _INCREMENT,
‘ employees’ varchar(25) DEFAULT NULL,
)



Leave a Reply 7

Your email address will not be published. Required fields are marked *


Kurva

Kurva

i think it’s B. Because for N:1 relationship (1 to many) you need 2 tables.
If you store them in 1 table you will have a lot of problems.
For example if manager named ‘IdontGiveAfuck’ has 1 employee that means that the rest 2 columns would have value NULL. and that’s not good.

sqlLover

sqlLover

All logics are accepted. how B satisfies the condition?

Kurav

Kurav

it can’t be A for sure. Because two managers can have the same name.
So column manager can’t have unique index.