text
stringlengths
432
6.49k
target
stringlengths
2
4.44k
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) TABLE: CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) ### Question ### For each type, what is the average tonnage, and rank by the Y in desc please. ### Accurate SQL ###
SELECT Type, AVG(Tonnage) FROM ship GROUP BY Type ORDER BY AVG(Tonnage) DESC
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_26217 ( "Song 1 title" text, "Artist 1" text, "Song 2 title" text, "Artist 2" text, "Mix artist" text, "Guitar part?" text, "Level" text ) ### Question ### Which level has grandmaster flash as artist 1? ### Accurate SQL ###
SELECT "Level" FROM table_26217 WHERE "Artist 1" = 'Grandmaster Flash'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_15592941_1 (college VARCHAR, player_name VARCHAR) ### Question ### What college did jeremy zuttah attend? ### Accurate SQL ###
SELECT college FROM table_15592941_1 WHERE player_name = "Jeremy Zuttah"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_2 ( tournament VARCHAR ) ### Question ### Which 2008 has a 2009 of A, and a 2010 of A, and a 2012 of 1r, and a Tournament of cincinnati masters? ### Accurate SQL ###
SELECT 2008 FROM table_name_2 WHERE 2009 = "a" AND 2010 = "a" AND 2012 = "1r" AND tournament = "cincinnati masters"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_24 (tournament VARCHAR, date VARCHAR) ### Question ### Name the tournament for march 25, 2012 ### Accurate SQL ###
SELECT tournament FROM table_name_24 WHERE date = "march 25, 2012"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE products ( product_id number, color_code text, product_category_code text, product_name text, typical_buying_price text, typical_selling_price text, product_description text, other_product_details text ) TABLE: CREATE TABLE ref_product_categories ( product_category_code text, product_category_description text, unit_of_measure text ) TABLE: CREATE TABLE ref_characteristic_types ( characteristic_type_code text, characteristic_type_description text ) TABLE: CREATE TABLE characteristics ( characteristic_id number, characteristic_type_code text, characteristic_data_type text, characteristic_name text, other_characteristic_details text ) TABLE: CREATE TABLE ref_colors ( color_code text, color_description text ) TABLE: CREATE TABLE product_characteristics ( product_id number, characteristic_id number, product_characteristic_value text ) ### Question ### How many products have the characteristic named 'hot'? ### Accurate SQL ###
SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = "hot"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_19727 ( "Name" text, "Years" text, "League" text, "FA Cup" text, "League Cup" text, "Europe" text, "Other a" text, "Total" text ) ### Question ### what is the Europe number for the league cup of 36 (0)? ### Accurate SQL ###
SELECT "Europe" FROM table_19727 WHERE "League Cup" = '36 (0)'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_62078 ( "Companion (in order from star)" text, "Mass" text, "Semimajor axis ( AU )" text, "Orbital period ( s day )" text, "Eccentricity" text, "Inclination" text ) ### Question ### What Companion (in order from star) has a Semimajor axis (AU) of 0.1886 +0.083 0.0104? ### Accurate SQL ###
SELECT "Companion (in order from star)" FROM table_62078 WHERE "Semimajor axis ( AU )" = '0.1886 +0.083 −0.0104'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_91 (week INTEGER, attendance VARCHAR) ### Question ### Which Week has an Attendance of 20,112? ### Accurate SQL ###
SELECT MAX(week) FROM table_name_91 WHERE attendance = 20 OFFSET 112
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) TABLE: CREATE TABLE semester ( semester_id int, semester varchar, year int ) TABLE: CREATE TABLE gsi ( course_offering_id int, student_id int ) TABLE: CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varchar ) TABLE: CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) TABLE: CREATE TABLE area ( course_id int, area varchar ) TABLE: CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) TABLE: CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar ) TABLE: CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments int, respected int, participation int, heavy_reading int, tough_grader int, hilarious int, would_take_again int, good_lecture int, no_skip int ) TABLE: CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) TABLE: CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) TABLE: CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) TABLE: CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) TABLE: CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) TABLE: CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) TABLE: CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_projects varchar, has_exams varchar, num_reviews int, clarity_score int, easiness_score int, helpfulness_score int ) TABLE: CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) TABLE: CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) ### Question ### And does 584 have a lab ? ### Accurate SQL ###
SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 584
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_65 (rank VARCHAR, event VARCHAR) ### Question ### What is Rank, when Event is "LAPT3 Punta Del Este"? ### Accurate SQL ###
SELECT rank FROM table_name_65 WHERE event = "lapt3 punta del este"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_13733 ( "Date" text, "Ship" text, "Nationality" text, "Tonnage" real, "Fate" text ) ### Question ### What was the nationality of the ship named Toward? ### Accurate SQL ###
SELECT "Nationality" FROM table_13733 WHERE "Ship" = 'toward'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_202_54 ( id number, "song" text, "chinese" text, "hito radio\ntop 10" number, "9+2 music\ntop 15" number, "global asia\ntop 15" number, "ufo radio\ntop 15" number, "channel [v]\ntop 20" number, "mtv taiwan\ntop 20" number, "yes 93.3\ntop 20" number ) ### Question ### which song has the longest weeks on global asia 's top 15 chart ? ### Accurate SQL ###
SELECT "song" FROM table_202_54 ORDER BY "global asia\ntop 15" DESC LIMIT 1
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_50162 ( "Format" text, "Country" text, "Label" text, "Catalogue No." text, "Date" text ) ### Question ### What Country with a MC Format has a ATCO Records Label? ### Accurate SQL ###
SELECT "Country" FROM table_50162 WHERE "Label" = 'atco records' AND "Format" = 'mc'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_31 ( position INTEGER, points VARCHAR, pilot VARCHAR ) ### Question ### What is the average position of pilot petr krejcirik, who has less than 11 points? ### Accurate SQL ###
SELECT AVG(position) FROM table_name_31 WHERE points < 11 AND pilot = "petr krejcirik"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE supplier_addresses ( supplier_id number, address_id number, date_from time, date_to time ) TABLE: CREATE TABLE department_store_chain ( dept_store_chain_id number, dept_store_chain_name text ) TABLE: CREATE TABLE products ( product_id number, product_type_code text, product_name text, product_price number ) TABLE: CREATE TABLE staff_department_assignments ( staff_id number, department_id number, date_assigned_from time, job_title_code text, date_assigned_to time ) TABLE: CREATE TABLE customer_addresses ( customer_id number, address_id number, date_from time, date_to time ) TABLE: CREATE TABLE suppliers ( supplier_id number, supplier_name text, supplier_phone text ) TABLE: CREATE TABLE order_items ( order_item_id number, order_id number, product_id number ) TABLE: CREATE TABLE addresses ( address_id number, address_details text ) TABLE: CREATE TABLE product_suppliers ( product_id number, supplier_id number, date_supplied_from time, date_supplied_to time, total_amount_purchased text, total_value_purchased number ) TABLE: CREATE TABLE customers ( customer_id number, payment_method_code text, customer_code text, customer_name text, customer_address text, customer_phone text, customer_email text ) TABLE: CREATE TABLE department_stores ( dept_store_id number, dept_store_chain_id number, store_name text, store_address text, store_phone text, store_email text ) TABLE: CREATE TABLE customer_orders ( order_id number, customer_id number, order_status_code text, order_date time ) TABLE: CREATE TABLE departments ( department_id number, dept_store_id number, department_name text ) TABLE: CREATE TABLE staff ( staff_id number, staff_gender text, staff_name text ) ### Question ### Return the names and ids of all products whose price is between 600 and 700. ### Accurate SQL ###
SELECT product_name, product_id FROM products WHERE product_price BETWEEN 600 AND 700
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_503 ( "Season" text, "Competition" text, "Round" text, "Club" text, "1st leg" text, "2nd leg" text, "Aggregate" text ) ### Question ### What is the round when 1st leg is 0 1? ### Accurate SQL ###
SELECT "Round" FROM table_503 WHERE "1st leg" = '0–1'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) ### Question ### how many patients who underwent fiber optic bronchoscopy were discharged at home health care? ### Accurate SQL ###
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND procedures.short_title = "Fiber-optic bronchoscopy"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) ### Question ### how many female patients had urgent hospital admission? ### Accurate SQL ###
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.admission_type = "URGENT"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE shipments ( shipment_id number, order_id number, invoice_number number, shipment_tracking_number text, shipment_date time, other_shipment_details text ) TABLE: CREATE TABLE order_items ( order_item_id number, product_id number, order_id number, order_item_status text, order_item_details text ) TABLE: CREATE TABLE orders ( order_id number, customer_id number, order_status text, date_order_placed time, order_details text ) TABLE: CREATE TABLE customers ( customer_id number, customer_name text, customer_details text ) TABLE: CREATE TABLE invoices ( invoice_number number, invoice_date time, invoice_details text ) TABLE: CREATE TABLE shipment_items ( shipment_id number, order_item_id number ) TABLE: CREATE TABLE products ( product_id number, product_name text, product_details text ) ### Question ### Find the ids of orders which are shipped after 2000-01-01. ### Accurate SQL ###
SELECT order_id FROM shipments WHERE shipment_date > "2000-01-01"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_46580 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text ) ### Question ### What was the score when Walsall was the away team? ### Accurate SQL ###
SELECT "Score" FROM table_46580 WHERE "Away team" = 'walsall'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_52825 ( "Player" text, "Nationality" text, "Position" text, "Years for Jazz" text, "School/Club Team" text ) ### Question ### What Nationality is Jeff Hornacek? ### Accurate SQL ###
SELECT "Nationality" FROM table_52825 WHERE "Player" = 'jeff hornacek'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_47 ( rank VARCHAR, player VARCHAR ) ### Question ### What rank has jo angel (wa) as the player? ### Accurate SQL ###
SELECT rank FROM table_name_47 WHERE player = "jo angel (wa)"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_250309_1 ( models_produced VARCHAR, plant VARCHAR ) ### Question ### how many models produced where the plant is castle bromwich? ### Accurate SQL ###
SELECT COUNT(models_produced) FROM table_250309_1 WHERE plant = "Castle Bromwich"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_71 (player VARCHAR, years_at_club VARCHAR, goals VARCHAR, debut_year VARCHAR) ### Question ### Which Player has Goals larger than 10, and a Debut year smaller than 1993, and Years at club of 1990–1993? ### Accurate SQL ###
SELECT player FROM table_name_71 WHERE goals > 10 AND debut_year < 1993 AND years_at_club = "1990–1993"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) TABLE: CREATE TABLE Reviewer ( rID int, name text ) TABLE: CREATE TABLE Movie ( mID int, title text, year int, director text ) ### Question ### Return a histogram on what is the average number of stars that each reviewer awards for a movie?, and rank Y in descending order. ### Accurate SQL ###
SELECT name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name ORDER BY AVG(T1.stars) DESC
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_53421 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text ) ### Question ### How many people attended the game on February 3, 2008? ### Accurate SQL ###
SELECT SUM("Attendance") FROM table_53421 WHERE "Date" = 'february 3, 2008'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_33 (county VARCHAR, name VARCHAR) ### Question ### In what county is the Canyon Padre Bridge? ### Accurate SQL ###
SELECT county FROM table_name_33 WHERE name = "canyon padre bridge"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_203_208 ( id number, "team" text, "location" text, "venue" text, "capacity" number, "position in 1993-94" number ) ### Question ### what is the total number of teams located in minsk ? ### Accurate SQL ###
SELECT COUNT("team") FROM table_203_208 WHERE "location" = 'minsk'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE journalist ( Name VARCHAR, Years_working VARCHAR ) ### Question ### List the names of journalists in ascending order of years working. ### Accurate SQL ###
SELECT Name FROM journalist ORDER BY Years_working
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_59102 ( "Original NFL team" text, "Player" text, "Pos." text, "College" text, "Conf." text ) ### Question ### What college has Lance Moore Category:articles with hcards? ### Accurate SQL ###
SELECT "College" FROM table_59102 WHERE "Player" = 'lance moore category:articles with hcards'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_37206 ( "Season" real, "Winner" text, "Finalist" text, "Score" text, "Host City" text ) ### Question ### Who was the winner of the season before 2010 with Lietuvos Rytas as a finalist? ### Accurate SQL ###
SELECT "Winner" FROM table_37206 WHERE "Finalist" = 'lietuvos rytas' AND "Season" < '2010'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) TABLE: CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) ### Question ### provide the number of patients whose days of hospital stay is greater than 29 and lab test name is red blood cells? ### Accurate SQL ###
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "29" AND lab.label = "Red Blood Cells"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_32 ( year INTEGER, tyres VARCHAR, points VARCHAR ) ### Question ### What is the lowest year with tyres in g and less than 0 points? ### Accurate SQL ###
SELECT MIN(year) FROM table_name_32 WHERE tyres = "g" AND points < 0
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) TABLE: CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) TABLE: CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) TABLE: CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) TABLE: CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) ### Question ### What are the number of the first names of all students in Smith Hall? ### Accurate SQL ###
SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' GROUP BY Fname
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_27268238_4 ( highest_score VARCHAR ) ### Question ### If the highest score is 88, what are the 50s? ### Accurate SQL ###
SELECT 50 AS s FROM table_27268238_4 WHERE highest_score = "88"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_67188 ( "Year" real, "Film" text, "Director" text, "Nationality of director" text, "Award" text ) ### Question ### Year larger than 2008, and a Nationality of director of lebanon is what director? ### Accurate SQL ###
SELECT "Director" FROM table_67188 WHERE "Year" > '2008' AND "Nationality of director" = 'lebanon'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_13836704_7 (transit_passengers INTEGER, international_passengers VARCHAR) ### Question ### What is the maximum number of trnsit passeners when the total number of international passengers is 4870184? ### Accurate SQL ###
SELECT MAX(transit_passengers) FROM table_13836704_7 WHERE international_passengers = 4870184
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_12 ( team__number1 VARCHAR ) ### Question ### Which 1st leg that has hemofarm? ### Accurate SQL ###
SELECT 1 AS st_leg FROM table_name_12 WHERE team__number1 = "hemofarm"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_204_110 ( id number, "year" number, "champion" text, "city" text, "llws" text, "record" text ) ### Question ### there was a fifth place tie in 1967 , what was the next year to have a fifth place tie ? ### Accurate SQL ###
SELECT MIN("year") FROM table_204_110 WHERE "llws" = 'fifth place (tie)' AND "year" > 1967
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_86 ( round INTEGER, player VARCHAR, pick VARCHAR ) ### Question ### WHAT IS THE HIGHEST ROUND FOR MIKE TAYLOR, WITH PICK HIGHER THAN 55? ### Accurate SQL ###
SELECT MAX(round) FROM table_name_86 WHERE player = "mike taylor" AND pick > 55
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_22723 ( "Rank" real, "Metropolitan Statistical Area" text, "Total Population (2010)" real, "Indian American Population (2010)" real, "% Indian American" text, "Asian American Population (2010)" real, "% Asian American" text, "Combined Statistical Area" text ) ### Question ### Name the % asian american for 23526 ### Accurate SQL ###
SELECT "% Asian American" FROM table_22723 WHERE "Indian American Population (2010)" = '23526'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_204_107 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) ### Question ### which is the other nation with the second highest sliver medal ### Accurate SQL ###
SELECT "nation" FROM table_204_107 WHERE "silver" < (SELECT MAX("silver") FROM table_204_107) ORDER BY "silver" DESC LIMIT 1
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_68368 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real ) ### Question ### Which manufacturer made Shoya Tomizawa's motorcycle? ### Accurate SQL ###
SELECT "Manufacturer" FROM table_68368 WHERE "Rider" = 'shoya tomizawa'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_27715173_6 ( date VARCHAR, score VARCHAR ) ### Question ### What date was the game with a score of w 116 93 (ot)? ### Accurate SQL ###
SELECT date FROM table_27715173_6 WHERE score = "W 116–93 (OT)"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) TABLE: CREATE TABLE PostTypes ( Id number, Name text ) TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) TABLE: CREATE TABLE PostTags ( PostId number, TagId number ) TABLE: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) TABLE: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) TABLE: CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) TABLE: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text ) TABLE: CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) TABLE: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) TABLE: CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) TABLE: CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) TABLE: CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) TABLE: CREATE TABLE FlagTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) TABLE: CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) TABLE: CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) TABLE: CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) TABLE: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) TABLE: CREATE TABLE VoteTypes ( Id number, Name text ) TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) TABLE: CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) TABLE: CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) ### Question ### Who is answering their own questions?. ### Accurate SQL ###
SELECT Question.Id, Question.OwnerDisplayName FROM Posts AS Question INNER JOIN Posts AS Answer ON (Answer.ParentId = Question.Id) INNER JOIN Users ON (Users.Id = Question.OwnerUserId) WHERE Question.PostTypeId = 1 AND Answer.PostTypeId = 2 AND Question.OwnerUserId = Answer.OwnerUserId AND Question.Score < 10 AND Users.Reputation < 1000 AND Question.Id < 5000 ORDER BY Question.CreationDate DESC
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_82 ( pick__number INTEGER, pl_gp VARCHAR, rd__number VARCHAR, player VARCHAR ) ### Question ### What numbered pick was mattias ohlund, with over 52 PL GP, and also a round under 11? ### Accurate SQL ###
SELECT SUM(pick__number) FROM table_name_82 WHERE rd__number < 11 AND player = "mattias ohlund" AND pl_gp > 52
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_28586 ( "District" text, "Incumbent" text, "Party" text, "Elected" real, "Status" text, "Result" text ) ### Question ### What was the result for the district with an election in 1986 ### Accurate SQL ###
SELECT "Result" FROM table_28586 WHERE "Elected" = '1986'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_30 (score VARCHAR, date VARCHAR) ### Question ### What is Score, when Date is "Nov 28"? ### Accurate SQL ###
SELECT score FROM table_name_30 WHERE date = "nov 28"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_21425 ( "Fin. Pos" real, "Car No." real, "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Laps Led" real, "Points" text ) ### Question ### How many positions did the car with a final time of +10.8098 finish in? ### Accurate SQL ###
SELECT COUNT("Fin. Pos") FROM table_21425 WHERE "Time/Retired" = '+10.8098'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_31 ( year INTEGER, issue_price VARCHAR ) ### Question ### What was the year that had an issue price of $1,295.95? ### Accurate SQL ###
SELECT AVG(year) FROM table_name_31 WHERE issue_price = "$1,295.95"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_32336 ( "Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Winning constructor" text, "Report" text ) ### Question ### What circuit did Luigi Villoresi win the Lausanne Grand Prix? ### Accurate SQL ###
SELECT "Circuit" FROM table_32336 WHERE "Winning driver" = 'luigi villoresi' AND "Name" = 'lausanne grand prix'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_204_143 ( id number, "national park" text, "region" text, "land area (km2)" number, "established" number, "visitation (2009)" number, "coordinates" text ) ### Question ### what is the number of national parks that have a landmass of under 50 square km ? ### Accurate SQL ###
SELECT COUNT("national park") FROM table_204_143 WHERE "land area (km2)" < 50
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_13 ( runs VARCHAR, opponent VARCHAR, season VARCHAR ) ### Question ### How many runs did they get against new south wales in 2002/03? ### Accurate SQL ###
SELECT runs FROM table_name_13 WHERE opponent = "new south wales" AND season = "2002/03"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_97 (location VARCHAR, pitch VARCHAR) ### Question ### What is the Location of the Old Bedians Pitch? ### Accurate SQL ###
SELECT location FROM table_name_97 WHERE pitch = "old bedians"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_88 (school VARCHAR, round VARCHAR) ### Question ### From what school was the player drafted in round 3? ### Accurate SQL ###
SELECT school FROM table_name_88 WHERE round = 3
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE Residents_Services ( resident_id INTEGER, service_id INTEGER, date_moved_in DATETIME, property_id INTEGER, date_requested DATETIME, date_provided DATETIME, other_details VARCHAR(255) ) TABLE: CREATE TABLE Timed_Status_of_Things ( thing_id INTEGER, Date_and_Date DATETIME, Status_of_Thing_Code CHAR(15) ) TABLE: CREATE TABLE Timed_Locations_of_Things ( thing_id INTEGER, Date_and_Time DATETIME, Location_Code CHAR(15) ) TABLE: CREATE TABLE Residents ( resident_id INTEGER, property_id INTEGER, date_moved_in DATETIME, date_moved_out DATETIME, other_details VARCHAR(255) ) TABLE: CREATE TABLE Properties ( property_id INTEGER, property_type_code CHAR(15), property_address VARCHAR(255), other_details VARCHAR(255) ) TABLE: CREATE TABLE Things ( thing_id INTEGER, organization_id INTEGER, Type_of_Thing_Code CHAR(15), service_type_code CHAR(10), service_details VARCHAR(255) ) TABLE: CREATE TABLE Services ( service_id INTEGER, organization_id INTEGER, service_type_code CHAR(15), service_details VARCHAR(255) ) TABLE: CREATE TABLE Organizations ( organization_id INTEGER, parent_organization_id INTEGER, organization_details VARCHAR(255) ) TABLE: CREATE TABLE Customer_Events ( Customer_Event_ID INTEGER, customer_id INTEGER, date_moved_in DATETIME, property_id INTEGER, resident_id INTEGER, thing_id INTEGER ) TABLE: CREATE TABLE Customer_Event_Notes ( Customer_Event_Note_ID INTEGER, Customer_Event_ID INTEGER, service_type_code CHAR(15), resident_id INTEGER, property_id INTEGER, date_moved_in DATETIME ) TABLE: CREATE TABLE Customers ( customer_id INTEGER, customer_details VARCHAR(255) ) ### Question ### Bar graph to show the number of customer details from different customer details, and list in desc by the names. ### Accurate SQL ###
SELECT customer_details, COUNT(customer_details) FROM Customers GROUP BY customer_details ORDER BY customer_details DESC
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_63 ( home_team VARCHAR, venue VARCHAR ) ### Question ### Who is the home team at arden street oval? ### Accurate SQL ###
SELECT home_team FROM table_name_63 WHERE venue = "arden street oval"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_13609 ( "Year" real, "Finish position" text, "1st day" text, "2nd day" text, "3rd day" text, "4th Day" text ) ### Question ### Which Finish position has a 4th Day of bumped robinson? ### Accurate SQL ###
SELECT "Finish position" FROM table_13609 WHERE "4th Day" = 'bumped robinson'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_61654 ( "Game Title" text, "Year Released" real, "Platform" text, "GameRankings" text, "Metacritic" text ) ### Question ### What game was released before 2010 with a Metacritic of 85/100? ### Accurate SQL ###
SELECT "Game Title" FROM table_61654 WHERE "Metacritic" = '85/100' AND "Year Released" < '2010'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_86 (total_capacity__mwe_ INTEGER, power_plant VARCHAR) ### Question ### At the power plant located in ramakkalmedu, what is the sum of the total capacity (MWe)? ### Accurate SQL ###
SELECT SUM(total_capacity__mwe_) FROM table_name_86 WHERE power_plant = "ramakkalmedu"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_24384861_1 ( video_out VARCHAR, version VARCHAR ) ### Question ### how many video out connections does the sounddock portable have? ### Accurate SQL ###
SELECT COUNT(video_out) FROM table_24384861_1 WHERE version = "SoundDock Portable"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_7652 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) ### Question ### What is the lowest Rank with a Nation that is east germany? ### Accurate SQL ###
SELECT MIN("Rank") FROM table_7652 WHERE "Nation" = 'east germany'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_1571238_2 ( years_participated INTEGER, team VARCHAR ) ### Question ### How many years did notre dame participate? ### Accurate SQL ###
SELECT MAX(years_participated) FROM table_1571238_2 WHERE team = "Notre Dame"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_60286 ( "Year to April" real, "Revenue (US $million)" real, "EBIT (US $m)" real, "Net profit (US $m)" real, "Earnings per share (\u00a2)" real ) ### Question ### Name the total number of EBIT (US $m) in 2011 and a Earnings per share ( ) larger than 47? ### Accurate SQL ###
SELECT COUNT("EBIT (US $m)") FROM table_60286 WHERE "Year to April" = '2011' AND "Earnings per share (\u00a2)" > '47'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_71927 ( "Album or Song" text, "Band" text, "Memebrship" text, "Role" text, "Year" real ) ### Question ### Which band plays Self Versus Self - Immersion? ### Accurate SQL ###
SELECT "Band" FROM table_71927 WHERE "Album or Song" = 'self versus self - immersion'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_58076 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) ### Question ### What is the total Crowd with a Home team of collingwood? ### Accurate SQL ###
SELECT SUM("Crowd") FROM table_58076 WHERE "Home team" = 'collingwood'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE school ( enrollment INTEGER ) ### Question ### Show the average, maximum, minimum enrollment of all schools. ### Accurate SQL ###
SELECT AVG(enrollment), MAX(enrollment), MIN(enrollment) FROM school
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_5843 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) ### Question ### Which Opponent has an Attendance of 24,791? ### Accurate SQL ###
SELECT "Opponent" FROM table_5843 WHERE "Attendance" = '24,791'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_70494 ( "Venue" text, "City" text, "Tickets Sold / Available" text, "Gross Revenue (1986)" text, "Gross Revenue (2011)" text ) ### Question ### How many tickets were sold/available when the gross revenue (2011) was $366,916? ### Accurate SQL ###
SELECT "Tickets Sold / Available" FROM table_70494 WHERE "Gross Revenue (2011)" = '$366,916'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_19 ( team VARCHAR, players VARCHAR ) ### Question ### Players of amanda coetzer and marcos ondruska is what team? ### Accurate SQL ###
SELECT team FROM table_name_19 WHERE players = "amanda coetzer and marcos ondruska"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) TABLE: CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) TABLE: CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) TABLE: CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) TABLE: CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) TABLE: CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) TABLE: CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) TABLE: CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) TABLE: CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) TABLE: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) ### Question ### how much was the ph change of patient 028-11360 last measured on the first hospital visit compared to the second to last value measured on the first hospital visit? ### Accurate SQL ###
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-11360' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1)) AND lab.labname = 'ph' ORDER BY lab.labresulttime DESC LIMIT 1) - (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-11360' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1)) AND lab.labname = 'ph' ORDER BY lab.labresulttime DESC LIMIT 1 OFFSET 1)
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_27678 ( "Position" text, "Number" real, "Horse" text, "Jockey" text, "Age" real, "Handicap" text, "SP" text, "Distance" text ) ### Question ### what position has a handicap of 10-2? ### Accurate SQL ###
SELECT "Position" FROM table_27678 WHERE "Handicap" = '10-2'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_70791 ( "Model" text, "Specification" text, "Build date" text, "Total produced" real, "Wheel arrangement" text, "Prime mover" text, "Power output" text ) ### Question ### Which power output had a Build date of 1951 1956? ### Accurate SQL ###
SELECT "Power output" FROM table_70791 WHERE "Build date" = '1951–1956'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE assignedto ( scientist VARCHAR ) ### Question ### How many different scientists are assigned to any project? ### Accurate SQL ###
SELECT COUNT(DISTINCT scientist) FROM assignedto
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_70 ( model_number VARCHAR, part_number_s_ VARCHAR ) ### Question ### What is Model Number, when Part Number(s) is AY80609003987AB? ### Accurate SQL ###
SELECT model_number FROM table_name_70 WHERE part_number_s_ = "ay80609003987ab"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDate time, ApprovalModeratorId number, DeactivationDate time, DeactivationModeratorId number ) TABLE: CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) TABLE: CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) TABLE: CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) TABLE: CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) TABLE: CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) TABLE: CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) TABLE: CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) TABLE: CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) TABLE: CREATE TABLE FlagTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE PostTags ( PostId number, TagId number ) TABLE: CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) TABLE: CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) TABLE: CREATE TABLE VoteTypes ( Id number, Name text ) TABLE: CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) TABLE: CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) TABLE: CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) TABLE: CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) TABLE: CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text, LastEditDate time, LastActivityDate time, Title text, Tags text, AnswerCount number, CommentCount number, FavoriteCount number, ClosedDate time, CommunityOwnedDate time, ContentLicense text ) TABLE: CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) TABLE: CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) TABLE: CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) TABLE: CREATE TABLE PostHistoryTypes ( Id number, Name text ) TABLE: CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) TABLE: CREATE TABLE PostTypes ( Id number, Name text ) TABLE: CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) TABLE: CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) ### Question ### Questions with many downvoted answers.. ### Accurate SQL ###
SELECT COUNT(*) AS "DVed Answers", ParentId AS "post_link" FROM Posts WHERE PostTypeId = 2 AND Score < 0 GROUP BY ParentId ORDER BY COUNT(*) DESC LIMIT 30
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_75056 ( "Team" text, "Week 1" text, "Week 2" text, "Week 3" text, "Week 4" text, "Week 5" text, "Week 6" text, "Week 7" text, "Week 8 Final" text ) ### Question ### Name the week 6 when week 3 is 25 and week 7 is eliminated ### Accurate SQL ###
SELECT "Week 6" FROM table_75056 WHERE "Week 3" = '25' AND "Week 7" = 'eliminated'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_28 (year VARCHAR, total_matches VARCHAR) ### Question ### WHAT YEAR HAD 5 TOTAL MATCHES? ### Accurate SQL ###
SELECT year FROM table_name_28 WHERE total_matches = 5
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_96 ( week INTEGER, date VARCHAR ) ### Question ### What is the week number for the date of September 14, 1980? ### Accurate SQL ###
SELECT MAX(week) FROM table_name_96 WHERE date = "september 14, 1980"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_29 (to_par VARCHAR, score VARCHAR) ### Question ### What To par scored 72-71-68=211? ### Accurate SQL ###
SELECT to_par FROM table_name_29 WHERE score = 72 - 71 - 68 = 211
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_14940519_1 (record VARCHAR, result VARCHAR) ### Question ### Name the record for result of l 17–50 ### Accurate SQL ###
SELECT record FROM table_14940519_1 WHERE result = "L 17–50"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_29 ( location VARCHAR, date VARCHAR ) ### Question ### What was the location on October 16? ### Accurate SQL ###
SELECT location FROM table_name_29 WHERE date = "october 16"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_98 (pole_position VARCHAR, grand_prix VARCHAR) ### Question ### What is the Pole Position of the Portuguese Grand Prix? ### Accurate SQL ###
SELECT pole_position FROM table_name_98 WHERE grand_prix = "portuguese grand prix"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_79 ( year VARCHAR, apparatus VARCHAR, competition_description VARCHAR, rank_final VARCHAR ) ### Question ### What is Year, when Competition Description is 'U.S. Championships', when Rank-Final is less than 3, and when Apparatus is 'All-Around'? ### Accurate SQL ###
SELECT year FROM table_name_79 WHERE competition_description = "u.s. championships" AND rank_final < 3 AND apparatus = "all-around"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_87 ( instrumental VARCHAR, adverbial VARCHAR ) ### Question ### What instrumental has chven-s as the adverbial? ### Accurate SQL ###
SELECT instrumental FROM table_name_87 WHERE adverbial = "chven-s"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_78 ( date VARCHAR, game VARCHAR ) ### Question ### On what day was Game 7 of this season played? ### Accurate SQL ###
SELECT date FROM table_name_78 WHERE game = "game 7"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_95 (year INTEGER, margin VARCHAR) ### Question ### Name the average year for 46 margin ### Accurate SQL ###
SELECT AVG(year) FROM table_name_95 WHERE margin = 46
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_3619 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text ) ### Question ### what was the section where the winner is william hoge ### Accurate SQL ###
SELECT "District" FROM table_3619 WHERE "Incumbent" = 'William Hoge'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE gsi ( course_offering_id int, student_id int ) TABLE: CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) TABLE: CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) TABLE: CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) TABLE: CREATE TABLE area ( course_id int, area varchar ) TABLE: CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments int, respected int, participation int, heavy_reading int, tough_grader int, hilarious int, would_take_again int, good_lecture int, no_skip int ) TABLE: CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varchar ) TABLE: CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_project varchar, has_final_exam varchar, textbook varchar, class_address varchar, allow_audit varchar ) TABLE: CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_projects varchar, has_exams varchar, num_reviews int, clarity_score int, easiness_score int, helpfulness_score int ) TABLE: CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) TABLE: CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) TABLE: CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) TABLE: CREATE TABLE semester ( semester_id int, semester varchar, year int ) TABLE: CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) TABLE: CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) TABLE: CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) TABLE: CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) TABLE: CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) ### Question ### PATH 585 and 520 have what prerequisites ? ### Accurate SQL ###
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE (COURSE_1.number = 585 OR COURSE_1.number = 520) AND COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'PATH'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE Faculty ( Sex VARCHAR, Rank VARCHAR ) ### Question ### How many female Professors do we have? ### Accurate SQL ###
SELECT COUNT(*) FROM Faculty WHERE Sex = 'F' AND Rank = "Professor"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) TABLE: CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location text, discharge_location text, diagnosis text, dod text, dob_year text, dod_year text, admittime text, dischtime text, admityear text ) TABLE: CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) TABLE: CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) TABLE: CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ### Question ### specify death status of patient id 6983 ### Accurate SQL ###
SELECT demographic.expire_flag FROM demographic WHERE demographic.subject_id = "6983"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_30 (name VARCHAR, law_school_attended VARCHAR, appointed VARCHAR) ### Question ### Who attended Columbia law school and was appointed in 2004? ### Accurate SQL ###
SELECT name FROM table_name_30 WHERE law_school_attended = "columbia law school" AND appointed = 2004
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_63 (week VARCHAR, date VARCHAR) ### Question ### Which Week had a Date of december 4, 1960? ### Accurate SQL ###
SELECT week FROM table_name_63 WHERE date = "december 4, 1960"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_10132 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) ### Question ### What did South Melbourne score when they were the Away team? ### Accurate SQL ###
SELECT "Away team score" FROM table_10132 WHERE "Away team" = 'south melbourne'
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_40 (episodes INTEGER, romaji_title VARCHAR) ### Question ### What is the fewest episodes with the Romaji title Regatta~Kimi to Ita Eien~? ### Accurate SQL ###
SELECT MIN(episodes) FROM table_name_40 WHERE romaji_title = "regatta~kimi to ita eien~"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_name_58 (venue VARCHAR, notes VARCHAR) ### Question ### Which venue did the runner have a note of 1:23:07? ### Accurate SQL ###
SELECT venue FROM table_name_58 WHERE notes = "1:23:07"
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE stay ( patient VARCHAR, room VARCHAR ) ### Question ### How many patients stay in room 112? ### Accurate SQL ###
SELECT COUNT(patient) FROM stay WHERE room = 112
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) TABLE: CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) TABLE: CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) TABLE: CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) TABLE: CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, hospitaladmitsource text, unitadmittime time, unitdischargetime time, hospitaldischargetime time, hospitaldischargestatus text ) TABLE: CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) TABLE: CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) TABLE: CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) TABLE: CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) TABLE: CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) ### Question ### the electrolyte administration - phosphate is how much? ### Accurate SQL ###
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'electrolyte administration - phosphate')
Below is the list of tables from the database along with their columns and datatype. Need to generate an accurate SQL query for the question. Only use the columns present in the respective table. Only use the columns which are required to generate the SQL query. Only use table joins if required and not otherwise. ### Tables ### TABLE: CREATE TABLE table_12278 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) ### Question ### Which Date has a Tournament of milan , italy? ### Accurate SQL ###
SELECT "Date" FROM table_12278 WHERE "Tournament" = 'milan , italy'