instruction
stringlengths
1.07k
3.45k
output
stringlengths
19
508
system
stringclasses
1 value
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*), crs_code FROM CLASS GROUP BY crs_code;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT sum(crs_credit), dept_code FROM course GROUP BY dept_code;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT sum(crs_credit), dept_code FROM course GROUP BY dept_code;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*), class_room FROM CLASS GROUP BY class_room HAVING count(*) >= 2;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*), class_room FROM CLASS GROUP BY class_room HAVING count(*) >= 2;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*), dept_code FROM CLASS AS t1 JOIN course AS t2 ON t1.crs_code = t2.crs_code GROUP BY dept_code;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*), dept_code FROM CLASS AS t1 JOIN course AS t2 ON t1.crs_code = t2.crs_code GROUP BY dept_code;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*), t3.school_code FROM CLASS AS t1 JOIN course AS t2 ON t1.crs_code = t2.crs_code JOIN department AS t3 ON t2.dept_code = t3.dept_code GROUP BY t3.school_code;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*), t3.school_code FROM CLASS AS t1 JOIN course AS t2 ON t1.crs_code = t2.crs_code JOIN department AS t3 ON t2.dept_code = t3.dept_code GROUP BY t3.school_code;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*), t1.school_code FROM department AS t1 JOIN professor AS t2 ON t1.dept_code = t2.dept_code GROUP BY t1.school_code;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*), t1.school_code FROM department AS t1 JOIN professor AS t2 ON t1.dept_code = t2.dept_code GROUP BY t1.school_code;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT emp_jobcode, count(*) FROM employee GROUP BY emp_jobcode ORDER BY count(*) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT emp_jobcode, count(*) FROM employee GROUP BY emp_jobcode ORDER BY count(*) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.school_code FROM department AS t1 JOIN professor AS t2 ON t1.dept_code = t2.dept_code GROUP BY t1.school_code ORDER BY count(*) LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.school_code FROM department AS t1 JOIN professor AS t2 ON t1.dept_code = t2.dept_code GROUP BY t1.school_code ORDER BY count(*) LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*), dept_code FROM professor WHERE prof_high_degree = 'Ph.D.' GROUP BY dept_code;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*), dept_code FROM professor WHERE prof_high_degree = 'Ph.D.' GROUP BY dept_code;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*), dept_code FROM student GROUP BY dept_code;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*), dept_code FROM student GROUP BY dept_code;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT sum(stu_hrs), dept_code FROM student GROUP BY dept_code;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT sum(stu_hrs), dept_code FROM student GROUP BY dept_code;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT max(stu_gpa), avg(stu_gpa), min(stu_gpa), dept_code FROM student GROUP BY dept_code;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT max(stu_gpa), avg(stu_gpa), min(stu_gpa), dept_code FROM student GROUP BY dept_code;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.dept_name, avg(t1.stu_gpa) FROM student AS t1 JOIN department AS t2 ON t1.dept_code = t2.dept_code GROUP BY t1.dept_code ORDER BY avg(t1.stu_gpa) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.dept_name, avg(t1.stu_gpa) FROM student AS t1 JOIN department AS t2 ON t1.dept_code = t2.dept_code GROUP BY t1.dept_code ORDER BY avg(t1.stu_gpa) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(DISTINCT school_code) FROM department;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(DISTINCT school_code) FROM department;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(DISTINCT class_code) FROM CLASS;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(DISTINCT class_code) FROM CLASS;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(DISTINCT crs_code) FROM CLASS;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(DISTINCT crs_code) FROM CLASS;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(DISTINCT dept_name) FROM department;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(DISTINCT dept_name) FROM department;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM department AS t1 JOIN course AS t2 ON t1.dept_code = t2.dept_code WHERE dept_name = "Computer Info. Systems";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM department AS t1 JOIN course AS t2 ON t1.dept_code = t2.dept_code WHERE dept_name = "Computer Info. Systems";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(DISTINCT class_section) FROM CLASS WHERE crs_code = 'ACCT-211';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(DISTINCT class_section) FROM CLASS WHERE crs_code = 'ACCT-211';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT sum(t1.crs_credit), t1.dept_code FROM course AS t1 JOIN CLASS AS t2 ON t1.crs_code = t2.crs_code GROUP BY t1.dept_code;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT sum(t1.crs_credit), t1.dept_code FROM course AS t1 JOIN CLASS AS t2 ON t1.crs_code = t2.crs_code GROUP BY t1.dept_code;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t3.dept_name FROM course AS t1 JOIN CLASS AS t2 ON t1.crs_code = t2.crs_code JOIN department AS t3 ON t1.dept_code = t3.dept_code GROUP BY t1.dept_code ORDER BY sum(t1.crs_credit) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t3.dept_name FROM course AS t1 JOIN CLASS AS t2 ON t1.crs_code = t2.crs_code JOIN department AS t3 ON t1.dept_code = t3.dept_code GROUP BY t1.dept_code ORDER BY sum(t1.crs_credit) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM CLASS AS t1 JOIN enroll AS t2 ON t1.class_code = t2.class_code WHERE t1.crs_code = 'ACCT-211';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM CLASS AS t1 JOIN enroll AS t2 ON t1.class_code = t2.class_code WHERE t1.crs_code = 'ACCT-211';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t3.stu_fname FROM CLASS AS t1 JOIN enroll AS t2 ON t1.class_code = t2.class_code JOIN student AS t3 ON t2.stu_num = t3.stu_num WHERE t1.crs_code = 'ACCT-211';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t3.stu_fname FROM CLASS AS t1 JOIN enroll AS t2 ON t1.class_code = t2.class_code JOIN student AS t3 ON t2.stu_num = t3.stu_num WHERE t1.crs_code = 'ACCT-211';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t3.stu_fname FROM CLASS AS t1 JOIN enroll AS t2 ON t1.class_code = t2.class_code JOIN student AS t3 ON t2.stu_num = t3.stu_num WHERE t1.crs_code = 'ACCT-211' AND t2.enroll_grade = 'C';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t3.stu_fname FROM CLASS AS t1 JOIN enroll AS t2 ON t1.class_code = t2.class_code JOIN student AS t3 ON t2.stu_num = t3.stu_num WHERE t1.crs_code = 'ACCT-211' AND t2.enroll_grade = 'C';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM employee;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM employee;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM professor WHERE prof_high_degree = 'Ph.D.';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM professor WHERE prof_high_degree = 'Ph.D.';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM CLASS AS t1 JOIN enroll AS t2 ON t1.class_code = t2.class_code JOIN course AS t3 ON t1.crs_code = t3.crs_code JOIN department AS t4 ON t3.dept_code = t4.dept_code WHERE t4.dept_name = 'Accounting';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM CLASS AS t1 JOIN enroll AS t2 ON t1.class_code = t2.class_code JOIN course AS t3 ON t1.crs_code = t3.crs_code JOIN department AS t4 ON t3.dept_code = t4.dept_code WHERE t4.dept_name = 'Accounting';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t4.dept_name FROM CLASS AS t1 JOIN enroll AS t2 ON t1.class_code = t2.class_code JOIN course AS t3 ON t1.crs_code = t3.crs_code JOIN department AS t4 ON t3.dept_code = t4.dept_code GROUP BY t3.dept_code ORDER BY count(*) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t4.dept_name FROM CLASS AS t1 JOIN enroll AS t2 ON t1.class_code = t2.class_code JOIN course AS t3 ON t1.crs_code = t3.crs_code JOIN department AS t4 ON t3.dept_code = t4.dept_code GROUP BY t3.dept_code ORDER BY count(*) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT dept_name FROM department ORDER BY dept_name;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT dept_name FROM department ORDER BY dept_name;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT class_code FROM CLASS WHERE class_room = 'KLR209';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT class_code FROM CLASS WHERE class_room = 'KLR209';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' ORDER BY emp_dob;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' ORDER BY emp_dob;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.emp_fname, t1.prof_office FROM professor AS t1 JOIN employee AS t2 ON t1.emp_num = t2.emp_num ORDER BY t2.emp_fname;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.emp_fname, t1.prof_office FROM professor AS t1 JOIN employee AS t2 ON t1.emp_num = t2.emp_num ORDER BY t2.emp_fname;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT emp_fname, emp_lname FROM employee ORDER BY emp_dob LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT emp_fname, emp_lname FROM employee ORDER BY emp_dob LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT stu_fname, stu_lname, stu_gpa FROM student WHERE stu_gpa > 3 ORDER BY stu_dob DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT stu_fname, stu_lname, stu_gpa FROM student WHERE stu_gpa > 3 ORDER BY stu_dob DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT DISTINCT stu_fname FROM student AS t1 JOIN enroll AS t2 ON t1.stu_num = t2.stu_num WHERE enroll_grade = 'C';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT DISTINCT stu_fname FROM student AS t1 JOIN enroll AS t2 ON t1.stu_num = t2.stu_num WHERE enroll_grade = 'C';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.dept_name FROM professor AS t1 JOIN department AS t2 ON t1.dept_code = t2.dept_code GROUP BY t1.dept_code ORDER BY count(*) LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.dept_name FROM professor AS t1 JOIN department AS t2 ON t1.dept_code = t2.dept_code GROUP BY t1.dept_code ORDER BY count(*) LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.dept_name, t1.dept_code FROM professor AS t1 JOIN department AS t2 ON t1.dept_code = t2.dept_code WHERE t1.prof_high_degree = 'Ph.D.' GROUP BY t1.dept_code ORDER BY count(*) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.dept_name, t1.dept_code FROM professor AS t1 JOIN department AS t2 ON t1.dept_code = t2.dept_code WHERE t1.prof_high_degree = 'Ph.D.' GROUP BY t1.dept_code ORDER BY count(*) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' EXCEPT SELECT t1.emp_fname FROM employee AS t1 JOIN CLASS AS t2 ON t1.emp_num = t2.prof_num;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' EXCEPT SELECT t1.emp_fname FROM employee AS t1 JOIN CLASS AS t2 ON t1.emp_num = t2.prof_num;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.emp_fname FROM employee AS t1 JOIN professor AS t2 ON t1.emp_num = t2.emp_num JOIN department AS t3 ON t2.dept_code = t3.dept_code WHERE t3.dept_name = 'History' EXCEPT SELECT t4.emp_fname FROM employee AS t4 JOIN CLASS AS t5 ON t4.emp_num = t5.prof_num;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.emp_fname FROM employee AS t1 JOIN professor AS t2 ON t1.emp_num = t2.emp_num JOIN department AS t3 ON t2.dept_code = t3.dept_code WHERE t3.dept_name = 'History' EXCEPT SELECT t4.emp_fname FROM employee AS t4 JOIN CLASS AS t5 ON t4.emp_num = t5.prof_num;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.emp_lname, t2.prof_office FROM employee AS t1 JOIN professor AS t2 ON t1.emp_num = t2.emp_num JOIN department AS t3 ON t2.dept_code = t3.dept_code WHERE t3.dept_name = 'History';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.emp_lname, t2.prof_office FROM employee AS t1 JOIN professor AS t2 ON t1.emp_num = t2.emp_num JOIN department AS t3 ON t2.dept_code = t3.dept_code WHERE t3.dept_name = 'History';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t3.dept_name , t2.prof_office FROM employee AS t1 JOIN professor AS t2 ON t1.emp_num = t2.emp_num JOIN department AS t3 ON t2.dept_code = t3.dept_code WHERE t1.emp_lname = 'Heffington';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t3.dept_name , t2.prof_office FROM employee AS t1 JOIN professor AS t2 ON t1.emp_num = t2.emp_num JOIN department AS t3 ON t2.dept_code = t3.dept_code WHERE t1.emp_lname = 'Heffington';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.emp_lname, t1.emp_hiredate FROM employee AS t1 JOIN professor AS t2 ON t1.emp_num = t2.emp_num WHERE t2.prof_office = 'DRE 102';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.emp_lname, t1.emp_hiredate FROM employee AS t1 JOIN professor AS t2 ON t1.emp_num = t2.emp_num WHERE t2.prof_office = 'DRE 102';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.crs_code FROM CLASS AS t1 JOIN enroll AS t2 ON t1.class_code = t2.class_code JOIN student AS t3 ON t3.stu_num = t2.stu_num WHERE t3.stu_lname = 'Smithson';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.crs_code FROM CLASS AS t1 JOIN enroll AS t2 ON t1.class_code = t2.class_code JOIN student AS t3 ON t3.stu_num = t2.stu_num WHERE t3.stu_lname = 'Smithson';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t4.crs_description, t4.crs_credit FROM CLASS AS t1 JOIN enroll AS t2 ON t1.class_code = t2.class_code JOIN student AS t3 ON t3.stu_num = t2.stu_num JOIN course AS t4 ON t4.crs_code = t1.crs_code WHERE t3.stu_lname = 'Smithson';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t4.crs_description, t4.crs_credit FROM CLASS AS t1 JOIN enroll AS t2 ON t1.class_code = t2.class_code JOIN student AS t3 ON t3.stu_num = t2.stu_num JOIN course AS t4 ON t4.crs_code = t1.crs_code WHERE t3.stu_lname = 'Smithson';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM professor WHERE prof_high_degree = 'Ph.D.' OR prof_high_degree = 'MA';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM professor WHERE prof_high_degree = 'Ph.D.' OR prof_high_degree = 'MA';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM professor AS t1 JOIN department AS t2 ON t1.dept_code = t2.dept_code WHERE t2.dept_name = 'Accounting' OR t2.dept_name = 'Biology';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM professor AS t1 JOIN department AS t2 ON t1.dept_code = t2.dept_code WHERE t2.dept_name = 'Accounting' OR t2.dept_name = 'Biology';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.emp_fname FROM employee AS t1 JOIN CLASS AS t2 ON t1.emp_num = t2.prof_num WHERE crs_code = 'CIS-220' INTERSECT SELECT t1.emp_fname FROM employee AS t1 JOIN CLASS AS t2 ON t1.emp_num = t2.prof_num WHERE crs_code = 'QM-261';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.emp_fname FROM employee AS t1 JOIN CLASS AS t2 ON t1.emp_num = t2.prof_num WHERE crs_code = 'CIS-220' INTERSECT SELECT t1.emp_fname FROM employee AS t1 JOIN CLASS AS t2 ON t1.emp_num = t2.prof_num WHERE crs_code = 'QM-261';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT avg(t2.stu_gpa) FROM enroll AS t1 JOIN student AS t2 ON t1.stu_num = t2.stu_num JOIN CLASS AS t3 ON t1.class_code = t3.class_code WHERE t3.crs_code = 'ACCT-211';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT avg(t2.stu_gpa) FROM enroll AS t1 JOIN student AS t2 ON t1.stu_num = t2.stu_num JOIN CLASS AS t3 ON t1.class_code = t3.class_code WHERE t3.crs_code = 'ACCT-211';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT stu_gpa, stu_phone, stu_fname FROM student ORDER BY stu_gpa DESC LIMIT 5;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT stu_gpa, stu_phone, stu_fname FROM student ORDER BY stu_gpa DESC LIMIT 5;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.dept_name FROM student AS t1 JOIN department AS t2 ON t1.dept_code = t2.dept_code ORDER BY stu_gpa LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.dept_name FROM student AS t1 JOIN department AS t2 ON t1.dept_code = t2.dept_code ORDER BY stu_gpa LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT stu_fname, stu_gpa FROM student WHERE stu_gpa < (SELECT avg(stu_gpa) FROM student);
You are an experienced and professional database administrator.