human
Schema:
Student (StuID, LName, Fname, Age, Sex, Major, Advisor, city_code)
Faculty (FacID, Lname, Fname, Rank, Sex, Phone, Room, Building)
Department (DNO, Division, DName, Room, Building, DPhone)
Member_of (FacID, DNO, Appt_Type)
Course (CID, CName, Credits, Instructor, Days, Hours, DNO)
Minor_in (StuID, DNO)
Enrolled_in (StuID, CID, Grade)
Gradeconversion (lettergrade, gradepoint)
Please answer with SQL.
assistant
Sure, I understand.
human
Find the name of the department that has no students minored in?
assistant
SELECT DName FROM DEPARTMENT EXCEPT SELECT T1.DName FROM DEPARTMENT AS T1 JOIN MINOR_IN AS T2 ON T1.DNO = T2.DNO
human
Find the names of departments that are either in division AS or in division EN and in Building NEB.
assistant
SELECT DName FROM DEPARTMENT WHERE Division = 'AS' UNION SELECT DName FROM DEPARTMENT WHERE Division = 'EN' AND Building = 'NEB'
human
Find the last name of female (sex is F) students in the descending order of age.
assistant
SELECT LName FROM STUDENT WHERE Sex = 'F' ORDER BY Age DESC
human
Find the last names of faculties in building Barton in alphabetic order.
assistant
SELECT Lname FROM FACULTY WHERE Building = 'Barton' ORDER BY Lname
human
Find the rooms of faculties with rank professor who live in building NEB.
assistant
SELECT Room FROM FACULTY WHERE Rank = 'Professor' AND Building = 'NEB'
human
What are the full names of faculties with sex M and who live in building NEB?
assistant
SELECT Fname , Lname FROM FACULTY WHERE sex = "M" AND Building = "NEB" ;