Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider the following SQL schema: create table Courses ( id integer primary key, code text, title text, quota integer check ( quota between 1 and
Consider the following SQL schema:
create table Courses
id integer primary key,
code text,
title text,
quota integer check quota between and
;
create table Enrolments
student integer references Studentsid
course integer references Coursesid
;
Which of the following assertions captures the requirement that the total number of students enrolled in a course cannot be greater than the course quota?
a
create assertion checkquota
check not exists
select
from Courses c join Enrolments e on ecourse cid
group by estudent
having count cquota
;
b
create assertion checkquota
check not exists
select
from select cid countstudent as nstu, cquota
from Courses c join Enrolments e on ecourse cid
group by cid cquota
as x
where xnstu xquota
;
c
create assertion checkquota
check not exists
select
from Courses c
where cquota select count from Enrolments e where ecourse cid
;
d
None of the above is correc
Step 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