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 names of courses that have either 3 credits or 1 credit but 4 hours.
assistant
SELECT CName FROM COURSE WHERE Credits = 3 UNION SELECT CName FROM COURSE WHERE Credits = 1 AND Hours = 4
human
How many courses are there in total?
assistant
SELECT count(*) FROM COURSE
human
List all names of courses with 1 credit?
assistant
SELECT CName FROM COURSE WHERE Credits = 1
human
How many courses have more than 2 credits?
assistant
SELECT count(*) FROM COURSE WHERE Credits > 2
human
List the course name of courses sorted by credits.
assistant
SELECT CName FROM COURSE ORDER BY Credits
human
What is all the information about courses, ordered by credits ascending?
assistant
SELECT * FROM COURSE ORDER BY Credits ;