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 GRADE_BOOk database made within the MySQL program.
The functions used to create the database are as follows:
CREATE DATABASE GRADE_BOOK;
USE GRADE_BOOK;
CREATE TABLE Student (
PantherID INT PRIMARY KEY,
Email VARCHAR(255) UNIQUE NOT NULL,
FirstName VARCHAR(255) NOT NULL,
LastName VARCHAR(255) NOT NULL
);
CREATE TABLE Course (
CourseID INT PRIMARY KEY,
CourseName VARCHAR(255) NOT NULL,
Credits INT DEFAULT 0 NOT NULL
);
CREATE TABLE Term (
TermID INT PRIMARY KEY,
TermName VARCHAR(255) NOT NULL,
StartDate DATE NOT NULL,
EndDate DATE NOT NULL
);
CREATE TABLE Section (
SectionID INT,
CourseID INT NOT NULL,
TermID INT NOT NULL,
Mode ENUM('Online','In-person', 'Hybrid') NOT NULL,
Schedule VARCHAR(255),
RoomNumber VARCHAR(255),
PRIMARY KEY (SectionID, CourseID),-- Composite Key
FOREIGN KEY (CourseID) REFERENCES Course(CourseID),
FOREIGN KEY (TermID) REFERENCES Term(TermID)
);
CREATE TABLE GradingScale (
CourseID INT NOT NULL,
Grade CHAR(1) NOT NULL,
MinimumPoints INT NOT NULL,
PRIMARY KEY (CourseID, Grade),
FOREIGN KEY (CourseID) REFERENCES Course(CourseID)
);
CREATE TABLE Enrollment (
EnrollmentID INT PRIMARY KEY,
PantherID INT NOT NULL,
SectionID INT NOT NULL,
CourseID INT NOT NULL,
Status ENUM('Enrolled', 'Completed', 'Dropped') DEFAULT 'Enrolled' NOT NULL,
FinalGrade CHAR(1),-- Adding FinalGrade attribute
FOREIGN KEY (PantherID) REFERENCES Student(PantherID),
FOREIGN KEY (SectionID, CourseID) REFERENCES Section(SectionID, CourseID)
);
CREATE TABLE GradingComponent (
ComponentID INT PRIMARY KEY,
CourseID INT NOT NULL,
ComponentName VARCHAR(255) NOT NULL,
MaxPoints INT NOT NULL,
Weight DECIMAL(5,2) NOT NULL,
FOREIGN KEY (CourseID) REFERENCES Course(CourseID)
);
CREATE TABLE Grade (
GradeID INT PRIMARY KEY,
EnrollmentID INT NOT NULL,
ComponentID INT NOT NULL,
PointsEarned DECIMAL(5,2) NOT NULL,
FOREIGN KEY (EnrollmentID) REFERENCES Enrollment(EnrollmentID),
FOREIGN KEY (ComponentID) REFERENCES GradingComponent(ComponentID)
);
However, there is a step I am missing with which I would like some help.
I need to create an SQL Script (Gradebook_Initial_State.sql) with all SQL commands needed to populate the database as follows:
At least 2 Courses in the COURSE table. (2 rows in total)
-2 Terms in the TERM table (1245-> Summer 2024,1248-> Fall 2024)(2 rows in total)
- At least 2 Sections for each course in the SECTION table(one section offered during each term).(4 rows in total)
- At least 12 students in the STUDENT table.(12 rows in total)
- At least 3 Students enrolled in each section in the ENROLLMENT table.
The same student can be enrolled in more than one section(12 rows in total)
- At least 2 components associated to each course in COMPONENT table. (4 rows in total)
- All entries in GRADED_COMPONENTS based on the enrollment for each section (12x2=24 rows in total)
I have also provided a reference for how the relational schema should look like. Any help would be greatly appreciated!
Hello! I have a GRADE _ BOOk database made within

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!