Question
1) List all the possible candidate key(s) for the departments table. /2 2) If we didnt use a surrogate key for the primary key on
1) List all the possible candidate key(s) for the departments table. /2
2) If we didnt use a surrogate key for the primary key on the enrollments table, what would
you have used as a natural primary key instead and why? /4
3) We have a gender column on the students table. The type on this column is a CHAR(1), but
any single character value could be input into that field right now.
a) Name two different approaches you could use to make sure that only the ISO gender
codes (M,F,U,N) are valid values to insert into the gender column. /4
b) Write the DDL you would use to implement both of these solutions (but dont actually
change anything in the database). /10
4) Currently in the sections table, it is possible for the num_enrolled to be higher than the max_enrollment. What could you add to make sure this doesnt happen? Write the code that would accomplish this. /10
d INT first name VARCHAR(100) last namo VARCHARC100) email-address VARCHAR(100) major_code VARCHAR(10) gender CHAR) d INT code VARCHAR(10 name VARCHAR(100) Departments id INT code VARCHAR10) University id INT name VARCHAR100) id INT student id INT section id INT grade NUMERIC status code VARCHARO COurse desc TEXT credit units NUMERIC uriversity id INT id INT id INT section code VARCHARC100 d INT employee number INT first name VARCHAR(100) last name VARCHARC100) seniority_date DATE email address VARCHAR100) lec type VARCHAR(10) term id INT enrolled INT num num waitlisted INT instructor id INT days VARCHAR3) start time TIME end time TIME location-code VARCHAR(10) ia INT code VARCHAR10) name VARCHARI500 start date DATE end date DATEStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started