human
Schema:
classroom (building, room_number, capacity)
department (dept_name, building, budget)
course (course_id, title, dept_name, credits)
instructor (ID, name, dept_name, salary)
section (course_id, sec_id, semester, year, building, room_number, time_slot_id)
teaches (ID, course_id, sec_id, semester, year)
student (ID, name, dept_name, tot_cred)
takes (ID, course_id, sec_id, semester, year, grade)
advisor (s_ID, i_ID)
time_slot (time_slot_id, day, start_hr, start_min, end_hr, end_min)
prereq (course_id, prereq_id)
Please answer with SQL.
assistant
Sure, I understand.
human
Which department has the highest amount of students?
assistant
SELECT dept_name FROM student GROUP BY dept_name ORDER BY COUNT( * ) DESC LIMIT 1;
human
Do you know the total credits for the Civil Eng. Department? | Did you want the sum of total credits across all students in the Civil Eng. department? | Sure.
assistant
SELECT SUM( tot_cred ) FROM student WHERE dept_name = 'Civil Eng.';
human
Ok, do you know the ID number for the department? | Did you want the ID numbers for the students in the Civil Eng. department? | please
assistant
SELECT ID FROM student WHERE dept_name = "Civil Eng." ;