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 last names of faculties who are members of computer science department.
assistant
SELECT T2.Lname FROM DEPARTMENT AS T1 JOIN FACULTY AS T2 ON T1.DNO = T3.DNO JOIN MEMBER_OF AS T3 ON T2.FacID = T3.FacID WHERE T1.DName = 'Computer Science'
human
Find the first name of students in the descending order of age.
assistant
SELECT Fname FROM STUDENT ORDER BY Age DESC
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
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 rank of the faculty that the fewest faculties belong to.
assistant
SELECT Rank FROM FACULTY GROUP BY Rank ORDER BY count(*) ASC LIMIT 1
human
Find the first names of faculties of rank Professor in alphabetic order.
assistant
SELECT Fname FROM FACULTY WHERE Rank = "Professor" ORDER BY Fname ;