schema
stringlengths 29
5.42k
| question
stringlengths 0
752
| rejected
stringlengths 2
4.44k
| chosen
stringlengths 4
8.94k
| weight
float64 0
8.73
|
---|---|---|---|---|
CREATE TABLE table_203_27 (id NUMBER, "number" NUMBER, "serial no" NUMBER, "entered service" CLOB, "withdrawn" CLOB, "kilometres travelled" NUMBER)
| which locomotive entered service first : 4107 or 4103 ? | SELECT "number" FROM table_203_27 WHERE "number" IN (4107, 4103) ORDER BY "entered service" LIMIT 1 | SELECT "number" FROM "table_203_27" WHERE "number" IN (4107, 4103) ORDER BY "entered service" FETCH FIRST 1 ROWS ONLY | 0.114258 |
CREATE TABLE pitStops (raceId NUMBER, driverId NUMBER, stop NUMBER, lap NUMBER, time CLOB, duration CLOB, milliseconds NUMBER)
CREATE TABLE results (resultId NUMBER, raceId NUMBER, driverId NUMBER, constructorId NUMBER, number NUMBER, grid NUMBER, position CLOB, positionText CLOB, positionOrder NUMBER, points FLOAT, laps CLOB, time CLOB, milliseconds CLOB, fastestLap CLOB, rank CLOB, fastestLapTime CLOB, fastestLapSpeed CLOB, statusId NUMBER)
CREATE TABLE lapTimes (raceId NUMBER, driverId NUMBER, lap NUMBER, position NUMBER, time CLOB, milliseconds NUMBER)
CREATE TABLE constructorResults (constructorResultsId NUMBER, raceId NUMBER, constructorId NUMBER, points FLOAT, status CLOB)
CREATE TABLE qualifying (qualifyId NUMBER, raceId NUMBER, driverId NUMBER, constructorId NUMBER, number NUMBER, position NUMBER, q1 CLOB, q2 CLOB, q3 CLOB)
CREATE TABLE circuits (circuitId NUMBER, circuitRef CLOB, name CLOB, location CLOB, country CLOB, lat FLOAT, lng FLOAT, alt CLOB, url CLOB)
CREATE TABLE drivers (driverId NUMBER, driverRef CLOB, number CLOB, code CLOB, forename CLOB, surname CLOB, dob CLOB, nationality CLOB, url CLOB)
CREATE TABLE status (statusId NUMBER, status CLOB)
CREATE TABLE constructors (constructorId NUMBER, constructorRef CLOB, name CLOB, nationality CLOB, url CLOB)
CREATE TABLE constructorStandings (constructorStandingsId NUMBER, raceId NUMBER, constructorId NUMBER, points FLOAT, position NUMBER, positionText CLOB, wins NUMBER)
CREATE TABLE driverStandings (driverStandingsId NUMBER, raceId NUMBER, driverId NUMBER, points FLOAT, position NUMBER, positionText CLOB, wins NUMBER)
CREATE TABLE seasons (year NUMBER, url CLOB)
CREATE TABLE races (raceId NUMBER, year NUMBER, round NUMBER, circuitId NUMBER, name CLOB, date CLOB, time CLOB, url CLOB)
| Show the number of races that had any driver whose forename is Lewis in each year with a line chart, and I want to sort x axis from high to low order. | SELECT year, COUNT(year) FROM results AS T1 JOIN races AS T2 ON T1.raceId = T2.raceId JOIN drivers AS T3 ON T1.driverId = T3.driverId WHERE T3.forename = "Lewis" ORDER BY year DESC | SELECT "year", COUNT("year") FROM "results" "T1" JOIN "races" "T2" ON "T1"."raceId" = "T2"."raceId" JOIN "drivers" "T3" ON "Lewis" = "T3"."forename" AND "T1"."driverId" = "T3"."driverId" ORDER BY "year" DESC | 0.202148 |
CREATE TABLE table_name_50 (loss VARCHAR2, attendance NUMBER)
| How many losses have more than 45,036 attendance? | SELECT loss FROM table_name_50 WHERE attendance > 45 OFFSET 036 | SELECT "loss" FROM "table_name_50" WHERE "attendance" > 45 OFFSET 036 ROWS | 0.072266 |
CREATE TABLE table_name_14 (week NUMBER, opponent VARCHAR2, attendance VARCHAR2)
| What was the average week for the gaime against the philadelphia eagles with less than 31,066 in attendance? | SELECT AVG(week) FROM table_name_14 WHERE opponent = "philadelphia eagles" AND attendance < 31 OFFSET 066 | SELECT AVG("week") FROM "table_name_14" WHERE "attendance" < 31 AND "opponent" = "philadelphia eagles" OFFSET 066 ROWS | 0.115234 |
CREATE TABLE table_44450 ("Outcome" CLOB, "Date" CLOB, "Surface" CLOB, "Partner" CLOB, "Opponents" CLOB, "Score" CLOB)
| Who was the partner on the game which took place on a clay surface with opponents of marco chiudinelli michael lammer and a runner-up result? | SELECT "Partner" FROM table_44450 WHERE "Outcome" = 'runner-up' AND "Surface" = 'clay' AND "Opponents" = 'marco chiudinelli michael lammer' | SELECT "Partner" FROM "table_44450" WHERE "Opponents" = 'marco chiudinelli michael lammer' AND "Outcome" = 'runner-up' AND "Surface" = 'clay' | 0.137695 |
CREATE TABLE table_48235 ("Game" FLOAT, "Date" CLOB, "Opponent" CLOB, "Result" CLOB, "49ers points" FLOAT, "Opponents" FLOAT, "Record" CLOB, "Streak" CLOB, "Attendance" FLOAT)
| What was the highest attendance for the game where the record was 0-5 and the opponents scored more than 20 points? | SELECT MAX("Attendance") FROM table_48235 WHERE "Record" = '0-5' AND "Opponents" > '20' | SELECT MAX("Attendance") FROM "table_48235" WHERE "Opponents" > '20' AND "Record" = '0-5' | 0.086914 |
CREATE TABLE table_41743 ("Date" CLOB, "Opponent" CLOB, "Location" CLOB, "Score" CLOB, "Loss" CLOB, "Record" CLOB)
| What is the Location when the Opponent shows vs. #23 south carolina? | SELECT "Location" FROM table_41743 WHERE "Opponent" = 'vs. #23 south carolina' | SELECT "Location" FROM "table_41743" WHERE "Opponent" = 'vs. #23 south carolina' | 0.078125 |
CREATE TABLE table_name_88 (year NUMBER, bronze VARCHAR2)
| WHAT YEAR HAS A BRONZE OF VALENTIN NOVIKOV? | SELECT AVG(year) FROM table_name_88 WHERE bronze = "valentin novikov" | SELECT AVG("year") FROM "table_name_88" WHERE "bronze" = "valentin novikov" | 0.073242 |
CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2)
CREATE TABLE aircraft (aircraft_code VARCHAR2, aircraft_description VARCHAR2, manufacturer VARCHAR2, basic_type VARCHAR2, engines NUMBER, propulsion VARCHAR2, wide_body VARCHAR2, wing_span NUMBER, length NUMBER, weight NUMBER, capacity NUMBER, pay_load NUMBER, cruising_speed NUMBER, range_miles NUMBER, pressurized VARCHAR2)
CREATE TABLE code_description (code VARCHAR2, description CLOB)
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER)
CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
CREATE TABLE airport (airport_code VARCHAR2, airport_name CLOB, airport_location CLOB, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2, minimum_connect_time NUMBER)
CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2)
CREATE TABLE flight (aircraft_code_sequence CLOB, airline_code VARCHAR2, airline_flight CLOB, arrival_time NUMBER, connections NUMBER, departure_time NUMBER, dual_carrier CLOB, flight_days CLOB, flight_id NUMBER, flight_number NUMBER, from_airport VARCHAR2, meal_code CLOB, stops NUMBER, time_elapsed NUMBER, to_airport VARCHAR2)
CREATE TABLE month (month_number NUMBER, month_name CLOB)
CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE fare (fare_id NUMBER, from_airport VARCHAR2, to_airport VARCHAR2, fare_basis_code CLOB, fare_airline CLOB, restriction_code CLOB, one_direction_cost NUMBER, round_trip_cost NUMBER, round_trip_required VARCHAR2)
CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER)
CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
CREATE TABLE flight_stop (flight_id NUMBER, stop_number NUMBER, stop_days CLOB, stop_airport CLOB, arrival_time NUMBER, arrival_airline CLOB, arrival_flight_number NUMBER, departure_time NUMBER, departure_airline CLOB, departure_flight_number NUMBER, stop_time NUMBER)
CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB)
CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER)
CREATE TABLE flight_fare (flight_id NUMBER, fare_id NUMBER)
CREATE TABLE fare_basis (fare_basis_code CLOB, booking_class CLOB, class_type CLOB, premium CLOB, economy CLOB, discounted CLOB, night CLOB, season CLOB, basis_days CLOB)
CREATE TABLE restriction (restriction_code CLOB, advance_purchase NUMBER, stopovers CLOB, saturday_stay_required CLOB, minimum_stay NUMBER, maximum_stay NUMBER, application CLOB, no_discounts CLOB)
| are there any flights from NEW YORK to LOS ANGELES which stop over in MILWAUKEE | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ANGELES' AND CITY_2.city_code = AIRPORT_SERVICE_2.city_code AND CITY_2.city_name = 'MILWAUKEE' AND flight_stop.stop_airport = AIRPORT_SERVICE_2.airport_code AND flight.flight_id = flight_stop.flight_id AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEW YORK' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code | SELECT DISTINCT "flight"."flight_id" FROM "airport_service" "AIRPORT_SERVICE_0" JOIN "city" "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'NEW YORK' JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" JOIN "airport_service" "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "flight_stop" ON "flight"."flight_id" = "flight_stop"."flight_id" JOIN "airport_service" "AIRPORT_SERVICE_2" ON "AIRPORT_SERVICE_2"."airport_code" = "flight_stop"."stop_airport" JOIN "city" "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'LOS ANGELES' JOIN "city" "CITY_2" ON "AIRPORT_SERVICE_2"."city_code" = "CITY_2"."city_code" AND "CITY_2"."city_name" = 'MILWAUKEE' | 0.78125 |
CREATE TABLE EMPLOYEE (EMP_NUM NUMBER, EMP_LNAME VARCHAR2, EMP_FNAME VARCHAR2, EMP_INITIAL VARCHAR2, EMP_JOBCODE VARCHAR2, EMP_HIREDATE DATETIME, EMP_DOB DATETIME)
CREATE TABLE STUDENT (STU_NUM NUMBER, STU_LNAME VARCHAR2, STU_FNAME VARCHAR2, STU_INIT VARCHAR2, STU_DOB DATETIME, STU_HRS NUMBER, STU_CLASS VARCHAR2, STU_GPA FLOAT, STU_TRANSFER NUMBER, DEPT_CODE VARCHAR2, STU_PHONE VARCHAR2, PROF_NUM NUMBER)
CREATE TABLE CLASS (CLASS_CODE VARCHAR2, CRS_CODE VARCHAR2, CLASS_SECTION VARCHAR2, CLASS_TIME VARCHAR2, CLASS_ROOM VARCHAR2, PROF_NUM NUMBER)
CREATE TABLE COURSE (CRS_CODE VARCHAR2, DEPT_CODE VARCHAR2, CRS_DESCRIPTION VARCHAR2, CRS_CREDIT FLOAT)
CREATE TABLE PROFESSOR (EMP_NUM NUMBER, DEPT_CODE VARCHAR2, PROF_OFFICE VARCHAR2, PROF_EXTENSION VARCHAR2, PROF_HIGH_DEGREE VARCHAR2)
CREATE TABLE ENROLL (CLASS_CODE VARCHAR2, STU_NUM NUMBER, ENROLL_GRADE VARCHAR2)
CREATE TABLE DEPARTMENT (DEPT_CODE VARCHAR2, DEPT_NAME VARCHAR2, SCHOOL_CODE VARCHAR2, EMP_NUM NUMBER, DEPT_ADDRESS VARCHAR2, DEPT_EXTENSION VARCHAR2)
| Visualize a bar chart for how many hours do the students spend studying in each department?, and sort DEPT_CODE from high to low order. | SELECT DEPT_CODE, SUM(STU_HRS) FROM STUDENT GROUP BY DEPT_CODE ORDER BY DEPT_CODE DESC | SELECT "DEPT_CODE", SUM("STU_HRS") FROM "STUDENT" GROUP BY "DEPT_CODE" ORDER BY "DEPT_CODE" DESC | 0.09375 |
CREATE TABLE table_25407 ("Outcome" CLOB, "Year" FLOAT, "Championship" CLOB, "Surface" CLOB, "Opponent in the final" CLOB, "Score in the final" CLOB)
| Which surfaces have the final score of 6 1, 6 7 (2 7) , 7 6 (7 5) , 7 6 (10 8)? | SELECT "Surface" FROM table_25407 WHERE "Score in the final" = '6β1, 6β7 (2β7) , 7β6 (7β5) , 7β6 (10β8)' | SELECT "Surface" FROM "table_25407" WHERE "Score in the final" = '6β1, 6β7 (2β7) , 7β6 (7β5) , 7β6 (10β8)' | 0.103516 |
CREATE TABLE table_2701851_5 (written_by VARCHAR2, no_in_series VARCHAR2)
| Who wrote the episode in the series 46b? | SELECT written_by FROM table_2701851_5 WHERE no_in_series = "46b" | SELECT "written_by" FROM "table_2701851_5" WHERE "46b" = "no_in_series" | 0.069336 |
CREATE TABLE table_203_287 (id NUMBER, "rank" NUMBER, "area" CLOB, "date" CLOB, "presenter" CLOB, "seven wonders covered" CLOB)
| what is the name of the first presenter on this chart ? | SELECT "presenter" FROM table_203_287 WHERE id = 1 | SELECT "presenter" FROM "table_203_287" WHERE "id" = 1 | 0.052734 |
CREATE TABLE station (total_passengers NUMBER, LOCATION VARCHAR2)
| What is the average and maximum number of total passengers for train stations in London or Glasgow? | SELECT AVG(total_passengers), MAX(total_passengers) FROM station WHERE LOCATION = 'London' OR LOCATION = 'Glasgow' | SELECT AVG("total_passengers"), MAX("total_passengers") FROM "station" WHERE "LOCATION" = 'Glasgow' OR "LOCATION" = 'London' | 0.121094 |
CREATE TABLE table_75853 ("House" CLOB, "Sign" CLOB, "Latin motto" CLOB, "Translation" CLOB, "Modern title of house" CLOB)
| What is the modern house title of the 1st house? | SELECT "Modern title of house" FROM table_75853 WHERE "House" = '1st' | SELECT "Modern title of house" FROM "table_75853" WHERE "House" = '1st' | 0.069336 |
CREATE TABLE table_39444 ("Rank" FLOAT, "Country" CLOB, "Wins ( Outdoor ) " FLOAT, "Wins ( Indoor ) " FLOAT, "Wins ( Total ) " FLOAT)
| Name the most rank for uk and wins more than 5 | SELECT MAX("Rank") FROM table_39444 WHERE "Country" = 'uk' AND "Wins (Indoor)" > '5' | SELECT MAX("Rank") FROM "table_39444" WHERE "Country" = 'uk' AND "Wins (Indoor)" > '5' | 0.083984 |
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| what is the number of patients whose death status is 0 and drug name is fluconazole? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "0" AND prescriptions.drug = "Fluconazole" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "Fluconazole" = "prescriptions"."drug" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "0" = "demographic"."expire_flag" | 0.22168 |
CREATE TABLE table_20823568_2 (second_place_s_ VARCHAR2, sporting_profession VARCHAR2)
| How many second place showings does snooker have? | SELECT second_place_s_ FROM table_20823568_2 WHERE sporting_profession = "Snooker" | SELECT "second_place_s_" FROM "table_20823568_2" WHERE "Snooker" = "sporting_profession" | 0.085938 |
CREATE TABLE table_68215 ("Year" FLOAT, "Manufacturer" CLOB, "Start" FLOAT, "Finish" FLOAT, "Team" CLOB)
| Name the most year with start less than 2 | SELECT MAX("Year") FROM table_68215 WHERE "Start" < '2' | SELECT MAX("Year") FROM "table_68215" WHERE "Start" < '2' | 0.055664 |
CREATE TABLE table_57427 ("Driver" CLOB, "Constructor" CLOB, "Laps" FLOAT, "Time/Retired" CLOB, "Grid" FLOAT)
| What's the average Grid with Laps of 88? | SELECT AVG("Grid") FROM table_57427 WHERE "Laps" = '88' | SELECT AVG("Grid") FROM "table_57427" WHERE "Laps" = '88' | 0.055664 |
CREATE TABLE table_name_73 (status VARCHAR2, style VARCHAR2)
| what's the status in the style of ballet/ gymnastics? | SELECT status FROM table_name_73 WHERE style = "ballet/ gymnastics" | SELECT "status" FROM "table_name_73" WHERE "ballet/ gymnastics" = "style" | 0.071289 |
CREATE TABLE Products (Code NUMBER, Name VARCHAR2, Price NUMBER, Manufacturer NUMBER)
CREATE TABLE Manufacturers (Code NUMBER, Name VARCHAR2, Headquarter VARCHAR2, Founder VARCHAR2, Revenue FLOAT)
| Select the names of all the products in the store, and count them by a bar chart, and order Y-axis from low to high order. | SELECT Name, COUNT(Name) FROM Products GROUP BY Name ORDER BY COUNT(Name) | SELECT "Name", COUNT("Name") FROM "Products" GROUP BY "Name" ORDER BY COUNT("Name") | 0.081055 |
CREATE TABLE departments (DEPARTMENT_ID NUMBER, DEPARTMENT_NAME VARCHAR2, MANAGER_ID NUMBER, LOCATION_ID NUMBER)
CREATE TABLE job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER)
CREATE TABLE locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2)
CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER)
CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER)
CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2)
| For all employees who have the letters D or S in their first name, a bar chart shows the distribution of hire_date and the average of manager_id bin hire_date by time. | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | SELECT "HIRE_DATE", AVG("MANAGER_ID") FROM "employees" WHERE "FIRST_NAME" LIKE '%D%' OR "FIRST_NAME" LIKE '%S%' | 0.108398 |
CREATE TABLE table_name_19 (name VARCHAR2, position VARCHAR2)
| Who was the head coach? | SELECT name FROM table_name_19 WHERE position = "head coach" | SELECT "name" FROM "table_name_19" WHERE "head coach" = "position" | 0.064453 |
CREATE TABLE table_name_75 (bronze NUMBER, silver VARCHAR2, gold VARCHAR2, nation VARCHAR2)
| what is the average bronze when gold is more than 0, the nation is greece and silver is less than 0? | SELECT AVG(bronze) FROM table_name_75 WHERE gold > 0 AND nation = "greece" AND silver < 0 | SELECT AVG("bronze") FROM "table_name_75" WHERE "gold" > 0 AND "greece" = "nation" AND "silver" < 0 | 0.09668 |
CREATE TABLE table_29309 ("Team" CLOB, "Home Gms" FLOAT, "Home Total" FLOAT, "Home Avg" FLOAT, "Top Home Crowd" CLOB, "Road Gms" FLOAT, "Road Total" FLOAT, "Road Avg" FLOAT, "Overall Gms" FLOAT, "Overall Total" FLOAT, "Overall Avg" FLOAT)
| Which team has the home average of 18125? | SELECT "Team" FROM table_29309 WHERE "Home Avg" = '18125' | SELECT "Team" FROM "table_29309" WHERE "Home Avg" = '18125' | 0.057617 |
CREATE TABLE gas_station (Station_ID NUMBER, Open_Year NUMBER, Location CLOB, Manager_Name CLOB, Vice_Manager_Name CLOB, Representative_Name CLOB)
CREATE TABLE station_company (Station_ID NUMBER, Company_ID NUMBER, Rank_of_the_Year NUMBER)
CREATE TABLE company (Company_ID NUMBER, Rank NUMBER, Company CLOB, Headquarters CLOB, Main_Industry CLOB, Sales_billion FLOAT, Profits_billion FLOAT, Assets_billion FLOAT, Market_Value FLOAT)
| Draw a bar chart of manager name versus how many manager name, and list X from low to high order. | SELECT Manager_Name, COUNT(Manager_Name) FROM gas_station GROUP BY Manager_Name ORDER BY Manager_Name | SELECT "Manager_Name", COUNT("Manager_Name") FROM "gas_station" GROUP BY "Manager_Name" ORDER BY "Manager_Name" | 0.108398 |
CREATE TABLE course_offering (offering_id NUMBER, course_id NUMBER, semester NUMBER, section_number NUMBER, start_time TIME, end_time TIME, monday VARCHAR2, tuesday VARCHAR2, wednesday VARCHAR2, thursday VARCHAR2, friday VARCHAR2, saturday VARCHAR2, sunday VARCHAR2, has_final_project VARCHAR2, has_final_exam VARCHAR2, textbook VARCHAR2, class_address VARCHAR2, allow_audit VARCHAR2)
CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER)
CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER)
CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER)
CREATE TABLE ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2)
CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2)
CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER)
CREATE TABLE program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2)
CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2)
CREATE TABLE course (course_id NUMBER, name VARCHAR2, department VARCHAR2, number VARCHAR2, credits VARCHAR2, advisory_requirement VARCHAR2, enforced_requirement VARCHAR2, description VARCHAR2, num_semesters NUMBER, num_enrolled NUMBER, has_discussion VARCHAR2, has_lab VARCHAR2, has_projects VARCHAR2, has_exams VARCHAR2, num_reviews NUMBER, clarity_score NUMBER, easiness_score NUMBER, helpfulness_score NUMBER)
CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2)
CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER)
CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2)
CREATE TABLE student_record (student_id NUMBER, course_id NUMBER, semester NUMBER, grade VARCHAR2, how VARCHAR2, transfer_source VARCHAR2, earn_credit VARCHAR2, repeat_term VARCHAR2, test_id VARCHAR2)
CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2)
CREATE TABLE student (student_id NUMBER, lastname VARCHAR2, firstname VARCHAR2, program_id NUMBER, declare_major VARCHAR2, total_credit NUMBER, total_gpa FLOAT, entered_as VARCHAR2, admit_term NUMBER, predicted_graduation_semester NUMBER, degree VARCHAR2, minor VARCHAR2, internship VARCHAR2)
CREATE TABLE course_tags_count (course_id NUMBER, clear_grading NUMBER, pop_quiz NUMBER, group_projects NUMBER, inspirational NUMBER, long_lectures NUMBER, extra_credit NUMBER, few_tests NUMBER, good_feedback NUMBER, tough_tests NUMBER, heavy_papers NUMBER, cares_for_students NUMBER, heavy_assignments NUMBER, respected NUMBER, participation NUMBER, heavy_reading NUMBER, tough_grader NUMBER, hilarious NUMBER, would_take_again NUMBER, good_lecture NUMBER, no_skip NUMBER)
CREATE TABLE area (course_id NUMBER, area VARCHAR2)
| Are there courses that will offer 10 credits ? | SELECT DISTINCT name, number FROM course WHERE credits = 10 AND department = 'EECS' | SELECT DISTINCT "name", "number" FROM "course" WHERE "credits" = 10 AND "department" = 'EECS' | 0.09082 |
CREATE TABLE table_name_20 (venue VARCHAR2, competition VARCHAR2, notes VARCHAR2)
| What venue hsoted the european cross country championships with a notes of junior men individual 6.595km? | SELECT venue FROM table_name_20 WHERE competition = "european cross country championships" AND notes = "junior men individual 6.595km" | SELECT "venue" FROM "table_name_20" WHERE "competition" = "european cross country championships" AND "junior men individual 6.595km" = "notes" | 0.138672 |
CREATE TABLE table_1342149_18 (result VARCHAR2, incumbent VARCHAR2)
| What was the result in the election where Hale Boggs was the incumbent? | SELECT result FROM table_1342149_18 WHERE incumbent = "Hale Boggs" | SELECT "result" FROM "table_1342149_18" WHERE "Hale Boggs" = "incumbent" | 0.070313 |
CREATE TABLE table_name_57 (home VARCHAR2, points VARCHAR2, date VARCHAR2)
| Who was the home team on January 2 with 23 points? | SELECT home FROM table_name_57 WHERE points = 23 AND date = "january 2" | SELECT "home" FROM "table_name_57" WHERE "date" = "january 2" AND "points" = 23 | 0.077148 |
CREATE TABLE table_203_148 (id NUMBER, "date" CLOB, "name" CLOB, "nationality" CLOB, "tonnage\ ( grt ) " NUMBER, "fate" CLOB)
| what was the top -lrb- most frequent -rrb- fate reported for losses ? | SELECT "fate" FROM table_203_148 GROUP BY "fate" ORDER BY COUNT(*) DESC LIMIT 1 | SELECT "fate" FROM "table_203_148" GROUP BY "fate" ORDER BY COUNT(*) DESC FETCH FIRST 1 ROWS ONLY | 0.094727 |
CREATE TABLE table_5027 ("Rank" FLOAT, "Name" CLOB, "Nationality" CLOB, "1st ( m ) " FLOAT, "2nd ( m ) " FLOAT, "Points" FLOAT, "Overall WC points ( Rank ) " CLOB)
| How much Rank has a 1st (m) of 127? | SELECT COUNT("Rank") FROM table_5027 WHERE "1st (m)" = '127' | SELECT COUNT("Rank") FROM "table_5027" WHERE "1st (m)" = '127' | 0.060547 |
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB)
CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
CREATE TABLE airport (airport_code VARCHAR2, airport_name CLOB, airport_location CLOB, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2, minimum_connect_time NUMBER)
CREATE TABLE fare (fare_id NUMBER, from_airport VARCHAR2, to_airport VARCHAR2, fare_basis_code CLOB, fare_airline CLOB, restriction_code CLOB, one_direction_cost NUMBER, round_trip_cost NUMBER, round_trip_required VARCHAR2)
CREATE TABLE aircraft (aircraft_code VARCHAR2, aircraft_description VARCHAR2, manufacturer VARCHAR2, basic_type VARCHAR2, engines NUMBER, propulsion VARCHAR2, wide_body VARCHAR2, wing_span NUMBER, length NUMBER, weight NUMBER, capacity NUMBER, pay_load NUMBER, cruising_speed NUMBER, range_miles NUMBER, pressurized VARCHAR2)
CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER)
CREATE TABLE flight_stop (flight_id NUMBER, stop_number NUMBER, stop_days CLOB, stop_airport CLOB, arrival_time NUMBER, arrival_airline CLOB, arrival_flight_number NUMBER, departure_time NUMBER, departure_airline CLOB, departure_flight_number NUMBER, stop_time NUMBER)
CREATE TABLE code_description (code VARCHAR2, description CLOB)
CREATE TABLE fare_basis (fare_basis_code CLOB, booking_class CLOB, class_type CLOB, premium CLOB, economy CLOB, discounted CLOB, night CLOB, season CLOB, basis_days CLOB)
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER)
CREATE TABLE flight_fare (flight_id NUMBER, fare_id NUMBER)
CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE flight (aircraft_code_sequence CLOB, airline_code VARCHAR2, airline_flight CLOB, arrival_time NUMBER, connections NUMBER, departure_time NUMBER, dual_carrier CLOB, flight_days CLOB, flight_id NUMBER, flight_number NUMBER, from_airport VARCHAR2, meal_code CLOB, stops NUMBER, time_elapsed NUMBER, to_airport VARCHAR2)
CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER)
CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB)
CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2)
CREATE TABLE month (month_number NUMBER, month_name CLOB)
CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2)
CREATE TABLE restriction (restriction_code CLOB, advance_purchase NUMBER, stopovers CLOB, saturday_stay_required CLOB, minimum_stay NUMBER, maximum_stay NUMBER, application CLOB, no_discounts CLOB)
| saturday flight on AA from MILWAUKEE to PHOENIX | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHOENIX' AND CITY_1.state_code = 'state_code0' AND date_day.day_number = 26 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'MILWAUKEE' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.airline_code = 'AA' | SELECT DISTINCT "flight"."flight_id" FROM "airport_service" "AIRPORT_SERVICE_0" JOIN "date_day" ON "date_day"."day_number" = 26 AND "date_day"."month_number" = 7 AND "date_day"."year" = 1991 JOIN "city" "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'MILWAUKEE' JOIN "days" ON "date_day"."day_name" = "days"."day_name" JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" AND "days"."days_code" = "flight"."flight_days" AND "flight"."airline_code" = 'AA' JOIN "airport_service" "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "city" "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'PHOENIX' AND "CITY_1"."state_code" = 'state_code0' | 0.770508 |
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
| give me the number of patients whose diagnoses short title is opioid dependence-contin and lab test category is blood gas? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Opioid dependence-contin" AND lab."CATEGORY" = "Blood Gas" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Opioid dependence-contin" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" JOIN "lab" ON "Blood Gas" = "lab"."CATEGORY" AND "demographic"."hadm_id" = "lab"."hadm_id" | 0.279297 |
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
| when was the last arterial bp [diastolic] of patient 25814 measured on this month/28? | SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25814)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [diastolic]' AND d_items.linksto = 'chartevents') AND DATETIME(chartevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') AND STRFTIME('%d', chartevents.charttime) = '28' ORDER BY chartevents.charttime DESC LIMIT 1 | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 25814 GROUP BY "hadm_id"), "_u_1" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL GROUP BY "icustay_id"), "_u_2" AS (SELECT "d_items"."itemid" FROM "d_items" WHERE "d_items"."label" = 'arterial bp [diastolic]' AND "d_items"."linksto" = 'chartevents' GROUP BY "itemid") SELECT "chartevents"."charttime" FROM "chartevents" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "chartevents"."icustay_id" LEFT JOIN "_u_2" "_u_2" ON "_u_2"."" = "chartevents"."itemid" WHERE DATETIME("chartevents"."charttime", 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') AND NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL AND STRFTIME('%d', "chartevents"."charttime") = '28' ORDER BY "chartevents"."charttime" DESC FETCH FIRST 1 ROWS ONLY | 0.901367 |
CREATE TABLE table_name_29 (partner VARCHAR2, score VARCHAR2)
| Who is the partner with a score of 6 1, 6 4? | SELECT partner FROM table_name_29 WHERE score = "6β1, 6β4" | SELECT "partner" FROM "table_name_29" WHERE "6β1, 6β4" = "score" | 0.0625 |
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| give me the number of patients whose days of hospital stay is greater than 8 and drug route is both eyes? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "8" AND prescriptions.route = "BOTH EYES" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "BOTH EYES" = "prescriptions"."route" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "8" < "demographic"."days_stay" | 0.21875 |
CREATE TABLE table_name_73 (score VARCHAR2, october VARCHAR2, record VARCHAR2)
| Which Score has an October smaller than 15, and a Record of 2 0 0? | SELECT score FROM table_name_73 WHERE october < 15 AND record = "2β0β0" | SELECT "score" FROM "table_name_73" WHERE "2β0β0" = "record" AND "october" < 15 | 0.077148 |
CREATE TABLE table_203_352 (id NUMBER, "position" NUMBER, "swara" CLOB, "short name" CLOB, "notation" CLOB, "mnemonic" CLOB)
| which swara holds the last position ? | SELECT "swara" FROM table_203_352 ORDER BY "position" DESC LIMIT 1 | SELECT "swara" FROM "table_203_352" ORDER BY "position" DESC FETCH FIRST 1 ROWS ONLY | 0.082031 |
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
| Count the number of patients whose primary disease is pneumonia human immunodeficiency virus but not tuberculosis and procedure short title is aortocor bypas-2 cor art. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "PNEUMONIA;HUMAN IMMUNODEFIENCY VIRUS;RULE OUT TUBERCULOSIS" AND procedures.short_title = "Aortocor bypas-2 cor art" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Aortocor bypas-2 cor art" = "procedures"."short_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "PNEUMONIA;HUMAN IMMUNODEFIENCY VIRUS;RULE OUT TUBERCULOSIS" = "demographic"."diagnosis" | 0.286133 |
CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER)
CREATE TABLE fare_basis (fare_basis_code CLOB, booking_class CLOB, class_type CLOB, premium CLOB, economy CLOB, discounted CLOB, night CLOB, season CLOB, basis_days CLOB)
CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER)
CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
CREATE TABLE flight_fare (flight_id NUMBER, fare_id NUMBER)
CREATE TABLE restriction (restriction_code CLOB, advance_purchase NUMBER, stopovers CLOB, saturday_stay_required CLOB, minimum_stay NUMBER, maximum_stay NUMBER, application CLOB, no_discounts CLOB)
CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2)
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB)
CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
CREATE TABLE code_description (code VARCHAR2, description CLOB)
CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER)
CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2)
CREATE TABLE airport (airport_code VARCHAR2, airport_name CLOB, airport_location CLOB, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2, minimum_connect_time NUMBER)
CREATE TABLE flight (aircraft_code_sequence CLOB, airline_code VARCHAR2, airline_flight CLOB, arrival_time NUMBER, connections NUMBER, departure_time NUMBER, dual_carrier CLOB, flight_days CLOB, flight_id NUMBER, flight_number NUMBER, from_airport VARCHAR2, meal_code CLOB, stops NUMBER, time_elapsed NUMBER, to_airport VARCHAR2)
CREATE TABLE flight_stop (flight_id NUMBER, stop_number NUMBER, stop_days CLOB, stop_airport CLOB, arrival_time NUMBER, arrival_airline CLOB, arrival_flight_number NUMBER, departure_time NUMBER, departure_airline CLOB, departure_flight_number NUMBER, stop_time NUMBER)
CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB)
CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
CREATE TABLE fare (fare_id NUMBER, from_airport VARCHAR2, to_airport VARCHAR2, fare_basis_code CLOB, fare_airline CLOB, restriction_code CLOB, one_direction_cost NUMBER, round_trip_cost NUMBER, round_trip_required VARCHAR2)
CREATE TABLE aircraft (aircraft_code VARCHAR2, aircraft_description VARCHAR2, manufacturer VARCHAR2, basic_type VARCHAR2, engines NUMBER, propulsion VARCHAR2, wide_body VARCHAR2, wing_span NUMBER, length NUMBER, weight NUMBER, capacity NUMBER, pay_load NUMBER, cruising_speed NUMBER, range_miles NUMBER, pressurized VARCHAR2)
CREATE TABLE month (month_number NUMBER, month_name CLOB)
| show me all flights from SAN FRANCISCO to ATLANTA | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code | SELECT DISTINCT "flight"."flight_id" FROM "airport_service" "AIRPORT_SERVICE_0" JOIN "city" "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'SAN FRANCISCO' JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" JOIN "airport_service" "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "city" "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'ATLANTA' | 0.488281 |
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
| how many patients who had elective hospital admission had polys lab test? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.label = "Polys" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Polys" = "lab"."label" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "ELECTIVE" = "demographic"."admission_type" | 0.197266 |
CREATE TABLE table_6807 ("Game" FLOAT, "Date" CLOB, "Team" CLOB, "Score" CLOB, "High points" CLOB, "High rebounds" CLOB, "High assists" CLOB, "Location Attendance" CLOB, "Record" CLOB)
| How many games had a score of l 91 95 (ot)? | SELECT COUNT("Game") FROM table_6807 WHERE "Score" = 'l 91β95 (ot)' | SELECT COUNT("Game") FROM "table_6807" WHERE "Score" = 'l 91β95 (ot)' | 0.067383 |
CREATE TABLE table_70240 ("Stage" CLOB, "Winner" CLOB, "General classification" CLOB, "Points classification" CLOB, "Mountains classification" CLOB, "Young rider classification" CLOB, "Intergiro classification" CLOB, "Trofeo Fast Team" CLOB)
| Who was the winner when the General classification was held by Miguel Indurain, the Points classification held by Mario Cipollini, the Mountains classification held by Claudio Chiappucci, and the Young RIder classification held by Pavel Tonkov? | SELECT "Winner" FROM table_70240 WHERE "General classification" = 'miguel indurain' AND "Points classification" = 'mario cipollini' AND "Mountains classification" = 'claudio chiappucci' AND "Young rider classification" = 'pavel tonkov' | SELECT "Winner" FROM "table_70240" WHERE "General classification" = 'miguel indurain' AND "Mountains classification" = 'claudio chiappucci' AND "Points classification" = 'mario cipollini' AND "Young rider classification" = 'pavel tonkov' | 0.231445 |
CREATE TABLE Manufacturers (Code NUMBER, Name VARCHAR2, Headquarter VARCHAR2, Founder VARCHAR2, Revenue FLOAT)
CREATE TABLE Products (Code NUMBER, Name VARCHAR2, Price NUMBER, Manufacturer NUMBER)
| For those records from the products and each product's manufacturer, give me the comparison about the sum of revenue over the name , and group by attribute name by a bar chart. | SELECT T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name | SELECT "T2"."Name", "T2"."Revenue" FROM "Products" "T1" JOIN "Manufacturers" "T2" ON "T1"."Manufacturer" = "T2"."Code" GROUP BY "T2"."Name" | 0.135742 |
CREATE TABLE wine (No NUMBER, Grape CLOB, Winery CLOB, Appelation CLOB, State CLOB, Name CLOB, Year NUMBER, Price NUMBER, Score NUMBER, Cases NUMBER, Drink CLOB)
CREATE TABLE grapes (ID NUMBER, Grape CLOB, Color CLOB)
CREATE TABLE appellations (No NUMBER, Appelation CLOB, County CLOB, State CLOB, Area CLOB, isAVA CLOB)
| What are the maximum score of wines in each year?, and show in asc by the X. | SELECT Year, MAX(Score) FROM wine GROUP BY Year ORDER BY Year | SELECT "Year", MAX("Score") FROM "wine" GROUP BY "Year" ORDER BY "Year" | 0.069336 |
CREATE TABLE table_name_63 (method VARCHAR2, record VARCHAR2)
| What is the method when the record was 3-2? | SELECT method FROM table_name_63 WHERE record = "3-2" | SELECT "method" FROM "table_name_63" WHERE "3-2" = "record" | 0.057617 |
CREATE TABLE table_name_84 (school_club_team VARCHAR2, name VARCHAR2, acquisition_via VARCHAR2, position VARCHAR2)
| What team acquired as a rookie draft in the position of guard Dennis Miranda? | SELECT school_club_team FROM table_name_84 WHERE acquisition_via = "rookie draft" AND position = "guard" AND name = "dennis miranda" | SELECT "school_club_team" FROM "table_name_84" WHERE "acquisition_via" = "rookie draft" AND "dennis miranda" = "name" AND "guard" = "position" | 0.138672 |
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
| How many male patients had icd9 code 8842? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.icd9_code = "8842" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "8842" = "procedures"."icd9_code" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "M" = "demographic"."gender" | 0.206055 |
CREATE TABLE table_15965 ("Pick" FLOAT, "Player" CLOB, "Position" CLOB, "Nationality" CLOB, "NHL team" CLOB, "College/junior/club team" CLOB)
| What positions do the hartford whalers nhl team have? | SELECT "Position" FROM table_15965 WHERE "NHL team" = 'Hartford Whalers' | SELECT "Position" FROM "table_15965" WHERE "NHL team" = 'Hartford Whalers' | 0.072266 |
CREATE TABLE table_39793 ("Position" FLOAT, "Team" CLOB, "Points" FLOAT, "Played" FLOAT, "Drawn" FLOAT, "Lost" FLOAT, "Against" FLOAT, "Difference" CLOB)
| What is the lowest Points when against is 50, and there are less than 20 played? | SELECT MIN("Points") FROM table_39793 WHERE "Against" = '50' AND "Played" < '20' | SELECT MIN("Points") FROM "table_39793" WHERE "Against" = '50' AND "Played" < '20' | 0.080078 |
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER)
CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER)
CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
| Currently Protected Questions, simple search. | SELECT ph.PostId AS "post_link", ph.CreationDate AS "protected_date", CASE ph.UserId WHEN NULL THEN ph.UserDisplayName ELSE ph.UserId END AS "user_link" FROM PostHistory AS ph WHERE ph.PostHistoryTypeId = 19 ORDER BY ph.PostId, ph.CreationDate | SELECT "ph"."PostId" AS "post_link", "ph"."CreationDate" AS "protected_date", "ph"."UserId" AS "user_link" FROM "PostHistory" "ph" WHERE "ph"."PostHistoryTypeId" = 19 ORDER BY "ph"."PostId", "ph"."CreationDate" | 0.205078 |
CREATE TABLE table_name_67 (round NUMBER, name VARCHAR2)
| What is Roy Hall's highest round? | SELECT MAX(round) FROM table_name_67 WHERE name = "roy hall" | SELECT MAX("round") FROM "table_name_67" WHERE "name" = "roy hall" | 0.064453 |
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
| had patient 12726's arterial bp [systolic] today been ever greater than 187.0? | SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12726)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [systolic]' AND d_items.linksto = 'chartevents') AND chartevents.valuenum > 187.0 AND DATETIME(chartevents.charttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 12726 GROUP BY "hadm_id"), "_u_1" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL GROUP BY "icustay_id"), "_u_2" AS (SELECT "d_items"."itemid" FROM "d_items" WHERE "d_items"."label" = 'arterial bp [systolic]' AND "d_items"."linksto" = 'chartevents' GROUP BY "itemid") SELECT COUNT(*) > 0 FROM "chartevents" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "chartevents"."icustay_id" LEFT JOIN "_u_2" "_u_2" ON "_u_2"."" = "chartevents"."itemid" WHERE "chartevents"."valuenum" > 187.0 AND DATETIME("chartevents"."charttime", 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') AND NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL | 0.803711 |
CREATE TABLE table_58479 ("Driver" CLOB, "Constructor" CLOB, "Laps" FLOAT, "Time/Retired" CLOB, "Grid" FLOAT)
| What is the driver for Grid 8? | SELECT "Driver" FROM table_58479 WHERE "Grid" = '8' | SELECT "Driver" FROM "table_58479" WHERE "Grid" = '8' | 0.051758 |
CREATE TABLE table_name_47 (crowd NUMBER, home_team VARCHAR2)
| What is the highest crowd for Home team of geelong? | SELECT MAX(crowd) FROM table_name_47 WHERE home_team = "geelong" | SELECT MAX("crowd") FROM "table_name_47" WHERE "geelong" = "home_team" | 0.068359 |
CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER)
CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
CREATE TABLE locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2)
CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER)
CREATE TABLE departments (DEPARTMENT_ID NUMBER, DEPARTMENT_NAME VARCHAR2, MANAGER_ID NUMBER, LOCATION_ID NUMBER)
CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2)
CREATE TABLE job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER)
| For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of hire_date and the sum of manager_id bin hire_date by weekday, show y axis from low to high order. | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(MANAGER_ID) | SELECT "HIRE_DATE", SUM("MANAGER_ID") FROM "employees" WHERE NOT "DEPARTMENT_ID" IN (SELECT "DEPARTMENT_ID" FROM "departments" WHERE "MANAGER_ID" <= 200 AND "MANAGER_ID" >= 100) ORDER BY SUM("MANAGER_ID") | 0.199219 |
CREATE TABLE table_name_5 (enrollment NUMBER, school VARCHAR2)
| How much Enrollment has a School of fort wayne homestead? | SELECT SUM(enrollment) FROM table_name_5 WHERE school = "fort wayne homestead" | SELECT SUM("enrollment") FROM "table_name_5" WHERE "fort wayne homestead" = "school" | 0.082031 |
CREATE TABLE table_name_79 (year NUMBER, index VARCHAR2)
| What year is the happy planet index? | SELECT SUM(year) FROM table_name_79 WHERE index = "happy planet index" | SELECT SUM("year") FROM "table_name_79" WHERE "happy planet index" = "index" | 0.074219 |
CREATE TABLE table_35495 ("Date" CLOB, "Tournament" CLOB, "Surface" CLOB, "Opponen" CLOB, "Score" CLOB)
| When did jo o souza play? | SELECT "Date" FROM table_35495 WHERE "Opponen" = 'joΓ£o souza' | SELECT "Date" FROM "table_35495" WHERE "Opponen" = 'joΓ£o souza' | 0.061523 |
CREATE TABLE table_34505 ("Rank" FLOAT, "Name" CLOB, "Headquarters" CLOB, "Industry" CLOB, "Market value ( USD million ) " FLOAT)
| What is the lowest rank of Citigroup? | SELECT MIN("Rank") FROM table_34505 WHERE "Name" = 'citigroup' | SELECT MIN("Rank") FROM "table_34505" WHERE "Name" = 'citigroup' | 0.0625 |
CREATE TABLE table_32797 ("Player" CLOB, "Tries" CLOB, "Conv" CLOB, "Pens" CLOB, "Drop" CLOB, "Venue" CLOB, "Date" CLOB)
| In which venue did 0 pens and 1 try occur? | SELECT "Venue" FROM table_32797 WHERE "Pens" = '0' AND "Tries" = '1' | SELECT "Venue" FROM "table_32797" WHERE "Pens" = '0' AND "Tries" = '1' | 0.068359 |
CREATE TABLE wine (No NUMBER, Grape CLOB, Winery CLOB, Appelation CLOB, State CLOB, Name CLOB, Year NUMBER, Price NUMBER, Score NUMBER, Cases NUMBER, Drink CLOB)
CREATE TABLE appellations (No NUMBER, Appelation CLOB, County CLOB, State CLOB, Area CLOB, isAVA CLOB)
CREATE TABLE grapes (ID NUMBER, Grape CLOB, Color CLOB)
| What are the numbers of wines for different grapes Plot them as bar chart, and I want to rank in descending by the the total number . | SELECT Grape, COUNT(*) FROM wine GROUP BY Grape ORDER BY COUNT(*) DESC | SELECT "Grape", COUNT(*) FROM "wine" GROUP BY "Grape" ORDER BY COUNT(*) DESC | 0.074219 |
CREATE TABLE fare (fare_id NUMBER, from_airport VARCHAR2, to_airport VARCHAR2, fare_basis_code CLOB, fare_airline CLOB, restriction_code CLOB, one_direction_cost NUMBER, round_trip_cost NUMBER, round_trip_required VARCHAR2)
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER)
CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB)
CREATE TABLE airport (airport_code VARCHAR2, airport_name CLOB, airport_location CLOB, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2, minimum_connect_time NUMBER)
CREATE TABLE month (month_number NUMBER, month_name CLOB)
CREATE TABLE flight (aircraft_code_sequence CLOB, airline_code VARCHAR2, airline_flight CLOB, arrival_time NUMBER, connections NUMBER, departure_time NUMBER, dual_carrier CLOB, flight_days CLOB, flight_id NUMBER, flight_number NUMBER, from_airport VARCHAR2, meal_code CLOB, stops NUMBER, time_elapsed NUMBER, to_airport VARCHAR2)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB)
CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2)
CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
CREATE TABLE code_description (code VARCHAR2, description CLOB)
CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
CREATE TABLE fare_basis (fare_basis_code CLOB, booking_class CLOB, class_type CLOB, premium CLOB, economy CLOB, discounted CLOB, night CLOB, season CLOB, basis_days CLOB)
CREATE TABLE flight_stop (flight_id NUMBER, stop_number NUMBER, stop_days CLOB, stop_airport CLOB, arrival_time NUMBER, arrival_airline CLOB, arrival_flight_number NUMBER, departure_time NUMBER, departure_airline CLOB, departure_flight_number NUMBER, stop_time NUMBER)
CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER)
CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER)
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
CREATE TABLE flight_fare (flight_id NUMBER, fare_id NUMBER)
CREATE TABLE restriction (restriction_code CLOB, advance_purchase NUMBER, stopovers CLOB, saturday_stay_required CLOB, minimum_stay NUMBER, maximum_stay NUMBER, application CLOB, no_discounts CLOB)
CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2)
CREATE TABLE aircraft (aircraft_code VARCHAR2, aircraft_description VARCHAR2, manufacturer VARCHAR2, basic_type VARCHAR2, engines NUMBER, propulsion VARCHAR2, wide_body VARCHAR2, wing_span NUMBER, length NUMBER, weight NUMBER, capacity NUMBER, pay_load NUMBER, cruising_speed NUMBER, range_miles NUMBER, pressurized VARCHAR2)
CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
| is there an airline that advertises having more flights than any other airline | SELECT DISTINCT COUNT(*), airline_code FROM flight GROUP BY airline_code | SELECT DISTINCT COUNT(*), "airline_code" FROM "flight" GROUP BY "airline_code" | 0.076172 |
CREATE TABLE Grants (organisation_id VARCHAR2, grant_amount NUMBER)
| What is the total amount of grants given by each organisations? Also list the organisation id. | SELECT SUM(grant_amount), organisation_id FROM Grants GROUP BY organisation_id | SELECT SUM("grant_amount"), "organisation_id" FROM "Grants" GROUP BY "organisation_id" | 0.083984 |
CREATE TABLE table_42375 ("Team 1" CLOB, "Agg." CLOB, "Team 2" CLOB, "1st leg" CLOB, "2nd leg" CLOB)
| Which team 1 has vfl gummersbach as team 2? | SELECT "Team 1" FROM table_42375 WHERE "Team 2" = 'vfl gummersbach' | SELECT "Team 1" FROM "table_42375" WHERE "Team 2" = 'vfl gummersbach' | 0.067383 |
CREATE TABLE table_33139 ("Grade" CLOB, "Team" CLOB, "Town" CLOB, "Time" CLOB, "Year" FLOAT)
| When was the time of 12:49:08 first set? | SELECT MIN("Year") FROM table_33139 WHERE "Time" = '12:49:08' | SELECT MIN("Year") FROM "table_33139" WHERE "Time" = '12:49:08' | 0.061523 |
CREATE TABLE table_49540 ("Date" CLOB, "H/A/N" CLOB, "Opponent" CLOB, "Score" CLOB, "Record" CLOB)
| Who were the opponents when the score of the game was 101-105 and the H/A/N was H? | SELECT "Opponent" FROM table_49540 WHERE "H/A/N" = 'h' AND "Score" = '101-105' | SELECT "Opponent" FROM "table_49540" WHERE "H/A/N" = 'h' AND "Score" = '101-105' | 0.078125 |
CREATE TABLE table_2430014_8 (title VARCHAR2, episode_no VARCHAR2)
| What is the title of episode 2? | SELECT title FROM table_2430014_8 WHERE episode_no = 2 | SELECT "title" FROM "table_2430014_8" WHERE "episode_no" = 2 | 0.058594 |
CREATE TABLE table_name_22 (home_team VARCHAR2, attendance NUMBER)
| What is the home team of the match with an attendance greater than 202? | SELECT home_team FROM table_name_22 WHERE attendance > 202 | SELECT "home_team" FROM "table_name_22" WHERE "attendance" > 202 | 0.0625 |
CREATE TABLE table_name_40 (round NUMBER, player VARCHAR2)
| Which round was Joe Taylor selected in? | SELECT SUM(round) FROM table_name_40 WHERE player = "joe taylor" | SELECT SUM("round") FROM "table_name_40" WHERE "joe taylor" = "player" | 0.068359 |
CREATE TABLE table_name_51 (name VARCHAR2, round VARCHAR2, position VARCHAR2)
| Which name had more than 5 rounds and was a defensive end? | SELECT name FROM table_name_51 WHERE round > 5 AND position = "defensive end" | SELECT "name" FROM "table_name_51" WHERE "defensive end" = "position" AND "round" > 5 | 0.083008 |
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
| calculate two year survival probability of patients who were prescribed magnesium sulfate 1 g in d5w 100ml **locked dose after having been diagnosed with valve replacement >= 7 days - mitral? | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'valve replacement >= 7 days - mitral' GROUP BY patient.uniquepid HAVING MIN(diagnosis.diagnosistime) = diagnosis.diagnosistime) AS t1) AS t2 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'magnesium sulfate 1 g in d5w 100ml **locked dose') AS t3 ON t2.uniquepid = t3.uniquepid WHERE t2.diagnosistime < t3.drugstarttime) AS t4 JOIN patient ON t4.uniquepid = patient.uniquepid | WITH "t1" AS (SELECT "patient"."uniquepid", "diagnosis"."diagnosistime" FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" WHERE "diagnosis"."diagnosisname" = 'valve replacement >= 7 days - mitral' GROUP BY "patient"."uniquepid" HAVING "diagnosis"."diagnosistime" = MIN("diagnosis"."diagnosistime")), "t3" AS (SELECT "patient"."uniquepid", "medication"."drugstarttime" FROM "medication" JOIN "patient" ON "medication"."patientunitstayid" = "patient"."patientunitstayid" WHERE "medication"."drugname" = 'magnesium sulfate 1 g in d5w 100ml **locked dose') SELECT SUM(CASE WHEN "patient"."hospitaldischargestatus" = 'alive' THEN 1 WHEN STRFTIME('%j', "patient"."hospitaldischargetime") - STRFTIME('%j', "t1"."diagnosistime") > 730 THEN 1 ELSE 0 END) * 100 / NULLIF(COUNT(*), 0) FROM "t1" "t1" JOIN "t3" "t3" ON "t1"."diagnosistime" < "t3"."drugstarttime" AND "t1"."uniquepid" = "t3"."uniquepid" JOIN "patient" ON "patient"."uniquepid" = "t1"."uniquepid" | 0.974609 |
CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER)
CREATE TABLE code_description (code VARCHAR2, description CLOB)
CREATE TABLE fare_basis (fare_basis_code CLOB, booking_class CLOB, class_type CLOB, premium CLOB, economy CLOB, discounted CLOB, night CLOB, season CLOB, basis_days CLOB)
CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2)
CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB)
CREATE TABLE month (month_number NUMBER, month_name CLOB)
CREATE TABLE flight_fare (flight_id NUMBER, fare_id NUMBER)
CREATE TABLE restriction (restriction_code CLOB, advance_purchase NUMBER, stopovers CLOB, saturday_stay_required CLOB, minimum_stay NUMBER, maximum_stay NUMBER, application CLOB, no_discounts CLOB)
CREATE TABLE airline (airline_code VARCHAR2, airline_name CLOB, note CLOB)
CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2)
CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER)
CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
CREATE TABLE flight_stop (flight_id NUMBER, stop_number NUMBER, stop_days CLOB, stop_airport CLOB, arrival_time NUMBER, arrival_airline CLOB, arrival_flight_number NUMBER, departure_time NUMBER, departure_airline CLOB, departure_flight_number NUMBER, stop_time NUMBER)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2)
CREATE TABLE flight (aircraft_code_sequence CLOB, airline_code VARCHAR2, airline_flight CLOB, arrival_time NUMBER, connections NUMBER, departure_time NUMBER, dual_carrier CLOB, flight_days CLOB, flight_id NUMBER, flight_number NUMBER, from_airport VARCHAR2, meal_code CLOB, stops NUMBER, time_elapsed NUMBER, to_airport VARCHAR2)
CREATE TABLE date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2)
CREATE TABLE state (state_code CLOB, state_name CLOB, country_name CLOB)
CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER)
CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB)
CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2)
CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER)
CREATE TABLE aircraft (aircraft_code VARCHAR2, aircraft_description VARCHAR2, manufacturer VARCHAR2, basic_type VARCHAR2, engines NUMBER, propulsion VARCHAR2, wide_body VARCHAR2, wing_span NUMBER, length NUMBER, weight NUMBER, capacity NUMBER, pay_load NUMBER, cruising_speed NUMBER, range_miles NUMBER, pressurized VARCHAR2)
CREATE TABLE fare (fare_id NUMBER, from_airport VARCHAR2, to_airport VARCHAR2, fare_basis_code CLOB, fare_airline CLOB, restriction_code CLOB, one_direction_cost NUMBER, round_trip_cost NUMBER, round_trip_required VARCHAR2)
CREATE TABLE airport (airport_code VARCHAR2, airport_name CLOB, airport_location CLOB, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2, minimum_connect_time NUMBER)
CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
| all flights from BOSTON to PHILADELPHIA which show up on tuesday afternoon | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((((flight.arrival_time < flight.departure_time) AND date_day.day_number = 22 AND date_day.month_number = 3 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code) OR (date_day.day_number = 22 AND date_day.month_number = 3 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND NOT (flight.arrival_time < flight.departure_time))) AND (flight.arrival_time <= 1800 AND flight.arrival_time >= 1200)) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code | SELECT DISTINCT "flight"."flight_id" FROM "airport_service" "AIRPORT_SERVICE_0" JOIN "date_day" ON "date_day"."day_number" = 22 AND "date_day"."month_number" = 3 AND "date_day"."year" = 1991 JOIN "city" "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'BOSTON' JOIN "days" ON "date_day"."day_name" = "days"."day_name" JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" AND "days"."days_code" = "flight"."flight_days" AND ("flight"."arrival_time" < "flight"."departure_time" OR "flight"."arrival_time" >= "flight"."departure_time") AND "flight"."arrival_time" <= 1800 AND "flight"."arrival_time" >= 1200 JOIN "airport_service" "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "city" "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'PHILADELPHIA' | 0.878906 |
CREATE TABLE table_13345 ("Township" CLOB, "County" CLOB, "Pop. ( 2010 ) " FLOAT, "Land ( sqmi ) " FLOAT, "Water ( sqmi ) " FLOAT, "Latitude" FLOAT, "Longitude" FLOAT, "GEO ID" FLOAT, "ANSI code" FLOAT)
| what is the lowest latitude for the land sqmi less than 32.696 and a water sqmi less than 0 | SELECT MIN("Latitude") FROM table_13345 WHERE "Land ( sqmi )" < '32.696' AND "Water (sqmi)" < '0' | SELECT MIN("Latitude") FROM "table_13345" WHERE "Land ( sqmi )" < '32.696' AND "Water (sqmi)" < '0' | 0.09668 |
CREATE TABLE Student (StuID NUMBER, LName VARCHAR2, Fname VARCHAR2, Age NUMBER, Sex VARCHAR2, Major NUMBER, Advisor NUMBER, city_code VARCHAR2)
CREATE TABLE Plays_Games (StuID NUMBER, GameID NUMBER, Hours_Played NUMBER)
CREATE TABLE SportsInfo (StuID NUMBER, SportName VARCHAR2, HoursPerWeek NUMBER, GamesPlayed NUMBER, OnScholarship VARCHAR2)
CREATE TABLE Video_Games (GameID NUMBER, GName VARCHAR2, GType VARCHAR2)
| What are the last names for all scholarship students, and count them by a bar chart, and rank by the y axis from low to high please. | SELECT LName, COUNT(LName) FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.OnScholarship = 'Y' GROUP BY LName ORDER BY COUNT(LName) | SELECT "LName", COUNT("LName") FROM "SportsInfo" "T1" JOIN "Student" "T2" ON "T1"."StuID" = "T2"."StuID" WHERE "T1"."OnScholarship" = 'Y' GROUP BY "LName" ORDER BY COUNT("LName") | 0.173828 |
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other)
CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER)
| Unspectacular posts by low-reputation users. | SELECT p.CreationDate, p.AnswerCount, p.Id AS "post_link" FROM Posts AS p INNER JOIN Users AS u ON p.OwnerUserId = u.Id WHERE (p.PostTypeId = 1 AND u.Reputation <= '##ReputationLimit##' AND LENGTH(p.Body) <= '##LengthLimit##' AND p.AcceptedAnswerId IS NULL AND p.ClosedDate IS NULL AND p.Score <= 0 AND 1 >= ALL (SELECT a.Score FROM Posts AS a WHERE a.ParentId = p.Id) AND p.Id NOT IN (SELECT c.PostId FROM Comments AS c WHERE c.UserId = u.Id)) ORDER BY p.CreationDate DESC | WITH "_u_0" AS (SELECT ARRAY_AGG("Score") AS "", "a"."ParentId" AS "_u_1" FROM "Posts" "a" GROUP BY "a"."ParentId"), "_u_2" AS (SELECT ARRAY_AGG("PostId") AS "", "c"."UserId" AS "_u_3" FROM "Comments" "c" GROUP BY "c"."UserId") SELECT "p"."CreationDate", "p"."AnswerCount", "p"."Id" AS "post_link" FROM "Posts" "p" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."_u_1" = "p"."Id" JOIN "Users" "u" ON "p"."OwnerUserId" = "u"."Id" AND "u"."Reputation" <= '##ReputationLimit##' LEFT JOIN "_u_2" "_u_2" ON "_u_2"."_u_3" = "u"."Id" WHERE "p"."AcceptedAnswerId" IS NULL AND "p"."ClosedDate" IS NULL AND "p"."PostTypeId" = 1 AND "p"."Score" <= 0 AND NOT ARRAY_ANY("_u_2"."", "_x" -> "p"."Id" = "_x") AND ARRAY_ALL("_u_0"."", "_x" -> "_x" = 1) AND LENGTH("p"."Body") <= '##LengthLimit##' ORDER BY "p"."CreationDate" DESC | 0.780273 |
CREATE TABLE table_name_86 (format VARCHAR2, region VARCHAR2, catalog VARCHAR2)
| What Format has the Region of Europe and a Catalog of 74321 45851 2? | SELECT format FROM table_name_86 WHERE region = "europe" AND catalog = "74321 45851 2" | SELECT "format" FROM "table_name_86" WHERE "74321 45851 2" = "catalog" AND "europe" = "region" | 0.091797 |
CREATE TABLE table_42854 ("Team" CLOB, "Match" FLOAT, "Points" FLOAT, "Draw" FLOAT, "Lost" FLOAT)
| What is the highest draw that has points greater than 4, with a match greater than 5? | SELECT MAX("Draw") FROM table_42854 WHERE "Points" > '4' AND "Match" > '5' | SELECT MAX("Draw") FROM "table_42854" WHERE "Match" > '5' AND "Points" > '4' | 0.074219 |
CREATE TABLE job_history (EMPLOYEE_ID NUMBER, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR2, DEPARTMENT_ID NUMBER)
CREATE TABLE locations (LOCATION_ID NUMBER, STREET_ADDRESS VARCHAR2, POSTAL_CODE VARCHAR2, CITY VARCHAR2, STATE_PROVINCE VARCHAR2, COUNTRY_ID VARCHAR2)
CREATE TABLE departments (DEPARTMENT_ID NUMBER, DEPARTMENT_NAME VARCHAR2, MANAGER_ID NUMBER, LOCATION_ID NUMBER)
CREATE TABLE jobs (JOB_ID VARCHAR2, JOB_TITLE VARCHAR2, MIN_SALARY NUMBER, MAX_SALARY NUMBER)
CREATE TABLE regions (REGION_ID NUMBER, REGION_NAME VARCHAR2)
CREATE TABLE countries (COUNTRY_ID VARCHAR2, COUNTRY_NAME VARCHAR2, REGION_ID NUMBER)
CREATE TABLE employees (EMPLOYEE_ID NUMBER, FIRST_NAME VARCHAR2, LAST_NAME VARCHAR2, EMAIL VARCHAR2, PHONE_NUMBER VARCHAR2, HIRE_DATE DATE, JOB_ID VARCHAR2, SALARY NUMBER, COMMISSION_PCT NUMBER, MANAGER_ID NUMBER, DEPARTMENT_ID NUMBER)
| For those employees who was hired before 2002-06-21, draw a line chart about the change of manager_id over hire_date . | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE HIRE_DATE < '2002-06-21' | SELECT "HIRE_DATE", "MANAGER_ID" FROM "employees" WHERE "HIRE_DATE" < '2002-06-21' | 0.080078 |
CREATE TABLE table_name_82 (place VARCHAR2, player VARCHAR2)
| Where is the player Davis Love III? | SELECT place FROM table_name_82 WHERE player = "davis love iii" | SELECT "place" FROM "table_name_82" WHERE "davis love iii" = "player" | 0.067383 |
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
| get number answers after time t. | SELECT QuestionPost.Id, SUM(CASE WHEN AnsweringPostWithinInterval.Id IS NULL THEN 0 ELSE 1 END) AS num_answering_after_t FROM Posts AS QuestionPost LEFT JOIN Posts AS AnsweringPostWithinInterval ON AnsweringPostWithinInterval.ParentId = QuestionPost.Id AND AnsweringPostWithinInterval.CreationDate > DATEADD(dd, 1, QuestionPost.CreationDate) AND AnsweringPostWithinInterval.ClosedDate IS NULL WHERE QuestionPost.PostTypeId = (SELECT Id FROM PostTypes WHERE Name = 'Question') AND QuestionPost.ClosedDate IS NULL AND QuestionPost.Id % 158 = 0 GROUP BY QuestionPost.Id | SELECT "QuestionPost"."Id", SUM(CASE WHEN "AnsweringPostWithinInterval"."Id" IS NULL THEN 0 ELSE 1 END) AS "num_answering_after_t" FROM "Posts" "QuestionPost" LEFT JOIN "Posts" "AnsweringPostWithinInterval" ON "AnsweringPostWithinInterval"."ClosedDate" IS NULL AND "AnsweringPostWithinInterval"."CreationDate" > DATEADD("dd", 1, "QuestionPost"."CreationDate") AND "AnsweringPostWithinInterval"."ParentId" = "QuestionPost"."Id" WHERE "QuestionPost"."ClosedDate" IS NULL AND "QuestionPost"."Id" % 158 = 0 AND "QuestionPost"."PostTypeId" = (SELECT "Id" FROM "PostTypes" WHERE "Name" = 'Question') GROUP BY "QuestionPost"."Id" | 0.607422 |
CREATE TABLE route (train_id NUMBER, station_id NUMBER)
CREATE TABLE station (id NUMBER, network_name CLOB, services CLOB, local_authority CLOB)
CREATE TABLE train (id NUMBER, train_number NUMBER, name CLOB, origin CLOB, destination CLOB, time CLOB, interval CLOB)
CREATE TABLE weekly_weather (station_id NUMBER, day_of_week CLOB, high_temperature NUMBER, low_temperature NUMBER, precipitation FLOAT, wind_speed_mph NUMBER)
| Return a histogram on what is the average high temperature for each day of week? | SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week | SELECT "day_of_week", AVG("high_temperature") FROM "weekly_weather" GROUP BY "day_of_week" | 0.087891 |
CREATE TABLE table_58227 ("Home team" CLOB, "Home team score" CLOB, "Away team" CLOB, "Away team score" CLOB, "Venue" CLOB, "Crowd" FLOAT, "Date" CLOB)
| When melbourne was the home team what was their score? | SELECT "Home team score" FROM table_58227 WHERE "Home team" = 'melbourne' | SELECT "Home team score" FROM "table_58227" WHERE "Home team" = 'melbourne' | 0.073242 |
CREATE TABLE Customers_Cards (card_id NUMBER, customer_id NUMBER, card_type_code VARCHAR2, card_number VARCHAR2, date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR2)
CREATE TABLE Accounts (account_id NUMBER, customer_id NUMBER, account_name VARCHAR2, other_account_details VARCHAR2)
CREATE TABLE Financial_Transactions (transaction_id NUMBER, previous_transaction_id NUMBER, account_id NUMBER, card_id NUMBER, transaction_type VARCHAR2, transaction_date DATETIME, transaction_amount DOUBLE PRECISION, transaction_comment VARCHAR2, other_transaction_details VARCHAR2)
CREATE TABLE Customers (customer_id NUMBER, customer_first_name VARCHAR2, customer_last_name VARCHAR2, customer_address VARCHAR2, customer_phone VARCHAR2, customer_email VARCHAR2, other_customer_details VARCHAR2)
| How many cards in different card type code? Plot a bar chart, rank by the x axis in desc. | SELECT card_type_code, COUNT(card_type_code) FROM Customers_Cards GROUP BY card_type_code ORDER BY card_type_code DESC | SELECT "card_type_code", COUNT("card_type_code") FROM "Customers_Cards" GROUP BY "card_type_code" ORDER BY "card_type_code" DESC | 0.125 |
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER)
CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER)
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
| Select Users with most combined PostHistory, Comments and Votes. | SELECT u.Id, u.Location, u.CreationDate, u.LastAccessDate, p.CreationDate, COALESCE(p.activity, 0) + COALESCE(c.activity, 0) + COALESCE(v.activity, 0) AS activity FROM Users AS u LEFT JOIN (SELECT UserId, CreationDate, COUNT(Id) AS activity FROM PostHistory GROUP BY UserId, CreationDate) AS p ON (p.UserId = u.Id) LEFT JOIN (SELECT UserId, COUNT(Id) AS activity FROM Comments GROUP BY UserId) AS c ON (c.UserId = u.Id) LEFT JOIN (SELECT UserId, COUNT(Id) AS activity FROM Votes GROUP BY UserId) AS v ON (v.UserId = u.Id) WHERE u.Id > 0 AND NOT u.Location IS NULL AND u.Location LIKE '%United States%' ORDER BY activity DESC LIMIT 500 | WITH "c" AS (SELECT "UserId", COUNT("Id") AS "activity" FROM "Comments" GROUP BY "UserId"), "p" AS (SELECT "UserId", "CreationDate", COUNT("Id") AS "activity" FROM "PostHistory" GROUP BY "UserId", "CreationDate"), "v" AS (SELECT "UserId", COUNT("Id") AS "activity" FROM "Votes" GROUP BY "UserId") SELECT "u"."Id", "u"."Location", "u"."CreationDate", "u"."LastAccessDate", "p"."CreationDate", COALESCE("p"."activity", 0) + COALESCE("c"."activity", 0) + COALESCE("v"."activity", 0) AS "activity" FROM "Users" "u" LEFT JOIN "c" "c" ON "c"."UserId" = "u"."Id" LEFT JOIN "p" "p" ON "p"."UserId" = "u"."Id" LEFT JOIN "v" "v" ON "u"."Id" = "v"."UserId" WHERE "u"."Id" > 0 AND "u"."Location" LIKE '%United States%' AND NOT "u"."Location" IS NULL ORDER BY "activity" DESC FETCH FIRST 500 ROWS ONLY | 0.769531 |
CREATE TABLE table_name_33 (result VARCHAR2, opponent VARCHAR2)
| What was the result when the new england patriots played? | SELECT result FROM table_name_33 WHERE opponent = "new england patriots" | SELECT "result" FROM "table_name_33" WHERE "new england patriots" = "opponent" | 0.076172 |
CREATE TABLE table_204_988 (id NUMBER, "responsible minister ( s ) " CLOB, "crown entities" CLOB, "monitoring department ( s ) " CLOB, "category / type" CLOB, "empowering legislation" CLOB)
| which monitoring department is listed the most ? | SELECT "monitoring department(s)" FROM table_204_988 GROUP BY "monitoring department(s)" ORDER BY COUNT(*) DESC LIMIT 1 | SELECT "monitoring department(s)" FROM "table_204_988" GROUP BY "monitoring department(s)" ORDER BY COUNT(*) DESC FETCH FIRST 1 ROWS ONLY | 0.133789 |
CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE demographic (subject_id CLOB, hadm_id CLOB, name CLOB, marital_status CLOB, age CLOB, dob CLOB, gender CLOB, language CLOB, religion CLOB, admission_type CLOB, days_stay CLOB, insurance CLOB, ethnicity CLOB, expire_flag CLOB, admission_location CLOB, discharge_location CLOB, diagnosis CLOB, dod CLOB, dob_year CLOB, dod_year CLOB, admittime CLOB, dischtime CLOB, admityear CLOB)
CREATE TABLE lab (subject_id CLOB, hadm_id CLOB, itemid CLOB, charttime CLOB, flag CLOB, value_unit CLOB, label CLOB, fluid CLOB)
CREATE TABLE prescriptions (subject_id CLOB, hadm_id CLOB, icustay_id CLOB, drug_type CLOB, drug CLOB, formulary_drug_cd CLOB, route CLOB, drug_dose CLOB)
| give me the number of patients whose age is less than 31 and item id is 50935? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "31" AND lab.itemid = "50935" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "50935" = "lab"."itemid" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "31" > "demographic"."age" | 0.181641 |
CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB)
CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME)
CREATE TABLE patient (uniquepid CLOB, patienthealthsystemstayid NUMBER, patientunitstayid NUMBER, gender CLOB, age CLOB, ethnicity CLOB, hospitalid NUMBER, wardid NUMBER, admissionheight NUMBER, admissionweight NUMBER, dischargeweight NUMBER, hospitaladmittime TIME, hospitaladmitsource CLOB, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus CLOB)
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME)
CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
| what is the minimum cost of the entire hospital that involves the phenobarbital during a year before? | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'phenobarbital')) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY cost.patienthealthsystemstayid) AS t1 | WITH "_u_0" AS (SELECT "lab"."patientunitstayid" FROM "lab" WHERE "lab"."labname" = 'phenobarbital' GROUP BY "patientunitstayid"), "_u_1" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patientunitstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patienthealthsystemstayid"), "t1" AS (SELECT SUM("cost"."cost") AS "c1" FROM "cost" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "cost"."patienthealthsystemstayid" WHERE DATETIME("cost"."chargetime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND NOT "_u_1"."" IS NULL GROUP BY "cost"."patienthealthsystemstayid") SELECT MIN("t1"."c1") FROM "t1" "t1" | 0.666016 |
CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER)
CREATE TABLE cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER)
CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB)
CREATE TABLE transfers (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, eventtype CLOB, careunit CLOB, wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE chartevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB)
CREATE TABLE d_icd_procedures (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title CLOB)
CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB)
CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB)
CREATE TABLE prescriptions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, startdate TIME, enddate TIME, drug CLOB, dose_val_rx CLOB, dose_unit_rx CLOB, route CLOB)
CREATE TABLE icustays (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, first_careunit CLOB, last_careunit CLOB, first_wardid NUMBER, last_wardid NUMBER, intime TIME, outtime TIME)
CREATE TABLE admissions (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, admittime TIME, dischtime TIME, admission_type CLOB, admission_location CLOB, discharge_location CLOB, insurance CLOB, language CLOB, marital_status CLOB, ethnicity CLOB, age NUMBER)
CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME)
CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME)
CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER)
| what was the name of the output which patient 10855 had for the first time on this month/25? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855)) AND DATETIME(outputevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') AND STRFTIME('%d', outputevents.charttime) = '25' ORDER BY outputevents.charttime LIMIT 1) | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 10855 GROUP BY "hadm_id"), "_u_1" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL GROUP BY "icustay_id"), "_u_2" AS (SELECT "outputevents"."itemid" FROM "outputevents" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "outputevents"."icustay_id" WHERE DATETIME("outputevents"."charttime", 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') AND NOT "_u_1"."" IS NULL AND STRFTIME('%d', "outputevents"."charttime") = '25' GROUP BY "itemid" ORDER BY "outputevents"."charttime" FETCH FIRST 1 ROWS ONLY) SELECT "d_items"."label" FROM "d_items" LEFT JOIN "_u_2" "_u_2" ON "_u_2"."" = "d_items"."itemid" WHERE NOT "_u_2"."" IS NULL | 0.806641 |
CREATE TABLE table_22534 ("Ethnic Group" CLOB, "2001 ( % ) " CLOB, "2001 ( people ) " CLOB, "2006 ( % ) " CLOB, "2006 ( people ) " FLOAT)
| How many numbers were recorded under 2001 when 2006 was 18.9? | SELECT COUNT("2001 (%)") FROM table_22534 WHERE "2006 (%)" = '18.9' | SELECT COUNT("2001 (%)") FROM "table_22534" WHERE "2006 (%)" = '18.9' | 0.067383 |
CREATE TABLE table_27441210_6 (year VARCHAR2, weeks_at__number1 VARCHAR2)
| How many years have a weeks at #1 value of exactly 8? | SELECT COUNT(year) FROM table_27441210_6 WHERE weeks_at__number1 = 8 | SELECT COUNT("year") FROM "table_27441210_6" WHERE "weeks_at__number1" = 8 | 0.072266 |
CREATE TABLE PostsWithDeleted (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMBER, IsUniversal BOOLEAN, InputTitle CLOB, MarkdownInputGuidance CLOB, MarkdownPostOwnerGuidance CLOB, MarkdownPrivilegedUserGuidance CLOB, MarkdownConcensusDescription CLOB, CreationDate TIME, CreationModeratorId NUMBER, ApprovalDate TIME, ApprovalModeratorId NUMBER, DeactivationDate TIME, DeactivationModeratorId NUMBER)
CREATE TABLE VoteTypes (Id NUMBER, Name CLOB)
CREATE TABLE Comments (Id NUMBER, PostId NUMBER, Score NUMBER, Text CLOB, CreationDate TIME, UserDisplayName CLOB, UserId NUMBER, ContentLicense CLOB)
CREATE TABLE ReviewTaskResultTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewTaskStates (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE ReviewTaskTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE PostHistory (Id NUMBER, PostHistoryTypeId NUMBER, PostId NUMBER, RevisionGUID other, CreationDate TIME, UserId NUMBER, UserDisplayName CLOB, Comment CLOB, Text CLOB, ContentLicense CLOB)
CREATE TABLE PendingFlags (Id NUMBER, FlagTypeId NUMBER, PostId NUMBER, CreationDate TIME, CloseReasonTypeId NUMBER, CloseAsOffTopicReasonTypeId NUMBER, DuplicateOfQuestionId NUMBER, BelongsOnBaseHostAddress CLOB)
CREATE TABLE SuggestedEditVotes (Id NUMBER, SuggestedEditId NUMBER, UserId NUMBER, VoteTypeId NUMBER, CreationDate TIME, TargetUserId NUMBER, TargetRepChange NUMBER)
CREATE TABLE Badges (Id NUMBER, UserId NUMBER, Name CLOB, Date TIME, Class NUMBER, TagBased BOOLEAN)
CREATE TABLE Users (Id NUMBER, Reputation NUMBER, CreationDate TIME, DisplayName CLOB, LastAccessDate TIME, WebsiteUrl CLOB, Location CLOB, AboutMe CLOB, Views NUMBER, UpVotes NUMBER, DownVotes NUMBER, ProfileImageUrl CLOB, EmailHash CLOB, AccountId NUMBER)
CREATE TABLE PostNotices (Id NUMBER, PostId NUMBER, PostNoticeTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body CLOB, OwnerUserId NUMBER, DeletionUserId NUMBER)
CREATE TABLE CloseReasonTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE FlagTypes (Id NUMBER, Name CLOB, Description CLOB)
CREATE TABLE Posts (Id NUMBER, PostTypeId NUMBER, AcceptedAnswerId NUMBER, ParentId NUMBER, CreationDate TIME, DeletionDate TIME, Score NUMBER, ViewCount NUMBER, Body CLOB, OwnerUserId NUMBER, OwnerDisplayName CLOB, LastEditorUserId NUMBER, LastEditorDisplayName CLOB, LastEditDate TIME, LastActivityDate TIME, Title CLOB, Tags CLOB, AnswerCount NUMBER, CommentCount NUMBER, FavoriteCount NUMBER, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense CLOB)
CREATE TABLE Tags (Id NUMBER, TagName CLOB, Count NUMBER, ExcerptPostId NUMBER, WikiPostId NUMBER)
CREATE TABLE TagSynonyms (Id NUMBER, SourceTagName CLOB, TargetTagName CLOB, CreationDate TIME, OwnerUserId NUMBER, AutoRenameCount NUMBER, LastAutoRename TIME, Score NUMBER, ApprovedByUserId NUMBER, ApprovalDate TIME)
CREATE TABLE PostTypes (Id NUMBER, Name CLOB)
CREATE TABLE Votes (Id NUMBER, PostId NUMBER, VoteTypeId NUMBER, UserId NUMBER, CreationDate TIME, BountyAmount NUMBER)
CREATE TABLE PostTags (PostId NUMBER, TagId NUMBER)
CREATE TABLE ReviewTaskResults (Id NUMBER, ReviewTaskId NUMBER, ReviewTaskResultTypeId NUMBER, CreationDate TIME, RejectionReasonId NUMBER, Comment CLOB)
CREATE TABLE PostHistoryTypes (Id NUMBER, Name CLOB)
CREATE TABLE PostFeedback (Id NUMBER, PostId NUMBER, IsAnonymous BOOLEAN, VoteTypeId NUMBER, CreationDate TIME)
CREATE TABLE PostLinks (Id NUMBER, CreationDate TIME, PostId NUMBER, RelatedPostId NUMBER, LinkTypeId NUMBER)
CREATE TABLE PostNoticeTypes (Id NUMBER, ClassId NUMBER, Name CLOB, Body CLOB, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId NUMBER)
CREATE TABLE ReviewTasks (Id NUMBER, ReviewTaskTypeId NUMBER, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMBER, PostId NUMBER, SuggestedEditId NUMBER, CompletedByReviewTaskId NUMBER)
CREATE TABLE SuggestedEdits (Id NUMBER, PostId NUMBER, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMBER, Comment CLOB, Text CLOB, Title CLOB, Tags CLOB, RevisionGUID other)
CREATE TABLE ReviewRejectionReasons (Id NUMBER, Name CLOB, Description CLOB, PostTypeId NUMBER)
| Top 100 highest profile views. | SELECT ROW_NUMBER() OVER (ORDER BY LENGTH(Location) DESC) AS Rank, Id AS "user_link", Views, Reputation, Location FROM Users WHERE Reputation > 3000 LIMIT 100 | SELECT ROW_NUMBER() OVER (ORDER BY LENGTH("Location") DESC) AS "Rank", "Id" AS "user_link", "Views", "Reputation", "Location" FROM "Users" WHERE "Reputation" > 3000 FETCH FIRST 100 ROWS ONLY | 0.185547 |
CREATE TABLE table_name_97 (opponent VARCHAR2, date VARCHAR2)
| What team was the opponent on 1990-10-21? | SELECT opponent FROM table_name_97 WHERE date = "1990-10-21" | SELECT "opponent" FROM "table_name_97" WHERE "1990-10-21" = "date" | 0.064453 |
CREATE TABLE table_22522 ("Year ( Ceremony ) " CLOB, "Actor/Actress" CLOB, "Category" CLOB, "Film title used in nomination" CLOB, "Result" CLOB)
| Who was nominated for best supporting actor in the movie Going My Way? | SELECT "Actor/Actress" FROM table_22522 WHERE "Film title used in nomination" = 'Going My Way' AND "Category" = 'Best Supporting Actor' | SELECT "Actor/Actress" FROM "table_22522" WHERE "Category" = 'Best Supporting Actor' AND "Film title used in nomination" = 'Going My Way' | 0.133789 |
CREATE TABLE table_12271718_1 (station VARCHAR2, network_affiliation VARCHAR2)
| What station has a univision network affiliation? | SELECT station FROM table_12271718_1 WHERE network_affiliation = "Univision" | SELECT "station" FROM "table_12271718_1" WHERE "Univision" = "network_affiliation" | 0.080078 |
CREATE TABLE table_56548 ("Position" FLOAT, "Club" CLOB, "Played" FLOAT, "Points" CLOB, "Wins" FLOAT, "Draws" FLOAT, "Losses" FLOAT, "Goals for" FLOAT, "Goals against" FLOAT, "Goal Difference" FLOAT)
| What is the lowest play with ue figueres club and a goal difference more than 16? | SELECT MIN("Played") FROM table_56548 WHERE "Club" = 'ue figueres' AND "Goal Difference" > '16' | SELECT MIN("Played") FROM "table_56548" WHERE "Club" = 'ue figueres' AND "Goal Difference" > '16' | 0.094727 |
CREATE TABLE table_name_44 (place NUMBER, time VARCHAR2, points VARCHAR2, machine VARCHAR2)
| Which place has points larger than 1, a bmw machine, and a time of 1:18.47.6? | SELECT MIN(place) FROM table_name_44 WHERE points > 1 AND machine = "bmw" AND time = "1:18.47.6" | SELECT MIN("place") FROM "table_name_44" WHERE "1:18.47.6" = "time" AND "bmw" = "machine" AND "points" > 1 | 0.103516 |