D427 DATA MANAGEMENT
COMPREHENSIVE TASK PAPER WITH
SOLVED QUESTIONS
◉ CREATE TABLE Employee (
ID INT,
NAME VARCHAR(60),
PRIMARY KEY (ID),
);
This would make the PRIMARY KEY the ID column.
Answer: To set the primary key, you would include it in the _______
__________ statement.
The syntax is:
◉ CREATE TABLE Department (
Code INT UNSIGNED,
ManagerID INT UNSIGNED,
PRIMARY KEY (Code),
FOREIGN KEY (ManagerID) REFERENCES Employee(ID)
);
, This would make the ManagerID be a foreign key of the ID column
on the employee table.
Answer: To set the foreign key, you would include it in the _______
__________ statement.
The syntax is:
◉ A signed number may be negative.
An unsigned number cannot be negative.
Answer: With integers, remember the difference between signed
and unsigned numbers!
◉ RESTRICT
CASCADE
SET NULL
SET DEFAULT
On a FOREIGN KEY for example:
CREATE TABLE Department (
Code INT UNSIGNED,
ManagerID INT UNSIGNED,
PRIMARY KEY (Code),
COMPREHENSIVE TASK PAPER WITH
SOLVED QUESTIONS
◉ CREATE TABLE Employee (
ID INT,
NAME VARCHAR(60),
PRIMARY KEY (ID),
);
This would make the PRIMARY KEY the ID column.
Answer: To set the primary key, you would include it in the _______
__________ statement.
The syntax is:
◉ CREATE TABLE Department (
Code INT UNSIGNED,
ManagerID INT UNSIGNED,
PRIMARY KEY (Code),
FOREIGN KEY (ManagerID) REFERENCES Employee(ID)
);
, This would make the ManagerID be a foreign key of the ID column
on the employee table.
Answer: To set the foreign key, you would include it in the _______
__________ statement.
The syntax is:
◉ A signed number may be negative.
An unsigned number cannot be negative.
Answer: With integers, remember the difference between signed
and unsigned numbers!
◉ RESTRICT
CASCADE
SET NULL
SET DEFAULT
On a FOREIGN KEY for example:
CREATE TABLE Department (
Code INT UNSIGNED,
ManagerID INT UNSIGNED,
PRIMARY KEY (Code),