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
Tell me the last name, age and first name for the student id 1003 and 1004...
assistant
SELECT LName , age , FName FROM STUDENT WHERE stuid = 1003 OR stuid = 1004;
human
Tell me the sex of 1005 and 1004 and their city code ..
assistant
SELECT sex , city_code FROM STUDENT WHERE stuid = 1005 OR stuid = 1004;
human
Tell me total number of Male students and total number of female students.....
assistant
SELECT sex , COUNT( * ) FROM STUDENT GROUP by sex;
human
Find the last name of female (Sex as F) students in the descending order of age.
assistant
SELECT LName FROM STUDENT WHERE Sex = "F" ORDER BY Age DESC ;