create foreign key constraints for the appropriate tables in your Chicago_School_DB database from the CLI in MySQL. Since your tables have already been created, this will need to be accomplished through the Alter Table command. For a deliverable, take a screen shot of each alter table command successfully being executed.
Chicago School DB relations:
School relation
schoolNumber
name
address
phoneNumber
built
size
Student relation
studentNumber
firstName
lastName
birthdate
schoolNumber
Teacher relation
teacherID
firstName
lastName
hireDate
supervisor
Subject relation
subjectNumber
Name
gradeLevel
Class relation
teacherID
studentNumber
subjectNumber
grade
Administrator relation
employeeNumber
schoolNumber
firstName
lastName
phoneNumber
officerNumber
CREATE DATABASE IF NOT EXISTS `chicago_school_db`;
USE `chicago_school_db`;
DROP TABLE IF EXISTS `teacher`;
CREATE TABLE `teacher` (
`teacherID` int NOT NULL,
`firstname` varchar(50) DEFAULT NULL,
`lastname` varchar(50) DEFAULT NULL,
`hireDate` date DEFAULT NULL,
`supervisor` int DEFAULT NULL,
PRIMARY KEY (`teacherID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
LOCK TABLES `teacher` WRITE;
INSERT INTO `teacher` VALUES (4,'James','Bond','2010-01-24',150),
(16,'Chadwick','Boseman','2008-06-19',4),
(18,'Danai','Gurira','2008-08-14',16),
(24,'Paul','Rudd','2007-08-16',18),
(25,'Gemma','Chan','2006-02-14',4),
(52,'Mark','Ruffalo','2016-04-12',138),
(60,'Chris','Evans','2016-07-01',138),
(76,'Ryan','Reynolds','2001-05-18',101),
(77,'Brie','Larson','2003-02-20',18),
(89,'Tom','Hiddleston','2020-06-05',101),
(101,'Chris','Pratt','2008-06-19',172),
(119,'Tom','Holland','2017-11-07',138),
(138,'Robert','Downey','2003-07-09',52),
(146,'Scarlett','Johansson','2020-06-05',4),
(150,'Anthony','Mackie','2015-02-26',18),
(172,'Benedict','Cumberbatch','2006-02-14',18),
(193,'Jeremy','Renner','2014-07-11',101);
UNLOCK TABLES;
DROP TABLE IF EXISTS `subject`;
CREATE TABLE `subject` (
`subjectNumber` int NOT NULL,
`name` varchar(100) DEFAULT NULL,
`gradeLevel` varchar(2) DEFAULT NULL,
PRIMARY KEY (`subjectNumber`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
LOCK TABLES `subject` WRITE;
INSERT INTO `subject` VALUES (9,'Astronomy','9'),
(13,'US History','12'),(23,'Geography','10'),
(33,'Biology','10'),(35,'Entomology','9'),
(43,'Algebra II','10'),
(53,'Self Defense','12'),
(62,'Algebra','9'),
(67,'Literature','12'),
(70,'Norse Mythology','10'),
(78,'World History','11'),
(83,'Legal Studies','11'),
(85,'Introduction to Computer Science','11');
UNLOCK TABLES;
DROP TABLE IF EXISTS `student`;
CREATE TABLE `student` (
`studentNumber` int NOT NULL,
`schoolNumber` int NOT NULL,
`firstName` varchar(50) DEFAULT NULL,
`lastName` varchar(50) DEFAULT NULL,
`birthDate` date DEFAULT NULL,
PRIMARY KEY (`studentNumber`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
LOCK TABLES `student` WRITE;
INSERT INTO `student` VAL.
MARGINALIZATION (Different learners in Marginalized Group
Add foreign keys to Chicago School DB tables
1. create foreign key constraints for the appropriate tables in your Chicago_School_DB
database from the CLI in MySQL. Since your tables have already been created, this will
need to be accomplished through the Alter Table command. For a deliverable, take a
screen shot of each alter table command successfully being executed.
Chicago School DB relations:
School relation
schoolNumber
name
address
phoneNumber
built
size
Student relation
studentNumber
firstName
lastName
birthdate
schoolNumber
Teacher relation
teacherID
firstName
lastName
hireDate
supervisor
Subject relation