Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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.