SQL Assignment The schema of these relations is Courses (course, credits, days,
ID: 3872911 • Letter: S
Question
SQL Assignment
The schema of these relations is Courses (course, credits, days, time, room, title, prof, dept) Profs (pname, given, office, ext, email1) Students(name, given, linux, major, email) Enroll (linux, course, grade) Coreq (lect, lab) Dayx (days, dayo, day, jour) - ex: MWF I Mon lundi All attributes are CHARACTER, except for credits, grade, dayo and ext, which are integer. Primary keys are underlined. · SQL statements, here is an outline of the various clauses of SELECT. You can type any sql statement in psql, they can cover several lines, and end with a semicolon (). Up-arrow recalls previous lines. In this outline, keywords are bold, optional things are in [square brackets] and one or more things in (curly brackets) o select (list of attributes and aggregate functions]) o from tablenames ° [where {conditions} ] [group by o [having (conditions) ]] o order by (column (S)) [descending]Explanation / Answer
Hi,
Ans 1- select prof,count(course),sum(credits) from courses
group by prof
Ans 2-
select course, count(linux) from Enroll group by course having count(linux)>=2;
Ans 3-
select course,title,count(linux) from Enroll e
join courses c
on e.course=c.course
group by course,title
having count(linux)>=2
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.