DO NOT COPY FROM OTHER WEBSITES Upvote guarenteed for a correct and detailed answer. Thank you!!! c.quota);(b) Ocreate assertion check_quotacheck (not exists (select *from(select c.id,...



DO NOT COPY FROM OTHER WEBSITES



Upvote guarenteed for a correct and detailed answer. Thank you!!!


Which of the following assertions captures the requirement that the total number of students enrolled in a course cannot be greater than<br>the course quota?<br>(a) O<br>create assertion check_quota<br>check (not exists (<br>select *<br>from<br>Courses c join Enrolments e on (e.course = c.id)<br>group by e.student<br>having count(*) > c.quota<br>);<br>(b) O<br>create assertion check_quota<br>check (not exists (<br>select *<br>from<br>(select c.id, count(student) as nstu, c.quota<br>from<br>Courses c join Enrolments e on (e.course = c.id)<br>group by c.id, c.quot<br>) as x<br>where<br>x.nstu > x.quota<br>);<br>(c) O<br>create assertion check_quota<br>check (not exists (<br>select *<br>from<br>Courses c<br>where<br>c.quota >= (select count (*) from Enrolments e where e.course = c.id)<br>);<br>(d) O<br>None of the above is correct<br>

Extracted text: 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) O create assertion check_quota check (not exists ( select * from Courses c join Enrolments e on (e.course = c.id) group by e.student having count(*) > c.quota ); (b) O create assertion check_quota check (not exists ( select * from (select c.id, count(student) as nstu, c.quota from Courses c join Enrolments e on (e.course = c.id) group by c.id, c.quot ) as x where x.nstu > x.quota ); (c) O create assertion check_quota check (not exists ( select * from Courses c where c.quota >= (select count (*) from Enrolments e where e.course = c.id) ); (d) O None of the above is correct
Consider the following SQL schema:<br>create table Courses (<br>id integer primary key,<br>code text,<br>title text,<br>quota integer check (quota between 1 and 9999),<br>...<br>);<br>create table Enrolments (<br>student integer references Students (id),<br>course integer references Courses(id),<br>...<br>);<br>

Extracted text: Consider the following SQL schema: create table Courses ( id integer primary key, code text, title text, quota integer check (quota between 1 and 9999), ... ); create table Enrolments ( student integer references Students (id), course integer references Courses(id), ... );
Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here