Question: 1 Single Table Constraints Your first task as a database designer is to create an initial schema for all the tables with attributes and their
Single Table Constraints
Your first task as a database designer is to create an initial schema for all the tables with attributes and their abovementioned types. Adhere to the Primary Key and Foreign Key constraints, and use the same names for the tables and the columns. Additionally, add the database requirements calls for the following single table Not NULL, Unique, and check constraints:
Not NULL and Unique Constraints:
tableColumn Name,Constraintfirstname,NOT NULLstudentidNOT NULLcontactnumber,NOT NULL, UNIQUEemailidUNIQUEtotcredits,NOT NULL
Table : student
tableColumn Name,ConstrainttablecourseidcoursenamecreditsNOT NULLNOT NULL, UNIQUE,NOT NULL,
Table : courses
tableColumn Name,ConstraintgradeNOT NULL
Table : studentcourses
tableColumn Name,ConstraintsemesterNOT NULL
Table : courseoffers
tableColumn Name,Constraintprofessorfirstname,NOT NULLprofessorlastname,NOT NULLcontactnumner,NOT NULL
Table : professor
tableColumn Name,Constraintentryyear,NOT NULLseqnumber,NOT NULL
Table : validentry
tableColumn Name,Constraintdeptname,NOT NULL, UNIQUE
Table : department
Check Constraints:
totcredits in the student table should be greater than or equal to
credits in the courses table should be greater than
grade in studentcourses should be between and inclusive
startyear should be less than or equal to resignyear in the professor table.
semester should either be or in courseof fers and studentcourses tables.
courseid must have first characters as some deptid and next characters must be digits.
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
