Kindly help me solve this SQL:-
University “A” has decided that a new database system is needed for reporting students’ grades. • Students at this university are identified by their student ID, and the database system should store their names and major area of study. • Units in a degree course are identified by the Unit ID. • For each unit within a degree course, the database system (DB) should capture the unit title, unit location of offer and the name of the instructor. The database system should therefore store the grade for each student studying every unit in the degree course.
Question 1: Describe the elements of the table of this database system.
Question 2: Draw the Entity Relationship Diagram (ERD) of the generated tables.
Question 3: Write the SQL code to create the tables.
create table tbl_Major ( MajorID int not null Primary key, MajorName varchar(500)
) create table tbl_DegreeCourse ( DegreeCourseID int not null Primary key, DegreeCourse varchar(500) )
create table tbl_DegreeCourse_Major (
create table tbl_Unit ( UnitID int not null Primary key, DegreeCourse_MajorID int not null foreign key references tbl_DegreeCourse_Major(DegreeCourse_MajorID), UnitTitle varchar(500), UnitLocation varchar(500), InstructorName varchar(500) )
create table tbl_Grade ( GradeID int not null Primary key, GradeName varchar(500)
) create table tbl_Student ( StudentID int not null Primary key, StudentName varchar(500), GradeID int not null foreign key references tbl_Grade(GradeID), UnitID int not null foreign key references tbl_Unit(UnitID)
answered Jan 05 at 02:40 PM