how would i turn this erd into a code for example it should look something like the second photo and first one is the erd
how would i turn this erd into a code for example it should look something like the second photo and first one is the erd
CREATE TABLE Students(Student_ID INT NOT NULL, Student_FN VARCHAR(15), Student_LN VARCHAR(15), Student_SSN INT, Student_ADD VARCHAR(45), Student_Contact int, Student_Email VARCHAR(30), PRIMARY KEY (Student_ID));
CREATE TABLE Grade(Student_ID INT, Exam_Name VARCHAR(15) NOT NULL, Student_Grade VARCHAR(5), PRIMARY KEY(Exam_Name),FOREIGN KEY(Student_ID) REFERENCES Students(Student_ID));
CREATE TABLE Courses(Course_ID INT NOT NULL, Course_Name VARCHAR(15), PRIMARY KEY(Course_ID));
CREATE TABLE Exam(Exam_ID INT NOT NULL, Exam_Name VARCHAR(15), Exam_Date DATE, Exam_Type VARCHAR(15), Course_ID INT, PRIMARY KEY(Exam_ID), FOREIGN KEY(Course_ID) REFERENCES Courses(Course_ID));
CREATE TABLE Student_Course(Student_ID INT, Course_ID INT,Enrollment_Date DATE, PRIMARY KEY(Course_ID), FOREIGN KEY(Student_ID) REFERENCES Students(Student_ID), FOREIGN KEY(Course_ID) REFERENCES Courses(Course_ID));
CREATE TABLE Fee( Fee_ID INT NOT NULL, Fee_AMT INT, Fee_Course_ID INT, Fee_Type VARCHAR(20), Due_Date DATE, Late_Fee INT, Total_Fee INT, PRIMARY KEY(Fee_ID));
CREATE TABLE Instructors(Instructor_ID INT NOT NULL, Instructor_Name VARCHAR(20), Instructor_Course VARCHAR(30), PRIMARY KEY(Instructor_ID));
Step by step
Solved in 2 steps