Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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 DATE

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

8th Edition

013460153X, 978-0134601533

More Books

Students also viewed these Databases questions

Question

fscanf retums a special value EOF that stands for...

Answered: 1 week ago

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago