text stringlengths 182 1.07k |
|---|
convert the question into postgresql query using the context values
### Question:
Find the number of professors in accounting department.
### Context:
CREATE TABLE professor (dept_code VARCHAR); CREATE TABLE department (dept_code VARCHAR)
###Answer:
SELECT COUNT(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept... |
convert the question into postgresql query using the context values
### Question:
How many professors are teaching class with code ACCT-211?
### Context:
CREATE TABLE CLASS (PROF_NUM VARCHAR, CRS_CODE VARCHAR)
###Answer:
SELECT COUNT(DISTINCT PROF_NUM) FROM CLASS WHERE CRS_CODE = "ACCT-211" |
convert the question into postgresql query using the context values
### Question:
What is the first and last name of the professor in biology department?
### Context:
CREATE TABLE professor (dept_code VARCHAR, EMP_NUM VARCHAR); CREATE TABLE department (dept_code VARCHAR); CREATE TABLE employee (EMP_FNAME VARCHAR, EMP_... |
convert the question into postgresql query using the context values
### Question:
What are the first names and date of birth of professors teaching course ACCT-211?
### Context:
CREATE TABLE CLASS (PROF_NUM VARCHAR); CREATE TABLE employee (EMP_FNAME VARCHAR, EMP_DOB VARCHAR, EMP_NUM VARCHAR)
###Answer:
SELECT DISTINCT... |
convert the question into postgresql query using the context values
### Question:
How many classes are professor whose last name is Graztevski has?
### Context:
CREATE TABLE CLASS (PROF_NUM VARCHAR); CREATE TABLE employee (EMP_NUM VARCHAR, EMP_LNAME VARCHAR)
###Answer:
SELECT COUNT(*) FROM employee AS T1 JOIN CLASS AS... |
convert the question into postgresql query using the context values
### Question:
What is the code of the school where the accounting department belongs to?
### Context:
CREATE TABLE department (school_code VARCHAR, dept_name VARCHAR)
###Answer:
SELECT school_code FROM department WHERE dept_name = "Accounting" |
convert the question into postgresql query using the context values
### Question:
How many credits does course CIS-220 have, and what its description?
### Context:
CREATE TABLE course (crs_credit VARCHAR, crs_description VARCHAR, crs_code VARCHAR)
###Answer:
SELECT crs_credit, crs_description FROM course WHERE crs_cod... |
convert the question into postgresql query using the context values
### Question:
what is the address of history department?
### Context:
CREATE TABLE department (dept_address VARCHAR, dept_name VARCHAR)
###Answer:
SELECT dept_address FROM department WHERE dept_name = 'History' |
convert the question into postgresql query using the context values
### Question:
How many different locations does the school with code BUS has?
### Context:
CREATE TABLE department (dept_address VARCHAR, school_code VARCHAR)
###Answer:
SELECT COUNT(DISTINCT dept_address) FROM department WHERE school_code = 'BUS' |
convert the question into postgresql query using the context values
### Question:
How many different locations does each school have?
### Context:
CREATE TABLE department (school_code VARCHAR, dept_address VARCHAR)
###Answer:
SELECT COUNT(DISTINCT dept_address), school_code FROM department GROUP BY school_code |
convert the question into postgresql query using the context values
### Question:
Find the description and credit for the course QM-261?
### Context:
CREATE TABLE course (crs_credit VARCHAR, crs_description VARCHAR, crs_code VARCHAR)
###Answer:
SELECT crs_credit, crs_description FROM course WHERE crs_code = 'QM-261' |
convert the question into postgresql query using the context values
### Question:
Find the number of departments in each school.
### Context:
CREATE TABLE department (school_code VARCHAR, dept_name VARCHAR)
###Answer:
SELECT COUNT(DISTINCT dept_name), school_code FROM department GROUP BY school_code |
convert the question into postgresql query using the context values
### Question:
Find the number of different departments in each school whose number of different departments is less than 5.
### Context:
CREATE TABLE department (school_code VARCHAR, dept_name VARCHAR)
###Answer:
SELECT COUNT(DISTINCT dept_name), scho... |
convert the question into postgresql query using the context values
### Question:
How many sections does each course has?
### Context:
CREATE TABLE CLASS (crs_code VARCHAR)
###Answer:
SELECT COUNT(*), crs_code FROM CLASS GROUP BY crs_code |
convert the question into postgresql query using the context values
### Question:
What is the total credit does each department offer?
### Context:
CREATE TABLE course (dept_code VARCHAR, crs_credit INTEGER)
###Answer:
SELECT SUM(crs_credit), dept_code FROM course GROUP BY dept_code |
convert the question into postgresql query using the context values
### Question:
Find the number of classes offered for all class rooms that held at least 2 classes.
### Context:
CREATE TABLE CLASS (class_room VARCHAR)
###Answer:
SELECT COUNT(*), class_room FROM CLASS GROUP BY class_room HAVING COUNT(*) >= 2 |
convert the question into postgresql query using the context values
### Question:
Find the number of classes in each department.
### Context:
CREATE TABLE CLASS (crs_code VARCHAR); CREATE TABLE course (crs_code VARCHAR)
###Answer:
SELECT COUNT(*), dept_code FROM CLASS AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_co... |
convert the question into postgresql query using the context values
### Question:
Find the number of classes in each school.
### Context:
CREATE TABLE department (school_code VARCHAR, dept_code VARCHAR); CREATE TABLE CLASS (crs_code VARCHAR); CREATE TABLE course (crs_code VARCHAR, dept_code VARCHAR)
###Answer:
SELECT ... |
convert the question into postgresql query using the context values
### Question:
What is the number of professors for different school?
### Context:
CREATE TABLE department (school_code VARCHAR, dept_code VARCHAR); CREATE TABLE professor (dept_code VARCHAR)
###Answer:
SELECT COUNT(*), T1.school_code FROM department A... |
convert the question into postgresql query using the context values
### Question:
Find the count and code of the job has most employees.
### Context:
CREATE TABLE employee (emp_jobcode VARCHAR)
###Answer:
SELECT emp_jobcode, COUNT(*) FROM employee GROUP BY emp_jobcode ORDER BY COUNT(*) DESC LIMIT 1 |
convert the question into postgresql query using the context values
### Question:
Which school has the smallest amount of professors?
### Context:
CREATE TABLE department (school_code VARCHAR, dept_code VARCHAR); CREATE TABLE professor (dept_code VARCHAR)
###Answer:
SELECT T1.school_code FROM department AS T1 JOIN pro... |
convert the question into postgresql query using the context values
### Question:
Find the number of professors with a Ph.D. degree in each department.
### Context:
CREATE TABLE professor (dept_code VARCHAR, prof_high_degree VARCHAR)
###Answer:
SELECT COUNT(*), dept_code FROM professor WHERE prof_high_degree = 'Ph.D.'... |
convert the question into postgresql query using the context values
### Question:
Find the number of students for each department.
### Context:
CREATE TABLE student (dept_code VARCHAR)
###Answer:
SELECT COUNT(*), dept_code FROM student GROUP BY dept_code |
convert the question into postgresql query using the context values
### Question:
Find the total number of hours have done for all students in each department.
### Context:
CREATE TABLE student (dept_code VARCHAR, stu_hrs INTEGER)
###Answer:
SELECT SUM(stu_hrs), dept_code FROM student GROUP BY dept_code |
convert the question into postgresql query using the context values
### Question:
Find the max, average, and minimum gpa of all students in each department.
### Context:
CREATE TABLE student (dept_code VARCHAR, stu_gpa INTEGER)
###Answer:
SELECT MAX(stu_gpa), AVG(stu_gpa), MIN(stu_gpa), dept_code FROM student GROUP BY... |
convert the question into postgresql query using the context values
### Question:
What is the name and the average gpa of department whose students have the highest average gpa?
### Context:
CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR); CREATE TABLE student (stu_gpa INTEGER, dept_code VARCHAR)
###Ans... |
convert the question into postgresql query using the context values
### Question:
how many schools exist in total?
### Context:
CREATE TABLE department (school_code VARCHAR)
###Answer:
SELECT COUNT(DISTINCT school_code) FROM department |
convert the question into postgresql query using the context values
### Question:
How many different classes are there?
### Context:
CREATE TABLE CLASS (class_code VARCHAR)
###Answer:
SELECT COUNT(DISTINCT class_code) FROM CLASS |
convert the question into postgresql query using the context values
### Question:
How many courses are offered?
### Context:
CREATE TABLE CLASS (crs_code VARCHAR)
###Answer:
SELECT COUNT(DISTINCT crs_code) FROM CLASS |
convert the question into postgresql query using the context values
### Question:
How many departments does the college has?
### Context:
CREATE TABLE department (dept_name VARCHAR)
###Answer:
SELECT COUNT(DISTINCT dept_name) FROM department |
convert the question into postgresql query using the context values
### Question:
How many courses are offered by the Computer Info. Systems department?
### Context:
CREATE TABLE course (dept_code VARCHAR); CREATE TABLE department (dept_code VARCHAR)
###Answer:
SELECT COUNT(*) FROM department AS T1 JOIN course AS T2 O... |
convert the question into postgresql query using the context values
### Question:
How many sections does course ACCT-211 has?
### Context:
CREATE TABLE CLASS (class_section VARCHAR, crs_code VARCHAR)
###Answer:
SELECT COUNT(DISTINCT class_section) FROM CLASS WHERE crs_code = 'ACCT-211' |
convert the question into postgresql query using the context values
### Question:
Find the total credits of all classes offered by each department.
### Context:
CREATE TABLE CLASS (crs_code VARCHAR); CREATE TABLE course (dept_code VARCHAR, crs_credit INTEGER, crs_code VARCHAR)
###Answer:
SELECT SUM(T1.crs_credit), T1.... |
convert the question into postgresql query using the context values
### Question:
Find the name of the department that offers the largest number of credits of all classes.
### Context:
CREATE TABLE CLASS (crs_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR); CREATE TABLE course (dept_code ... |
convert the question into postgresql query using the context values
### Question:
How many students enrolled in class ACCT-211?
### Context:
CREATE TABLE enroll (class_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR)
###Answer:
SELECT COUNT(*) FROM CLASS AS T1 JOIN enroll AS T2 ON T1.class_code... |
convert the question into postgresql query using the context values
### Question:
What is the first name of each student enrolled in class ACCT-211?
### Context:
CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE enroll (class_code VARCHAR... |
convert the question into postgresql query using the context values
### Question:
What is the first name of students enrolled in class ACCT-211 and got grade C?
### Context:
CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR); CREATE TABLE enroll (class_... |
convert the question into postgresql query using the context values
### Question:
Find the total number of employees.
### Context:
CREATE TABLE employee (Id VARCHAR)
###Answer:
SELECT COUNT(*) FROM employee |
convert the question into postgresql query using the context values
### Question:
How many professors do have a Ph.D. degree?
### Context:
CREATE TABLE professor (prof_high_degree VARCHAR)
###Answer:
SELECT COUNT(*) FROM professor WHERE prof_high_degree = 'Ph.D.' |
convert the question into postgresql query using the context values
### Question:
How many students are enrolled in the class taught by some professor from the accounting department?
### Context:
CREATE TABLE enroll (class_code VARCHAR); CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE cour... |
convert the question into postgresql query using the context values
### Question:
What is the name of the department that has the largest number of students enrolled?
### Context:
CREATE TABLE enroll (class_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE course (dept_code VARCHAR... |
convert the question into postgresql query using the context values
### Question:
list names of all departments ordered by their names.
### Context:
CREATE TABLE department (dept_name VARCHAR)
###Answer:
SELECT dept_name FROM department ORDER BY dept_name |
convert the question into postgresql query using the context values
### Question:
List the codes of all courses that take place in room KLR209.
### Context:
CREATE TABLE CLASS (class_code VARCHAR, class_room VARCHAR)
###Answer:
SELECT class_code FROM CLASS WHERE class_room = 'KLR209' |
convert the question into postgresql query using the context values
### Question:
List the first name of all employees with job code PROF ordered by their date of birth.
### Context:
CREATE TABLE employee (emp_fname VARCHAR, emp_jobcode VARCHAR, emp_dob VARCHAR)
###Answer:
SELECT emp_fname FROM employee WHERE emp_jobc... |
convert the question into postgresql query using the context values
### Question:
Find the first names and offices of all professors sorted by alphabetical order of their first name.
### Context:
CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR)
#... |
convert the question into postgresql query using the context values
### Question:
What is the first and last name of the oldest employee?
### Context:
CREATE TABLE employee (emp_fname VARCHAR, emp_lname VARCHAR, emp_dob VARCHAR)
###Answer:
SELECT emp_fname, emp_lname FROM employee ORDER BY emp_dob LIMIT 1 |
convert the question into postgresql query using the context values
### Question:
What is the first, last name, gpa of the youngest one among students whose GPA is above 3?
### Context:
CREATE TABLE student (stu_fname VARCHAR, stu_lname VARCHAR, stu_gpa INTEGER, stu_dob VARCHAR)
###Answer:
SELECT stu_fname, stu_lname,... |
convert the question into postgresql query using the context values
### Question:
What is the first name of students who got grade C in any class?
### Context:
CREATE TABLE student (stu_num VARCHAR); CREATE TABLE enroll (stu_num VARCHAR)
###Answer:
SELECT DISTINCT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.s... |
convert the question into postgresql query using the context values
### Question:
What is the name of department where has the smallest number of professors?
### Context:
CREATE TABLE professor (dept_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR)
###Answer:
SELECT T2.dept_name FROM profe... |
convert the question into postgresql query using the context values
### Question:
What is the name of department where has the largest number of professors with a Ph.D. degree?
### Context:
CREATE TABLE professor (dept_code VARCHAR, prof_high_degree VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCH... |
convert the question into postgresql query using the context values
### Question:
What are the first names of the professors who do not teach a class.
### Context:
CREATE TABLE employee (emp_fname VARCHAR, emp_jobcode VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VA... |
convert the question into postgresql query using the context values
### Question:
What is the first names of the professors from the history department who do not teach a class.
### Context:
CREATE TABLE professor (emp_num VARCHAR, dept_code VARCHAR); CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CRE... |
convert the question into postgresql query using the context values
### Question:
What is the last name and office of the professor from the history department?
### Context:
CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE employee (emp_lname VARCHAR, emp_num VARCHAR); CREATE TABLE professo... |
convert the question into postgresql query using the context values
### Question:
What is department name and office for the professor whose last name is Heffington?
### Context:
CREATE TABLE employee (emp_num VARCHAR, emp_lname VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR); CREATE TABLE pro... |
convert the question into postgresql query using the context values
### Question:
Find the last name and hire date of the professor who is in office DRE 102.
### Context:
CREATE TABLE professor (emp_num VARCHAR, prof_office VARCHAR); CREATE TABLE employee (emp_lname VARCHAR, emp_hiredate VARCHAR, emp_num VARCHAR)
###A... |
convert the question into postgresql query using the context values
### Question:
What is the code of the course which the student whose last name is Smithson took?
### Context:
CREATE TABLE student (stu_num VARCHAR, stu_lname VARCHAR); CREATE TABLE enroll (class_code VARCHAR, stu_num VARCHAR); CREATE TABLE CLASS (crs... |
convert the question into postgresql query using the context values
### Question:
What are the description and credit of the course which the student whose last name is Smithson took?
### Context:
CREATE TABLE student (stu_num VARCHAR, stu_lname VARCHAR); CREATE TABLE course (crs_description VARCHAR, crs_credit VARCHA... |
convert the question into postgresql query using the context values
### Question:
How many professors who has a either Ph.D. or MA degree?
### Context:
CREATE TABLE professor (prof_high_degree VARCHAR)
###Answer:
SELECT COUNT(*) FROM professor WHERE prof_high_degree = 'Ph.D.' OR prof_high_degree = 'MA' |
convert the question into postgresql query using the context values
### Question:
How many professors who are from either Accounting or Biology department?
### Context:
CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE professor (dept_code VARCHAR)
###Answer:
SELECT COUNT(*) FROM professor A... |
convert the question into postgresql query using the context values
### Question:
Find the first name of the professor who is teaching two courses with code CIS-220 and QM-261.
### Context:
CREATE TABLE CLASS (prof_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR)
###Answer:
SELECT T1.emp_fname ... |
convert the question into postgresql query using the context values
### Question:
Find the first name of student who is taking classes from accounting and Computer Info. Systems departments
### Context:
CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE enroll (stu_num VARCHAR, class_code VARCHAR)... |
convert the question into postgresql query using the context values
### Question:
What is the average gpa of the students enrolled in the course with code ACCT-211?
### Context:
CREATE TABLE enroll (stu_num VARCHAR, class_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCHAR); CREATE TABLE student (s... |
convert the question into postgresql query using the context values
### Question:
What is the first name, gpa and phone number of the top 5 students with highest gpa?
### Context:
CREATE TABLE student (stu_gpa VARCHAR, stu_phone VARCHAR, stu_fname VARCHAR)
###Answer:
SELECT stu_gpa, stu_phone, stu_fname FROM student O... |
convert the question into postgresql query using the context values
### Question:
What is the department name of the students with lowest gpa belongs to?
### Context:
CREATE TABLE student (dept_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR)
###Answer:
SELECT T2.dept_name FROM student AS ... |
convert the question into postgresql query using the context values
### Question:
Find the first name and gpa of the students whose gpa is lower than the average gpa of all students.
### Context:
CREATE TABLE student (stu_fname VARCHAR, stu_gpa INTEGER)
###Answer:
SELECT stu_fname, stu_gpa FROM student WHERE stu_gpa <... |
convert the question into postgresql query using the context values
### Question:
Find the name and address of the department that has the highest number of students.
### Context:
CREATE TABLE student (dept_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_address VARCHAR, dept_code VARCHAR)
###Answer:
S... |
convert the question into postgresql query using the context values
### Question:
Find the name, address, number of students in the departments that have the top 3 highest number of students.
### Context:
CREATE TABLE student (dept_code VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_address VARCHAR, dept_c... |
convert the question into postgresql query using the context values
### Question:
Find the first name and office of the professor who is in the history department and has a Ph.D. degree.
### Context:
CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE professor (prof_office VARCHAR, emp_num VA... |
convert the question into postgresql query using the context values
### Question:
Find the first names of all instructors who have taught some course and the course code.
### Context:
CREATE TABLE CLASS (crs_code VARCHAR, prof_num VARCHAR); CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR)
###Answer:
SELECT T... |
convert the question into postgresql query using the context values
### Question:
Find the first names of all instructors who have taught some course and the course description.
### Context:
CREATE TABLE course (crs_description VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR, crs_code VARCHAR); CREATE... |
convert the question into postgresql query using the context values
### Question:
Find the first names and offices of all instructors who have taught some course and also find the course description.
### Context:
CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR); CREATE TABLE course (crs_description VARCHA... |
convert the question into postgresql query using the context values
### Question:
Find the first names and offices of all instructors who have taught some course and the course description and the department name.
### Context:
CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR); CREATE TABLE department (dept_na... |
convert the question into postgresql query using the context values
### Question:
Find names of all students who took some course and the course description.
### Context:
CREATE TABLE enroll (stu_num VARCHAR, class_code VARCHAR); CREATE TABLE course (crs_description VARCHAR, crs_code VARCHAR); CREATE TABLE CLASS (clas... |
convert the question into postgresql query using the context values
### Question:
Find names of all students who took some course and got A or C.
### Context:
CREATE TABLE enroll (stu_num VARCHAR, enroll_grade VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_lname VARCHAR, stu_num VARCHAR)
###Answer:
SELECT T1.s... |
convert the question into postgresql query using the context values
### Question:
Find the first names of all professors in the Accounting department who is teaching some course and the class room.
### Context:
CREATE TABLE CLASS (class_room VARCHAR, prof_num VARCHAR); CREATE TABLE professor (emp_num VARCHAR, dept_cod... |
convert the question into postgresql query using the context values
### Question:
Find the first names and degree of all professors who are teaching some class in Computer Info. Systems department.
### Context:
CREATE TABLE professor (prof_high_degree VARCHAR, emp_num VARCHAR, dept_code VARCHAR); CREATE TABLE departme... |
convert the question into postgresql query using the context values
### Question:
What is the last name of the student who got a grade A in the class with code 10018.
### Context:
CREATE TABLE enroll (stu_num VARCHAR, enroll_grade VARCHAR, class_code VARCHAR); CREATE TABLE student (stu_lname VARCHAR, stu_num VARCHAR)
... |
convert the question into postgresql query using the context values
### Question:
Find the first name and office of history professor who did not get a Ph.D. degree.
### Context:
CREATE TABLE department (dept_code VARCHAR, dept_name VARCHAR); CREATE TABLE professor (prof_office VARCHAR, emp_num VARCHAR, dept_code VARC... |
convert the question into postgresql query using the context values
### Question:
Find the first names of professors who are teaching more than one class.
### Context:
CREATE TABLE employee (emp_fname VARCHAR, emp_num VARCHAR); CREATE TABLE CLASS (prof_num VARCHAR)
###Answer:
SELECT T2.emp_fname FROM CLASS AS T1 JOIN ... |
convert the question into postgresql query using the context values
### Question:
Find the first names of students who took exactly one class.
### Context:
CREATE TABLE enroll (stu_num VARCHAR); CREATE TABLE student (stu_fname VARCHAR, stu_num VARCHAR)
###Answer:
SELECT T1.stu_fname FROM student AS T1 JOIN enroll AS T... |
convert the question into postgresql query using the context values
### Question:
Find the name of department that offers the class whose description has the word "Statistics".
### Context:
CREATE TABLE course (dept_code VARCHAR, crs_description VARCHAR); CREATE TABLE department (dept_name VARCHAR, dept_code VARCHAR)
... |
convert the question into postgresql query using the context values
### Question:
What is the first name of the student whose last name starting with the letter S and is taking ACCT-211 class?
### Context:
CREATE TABLE enroll (stu_num VARCHAR, class_code VARCHAR); CREATE TABLE CLASS (class_code VARCHAR, crs_code VARCH... |
convert the question into postgresql query using the context values
### Question:
How many clubs are there?
### Context:
CREATE TABLE club (Id VARCHAR)
###Answer:
SELECT COUNT(*) FROM club |
convert the question into postgresql query using the context values
### Question:
List the distinct region of clubs in ascending alphabetical order.
### Context:
CREATE TABLE club (Region VARCHAR)
###Answer:
SELECT DISTINCT Region FROM club ORDER BY Region |
convert the question into postgresql query using the context values
### Question:
What is the average number of gold medals for clubs?
### Context:
CREATE TABLE club_rank (Gold INTEGER)
###Answer:
SELECT AVG(Gold) FROM club_rank |
convert the question into postgresql query using the context values
### Question:
What are the types and countries of competitions?
### Context:
CREATE TABLE competition (Competition_type VARCHAR, Country VARCHAR)
###Answer:
SELECT Competition_type, Country FROM competition |
convert the question into postgresql query using the context values
### Question:
What are the distinct years in which the competitions type is not "Tournament"?
### Context:
CREATE TABLE competition (YEAR VARCHAR, Competition_type VARCHAR)
###Answer:
SELECT DISTINCT YEAR FROM competition WHERE Competition_type <> "To... |
convert the question into postgresql query using the context values
### Question:
What are the maximum and minimum number of silver medals for clubs.
### Context:
CREATE TABLE club_rank (Silver INTEGER)
###Answer:
SELECT MAX(Silver), MIN(Silver) FROM club_rank |
convert the question into postgresql query using the context values
### Question:
How many clubs have total medals less than 10?
### Context:
CREATE TABLE club_rank (Total INTEGER)
###Answer:
SELECT COUNT(*) FROM club_rank WHERE Total < 10 |
convert the question into postgresql query using the context values
### Question:
List all club names in ascending order of start year.
### Context:
CREATE TABLE club (name VARCHAR, Start_year VARCHAR)
###Answer:
SELECT name FROM club ORDER BY Start_year |
convert the question into postgresql query using the context values
### Question:
List all club names in descending alphabetical order.
### Context:
CREATE TABLE club (name VARCHAR)
###Answer:
SELECT name FROM club ORDER BY name DESC |
convert the question into postgresql query using the context values
### Question:
Please show the names and the players of clubs.
### Context:
CREATE TABLE club (name VARCHAR, Club_ID VARCHAR); CREATE TABLE player (Player_id VARCHAR, Club_ID VARCHAR)
###Answer:
SELECT T1.name, T2.Player_id FROM club AS T1 JOIN player ... |
convert the question into postgresql query using the context values
### Question:
Show the names of clubs that have players with position "Right Wing".
### Context:
CREATE TABLE club (name VARCHAR, Club_ID VARCHAR); CREATE TABLE player (Club_ID VARCHAR, Position VARCHAR)
###Answer:
SELECT T1.name FROM club AS T1 JOIN ... |
convert the question into postgresql query using the context values
### Question:
What is the average points of players from club with name "AIB".
### Context:
CREATE TABLE player (Points INTEGER, Club_ID VARCHAR); CREATE TABLE club (Club_ID VARCHAR, name VARCHAR)
###Answer:
SELECT AVG(T2.Points) FROM club AS T1 JOIN ... |
convert the question into postgresql query using the context values
### Question:
List the position of players and the average number of points of players of each position.
### Context:
CREATE TABLE player (POSITION VARCHAR, Points INTEGER)
###Answer:
SELECT POSITION, AVG(Points) FROM player GROUP BY POSITION |
convert the question into postgresql query using the context values
### Question:
List the position of players with average number of points scored by players of that position bigger than 20.
### Context:
CREATE TABLE player (POSITION VARCHAR, name VARCHAR, Points INTEGER)
###Answer:
SELECT POSITION FROM player GROUP ... |
convert the question into postgresql query using the context values
### Question:
List the types of competition and the number of competitions of each type.
### Context:
CREATE TABLE competition (Competition_type VARCHAR)
###Answer:
SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type |
convert the question into postgresql query using the context values
### Question:
List the most common type of competition.
### Context:
CREATE TABLE competition (Competition_type VARCHAR)
###Answer:
SELECT Competition_type FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC LIMIT 1 |
convert the question into postgresql query using the context values
### Question:
List the types of competition that have at most five competitions of that type.
### Context:
CREATE TABLE competition (Competition_type VARCHAR)
###Answer:
SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT(*... |
convert the question into postgresql query using the context values
### Question:
List the names of clubs that do not have any players.
### Context:
CREATE TABLE player (name VARCHAR, Club_ID VARCHAR); CREATE TABLE CLub (name VARCHAR, Club_ID VARCHAR)
###Answer:
SELECT name FROM CLub WHERE NOT Club_ID IN (SELECT Club_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.