Question: CAN I GET SOME HELP WITH THE FOLLOWING SQL QUERY PLEASE? -- -- 2. Capacity of each building. -- -- Example. Assume that at some

CAN I GET SOME HELP WITH THE FOLLOWING SQL QUERY PLEASE?

-- -- 2. Capacity of each building. -- -- Example. Assume that at some univesity there are only 2 buildings: Bruner Hall and Foundation Hall. There are 2 classrooms in BH with total capacity of 50 and 3 classrooms in FH with total capacity of 70. In that case, the query should return the relation with 2 tuples: Brunner Hall | 50 and Foundation Hall | 70.

****HERE ARE THE TABLES IN THE DATABASE****

CAN I GET SOME HELP WITH THE FOLLOWING SQL QUERY PLEASE? --

-- 2. Capacity of each building. -- -- Example. Assume that atsome univesity there are only 2 buildings: Bruner Hall and Foundation Hall.There are 2 classrooms in BH with total capacity of 50 and3 classrooms in FH with total capacity of 70. In that case,

create database university, use university; show tables; department create table department (dept_name varchar(20), building varchar(15), budget numeric (12,2) check (budget > %), primary key (dept_name)); instructor create table instructor (id varchar(5), name varchar(20) not null, dept_name varchar(20), salary numeric(8,2), primary key(id)) foreign key (dept_name) references department (dept_name) on delete set null -); classroom create table classroom (building varchar(15), room_number varchar(7), capacity numeric(4,0), primary key (building, room_number) ); course create table course (course_id varchar(8), title varchar(50), dept_name varchar(20), credits numeric(2,) check (credits > 0), primary key (course_id), foreign key (dept_name) references department (dept_name) on delete set null ); section create table section (course_id varchar(8), sec_id varchar(8), semester varchar(6) check (semester in ('Fall', 'Winter', 'Spring', 'Summer')), year numeric(4,) check (year > 1701 and year = %), primary key (ID), foreign key (dept_name) references department(dept_name) on delete set null ); takes create table takes (ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), grade varchar(2), primary key (ID, course_id, sec_id, semester, year), foreign key (course_id, sec_id, semester, year) references section (course_id, sec_id, semester, year) on delete cascade, foreign key (ID) references student(ID) on delete cascade ); advisor create table advisor (S_ID varchar(5), i_ID varchar(5), primary key (S_ID), foreign key (i_ID) references instructor (ID) on delete set null, foreign key (S_ID) references student (ID) on delete cascade ); time_slot create table time_slot (time_slot_id varchar(4), day varchar(1), start_hr numeric(2) check (start_hr >= 0 and start_hr = 0 and start_min = 0 and end_hr = 0 and end_min

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!