Using the below University schema, write a SQL query that returns the name (the
ID: 3754589 • Letter: U
Question
Using the below University schema, write a SQL query that returns the name (the column Department) of Departments, in which the ratio of number of faculty members (numerator) to the number of students (NumberOfStudents as denominator) is greater than 0.25 Input Format The Departments and Faculty table are defined as follows: Departments Column Name Type VARCHAR(100) NumberOfStudents INT YearOfEstablishment INT DepartmentHead Faculty Column Name Type FirstName LastNameVARCHAR(255) Department VARCHAR(100) ResearchArea VARCHAR(255)Explanation / Answer
The sql query:
select d.Department from Departments d where (select count(*) from Faculty f where d.department = f.department) / (NumberOfStudents * 1.0) > 0.25;
this query will give all the department names which have the ratio of number of faculty members to number of students is greater than 0.25.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.