Question: Hello! I have a GRADE _ BOOk database made within the MySQL program. The functions used to create the database are as follows: CREATE DATABASE
Hello! I have a GRADEBOOk database made within the MySQL program.
The functions used to create the database are as follows:
CREATE DATABASE GRADEBOOK;
USE GRADEBOOK;
CREATE TABLE Student
PantherID INT PRIMARY KEY,
Email VARCHAR UNIQUE NOT NULL,
FirstName VARCHAR NOT NULL,
LastName VARCHAR NOT NULL
;
CREATE TABLE Course
CourseID INT PRIMARY KEY,
CourseName VARCHAR NOT NULL,
Credits INT DEFAULT NOT NULL
;
CREATE TABLE Term
TermID INT PRIMARY KEY,
TermName VARCHAR NOT NULL,
StartDate DATE NOT NULL,
EndDate DATE NOT NULL
;
CREATE TABLE Section
SectionID INT,
CourseID INT NOT NULL,
TermID INT NOT NULL,
Mode ENUMOnlineInperson', 'Hybrid' NOT NULL,
Schedule VARCHAR
RoomNumber VARCHAR
PRIMARY KEY SectionID CourseID Composite Key
FOREIGN KEY CourseID REFERENCES CourseCourseID
FOREIGN KEY TermID REFERENCES TermTermID
;
CREATE TABLE GradingScale
CourseID INT NOT NULL,
Grade CHAR NOT NULL,
MinimumPoints INT NOT NULL,
PRIMARY KEY CourseID Grade
FOREIGN KEY CourseID REFERENCES CourseCourseID
;
CREATE TABLE Enrollment
EnrollmentID INT PRIMARY KEY,
PantherID INT NOT NULL,
SectionID INT NOT NULL,
CourseID INT NOT NULL,
Status ENUMEnrolled 'Completed', 'Dropped' DEFAULT 'Enrolled' NOT NULL,
FinalGrade CHAR Adding FinalGrade attribute
FOREIGN KEY PantherID REFERENCES StudentPantherID
FOREIGN KEY SectionID CourseID REFERENCES SectionSectionID CourseID
;
CREATE TABLE GradingComponent
ComponentID INT PRIMARY KEY,
CourseID INT NOT NULL,
ComponentName VARCHAR NOT NULL,
MaxPoints INT NOT NULL,
Weight DECIMAL NOT NULL,
FOREIGN KEY CourseID REFERENCES CourseCourseID
;
CREATE TABLE Grade
GradeID INT PRIMARY KEY,
EnrollmentID INT NOT NULL,
ComponentID INT NOT NULL,
PointsEarned DECIMAL NOT NULL,
FOREIGN KEY EnrollmentID REFERENCES EnrollmentEnrollmentID
FOREIGN KEY ComponentID REFERENCES GradingComponentComponentID
;
However, there is a step I am missing with which I would like some help.
I need to create an SQL Script GradebookInitialState.sql with all SQL commands needed to populate the database as follows:
At least Courses in the COURSE table. rows in total
Terms in the TERM table Summer Fall rows in total
At least Sections for each course in the SECTION tableone section offered during each term rows in total
At least students in the STUDENT table. rows in total
At least Students enrolled in each section in the ENROLLMENT table.
The same student can be enrolled in more than one section rows in total
At least components associated to each course in COMPONENT table. rows in total
All entries in GRADEDCOMPONENTS based on the enrollment for each section x rows in total
I have also provided a reference for how the relational schema should look like. Any help would be greatly appreciated!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
