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_2772 ("Episode" CLOB, "Location" CLOB, "Headliner" CLOB, "Comedians" CLOB, "Airdate" CLOB)
Who were the comedians on episode 1x03?
SELECT "Comedians" FROM table_2772 WHERE "Episode" = '1x03'
SELECT "Comedians" FROM "table_2772" WHERE "Episode" = '1x03'
0.05957
CREATE TABLE table_73237 ("Type of aphasia" CLOB, "Repetition" CLOB, "Naming" CLOB, "Auditory comprehension" CLOB, "Fluency" CLOB)
Name the naming for fluent and poor comprehension
SELECT "Naming" FROM table_73237 WHERE "Fluency" = 'fluent' AND "Auditory comprehension" = 'poor'
SELECT "Naming" FROM "table_73237" WHERE "Auditory comprehension" = 'poor' AND "Fluency" = 'fluent'
0.09668
CREATE TABLE table_name_20 (wheelbase VARCHAR2, body_styles VARCHAR2)
What wheelbase has sport coupe (4p.) as the body style?
SELECT wheelbase FROM table_name_20 WHERE body_styles = "sport coupe (4p.)"
SELECT "wheelbase" FROM "table_name_20" WHERE "body_styles" = "sport coupe (4p.)"
0.079102
CREATE TABLE table_10967 ("Race" CLOB, "Circuit" CLOB, "Date" CLOB, "Pole position" CLOB, "Fastest lap" CLOB, "Winning driver" CLOB, "Constructor" CLOB, "Tyre" CLOB, "Report" CLOB)
Tell me the pole position for graham hill the fastest lap and winning driver of him on 30 may
SELECT "Pole position" FROM table_10967 WHERE "Fastest lap" = 'graham hill' AND "Winning driver" = 'graham hill' AND "Date" = '30 may'
SELECT "Pole position" FROM "table_10967" WHERE "Date" = '30 may' AND "Fastest lap" = 'graham hill' AND "Winning driver" = 'graham hill'
0.132813
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) 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 procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
count the number of patients taking drug via sc route who have been diagnosed with obstructive chronic bronchitis with acute bronchitis.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Obs chr bronc w ac bronc" AND prescriptions.route = "SC"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Obs chr bronc w ac bronc" = "diagnoses"."short_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" JOIN "prescriptions" ON "SC" = "prescriptions"."route" AND "demographic"."hadm_id" = "prescriptions"."hadm_id"
0.298828
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 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 diagnoses (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
Find the drug code for Caphosol.
SELECT prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Caphosol"
SELECT "prescriptions"."formulary_drug_cd" FROM "prescriptions" WHERE "Caphosol" = "prescriptions"."drug"
0.102539
CREATE TABLE table_69183 ("Date" CLOB, "Opponent" CLOB, "Result" CLOB, "Game Site" CLOB, "Attendance" CLOB)
What was the date of the game with 16,404 people?
SELECT "Date" FROM table_69183 WHERE "Attendance" = '16,404'
SELECT "Date" FROM "table_69183" WHERE "Attendance" = '16,404'
0.060547
CREATE TABLE table_40731 ("Outcome" CLOB, "Date" CLOB, "Tournament" CLOB, "Surface" CLOB, "Partner" CLOB, "Opponents in the final" CLOB, "Score" CLOB)
What is the Opponents from the final with a Tournament that is puebla?
SELECT "Opponents in the final" FROM table_40731 WHERE "Tournament" = 'puebla'
SELECT "Opponents in the final" FROM "table_40731" WHERE "Tournament" = 'puebla'
0.078125
CREATE TABLE table_30036 ("Semitological abbreviation" CLOB, "Hebrew name" CLOB, "Arabic name" CLOB, "Morphological category" CLOB, "Hebrew Form" CLOB, "Arabic form" CLOB, "Approximate translation" CLOB)
How many hebrew forms are there for the arabic form yuktibu ?
SELECT COUNT("Hebrew Form") FROM table_30036 WHERE "Arabic form" = 'yuktibu يكتب'
SELECT COUNT("Hebrew Form") FROM "table_30036" WHERE "Arabic form" = 'yuktibu يكتب'
0.081055
CREATE TABLE table_name_59 (surface VARCHAR2, opponent_in_the_final VARCHAR2)
What was the surface of the tournament where Anna Benzon was the opponent in the final?
SELECT surface FROM table_name_59 WHERE opponent_in_the_final = "anna benzon"
SELECT "surface" FROM "table_name_59" WHERE "anna benzon" = "opponent_in_the_final"
0.081055
CREATE TABLE accounts (account_id NUMBER, customer_id NUMBER, account_name CLOB, other_account_details CLOB) CREATE TABLE customers_cards (card_id NUMBER, customer_id NUMBER, card_type_code CLOB, card_number CLOB, date_valid_from TIME, date_valid_to TIME, other_card_details CLOB) CREATE TABLE customers (customer_id NUMBER, customer_first_name CLOB, customer_last_name CLOB, customer_address CLOB, customer_phone CLOB, customer_email CLOB, other_customer_details CLOB) CREATE TABLE financial_transactions (transaction_id NUMBER, previous_transaction_id NUMBER, account_id NUMBER, card_id NUMBER, transaction_type CLOB, transaction_date TIME, transaction_amount NUMBER, transaction_comment CLOB, other_transaction_details CLOB)
What are the ids and full names of customers who hold two or more cards?
SELECT T1.customer_id, T2.customer_first_name, T2.customer_last_name FROM customers_cards AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 2
SELECT "T1"."customer_id", "T2"."customer_first_name", "T2"."customer_last_name" FROM "customers_cards" "T1" JOIN "customers" "T2" ON "T1"."customer_id" = "T2"."customer_id" GROUP BY "T1"."customer_id" HAVING COUNT(*) >= 2
0.216797
CREATE TABLE table_11190 ("Driver" CLOB, "Constructor" CLOB, "Laps" CLOB, "Time/Retired" CLOB, "Grid" CLOB)
Which driver retired from a collision after 41 laps?
SELECT "Driver" FROM table_11190 WHERE "Time/Retired" = 'collision' AND "Laps" = '41'
SELECT "Driver" FROM "table_11190" WHERE "Laps" = '41' AND "Time/Retired" = 'collision'
0.084961
CREATE TABLE table_name_35 (award VARCHAR2, category VARCHAR2, year VARCHAR2)
What is Award, when Category is 'Best Actor', and when Year is less than 1988?
SELECT award FROM table_name_35 WHERE category = "best actor" AND year < 1988
SELECT "award" FROM "table_name_35" WHERE "best actor" = "category" AND "year" < 1988
0.083008
CREATE TABLE table_20510 ("Region of USSR" CLOB, "Number of families" FLOAT, "Number of people" FLOAT, "Average family size" CLOB, "% of total deportees" CLOB)
What is the most number of families among regions where the population is made up of 5.8% deportees?
SELECT MAX("Number of families") FROM table_20510 WHERE "% of total deportees" = '5.8'
SELECT MAX("Number of families") FROM "table_20510" WHERE "% of total deportees" = '5.8'
0.085938
CREATE TABLE event (ID NUMBER, Name CLOB, Stadium_ID NUMBER, Year CLOB) CREATE TABLE stadium (ID NUMBER, name CLOB, Capacity NUMBER, City CLOB, Country CLOB, Opening_year NUMBER) CREATE TABLE swimmer (ID NUMBER, name CLOB, Nationality CLOB, meter_100 FLOAT, meter_200 CLOB, meter_300 CLOB, meter_400 CLOB, meter_500 CLOB, meter_600 CLOB, meter_700 CLOB, Time CLOB) CREATE TABLE record (ID NUMBER, Result CLOB, Swimmer_ID NUMBER, Event_ID NUMBER)
A bar chart shows the distribution of meter_400 and ID .
SELECT meter_400, ID FROM swimmer
SELECT "meter_400", "ID" FROM "swimmer"
0.038086
CREATE TABLE table_43143 ("Date" CLOB, "Time" CLOB, "Home" CLOB, "Away" CLOB, "Score" CLOB, "Ground" CLOB)
What was the date for the 130-56 game?
SELECT "Date" FROM table_43143 WHERE "Score" = '130-56'
SELECT "Date" FROM "table_43143" WHERE "Score" = '130-56'
0.055664
CREATE TABLE table_40107 ("Championship" CLOB, "Current champion ( s ) " CLOB, "Previous champion ( s ) " CLOB, "Date won" CLOB, "Location" CLOB)
Which location held the Iron 8 Championship tournament?
SELECT "Location" FROM table_40107 WHERE "Championship" = 'iron 8 championship tournament'
SELECT "Location" FROM "table_40107" WHERE "Championship" = 'iron 8 championship tournament'
0.089844
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) CREATE TABLE diagnoses (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 procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
how many patients whose primary disease is syncope;telemetry and admission year is less than 2137?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SYNCOPE;TELEMETRY" AND demographic.admityear < "2137"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "2137" > "demographic"."admityear" AND "SYNCOPE;TELEMETRY" = "demographic"."diagnosis"
0.157227
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 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 airline (airline_code VARCHAR2, airline_name CLOB, note 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 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 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 ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER) CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER) 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 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 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 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 class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB) CREATE TABLE code_description (code VARCHAR2, description CLOB) CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time NUMBER) CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2) CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2) CREATE TABLE dual_carrier (main_airline VARCHAR2, low_flight_number NUMBER, high_flight_number NUMBER, dual_airline VARCHAR2, service_name CLOB) CREATE TABLE flight_fare (flight_id NUMBER, fare_id NUMBER) CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2)
i'd like a flight from SAN DIEGO to TORONTO on AS leaving around 1pm
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 (((flight.departure_time <= 1330 AND flight.departure_time >= 1230) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TORONTO' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN DIEGO' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.airline_code = 'AS'
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 DIEGO' JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" AND "flight"."airline_code" = 'AS' AND "flight"."departure_time" <= 1330 AND "flight"."departure_time" >= 1230 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" = 'TORONTO'
0.592773
CREATE TABLE table_name_82 (song_choice VARCHAR2, theme VARCHAR2, week__number VARCHAR2)
When the week # is listed as Hollywood, and the Theme is N/A, what song is listed?
SELECT song_choice FROM table_name_82 WHERE theme = "n/a" AND week__number = "hollywood"
SELECT "song_choice" FROM "table_name_82" WHERE "hollywood" = "week__number" AND "n/a" = "theme"
0.09375
CREATE TABLE table_name_3 (second_member VARCHAR2, first_member VARCHAR2, second_party VARCHAR2)
Who is the second member with first member Sir Rowland Hill, BT, and a conservative second party?
SELECT second_member FROM table_name_3 WHERE first_member = "sir rowland hill, bt" AND second_party = "conservative"
SELECT "second_member" FROM "table_name_3" WHERE "conservative" = "second_party" AND "first_member" = "sir rowland hill, bt"
0.121094
CREATE TABLE game (stadium_id NUMBER, id NUMBER, Season NUMBER, Date CLOB, Home_team CLOB, Away_team CLOB, Score CLOB, Competition CLOB) CREATE TABLE injury_accident (game_id NUMBER, id NUMBER, Player CLOB, Injury CLOB, Number_of_matches CLOB, Source CLOB) CREATE TABLE stadium (id NUMBER, name CLOB, Home_Games NUMBER, Average_Attendance FLOAT, Total_Attendance FLOAT, Capacity_Percentage FLOAT)
Show me how many home team by home team in a histogram
SELECT Home_team, COUNT(Home_team) FROM game GROUP BY Home_team
SELECT "Home_team", COUNT("Home_team") FROM "game" GROUP BY "Home_team"
0.069336
CREATE TABLE table_204_915 (id NUMBER, "draw" NUMBER, "artist" CLOB, "song" CLOB, "points" NUMBER, "place" CLOB)
what is the total of points on the chart
SELECT SUM("points") FROM table_204_915
SELECT SUM("points") FROM "table_204_915"
0.040039
CREATE TABLE table_52168 ("Name" CLOB, "League" FLOAT, "FA Cup" FLOAT, "League Cup" FLOAT, "Total" FLOAT)
What is the smallest value for League Cup when the League number is greater than 1, no FA Cups, and Brian Deane scoring?
SELECT MIN("League Cup") FROM table_52168 WHERE "League" > '1' AND "Name" = 'brian deane' AND "FA Cup" < '1'
SELECT MIN("League Cup") FROM "table_52168" WHERE "FA Cup" < '1' AND "League" > '1' AND "Name" = 'brian deane'
0.107422
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 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 procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
Tell me the discharge location and the number of days for which patient Elizabeth Bateman was hospitalized.
SELECT demographic.days_stay, demographic.discharge_location FROM demographic WHERE demographic.name = "Elizabeth Bateman"
SELECT "demographic"."days_stay", "demographic"."discharge_location" FROM "demographic" WHERE "Elizabeth Bateman" = "demographic"."name"
0.132813
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) CREATE TABLE diagnoses (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 procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
what is the procedure short title of procedure icd9 code 598?
SELECT procedures.short_title FROM procedures WHERE procedures.icd9_code = "598"
SELECT "procedures"."short_title" FROM "procedures" WHERE "598" = "procedures"."icd9_code"
0.087891
CREATE TABLE table_name_96 (siena_2002 VARCHAR2, president VARCHAR2)
what is siena 2002 when the president is andrew jackson?
SELECT siena_2002 FROM table_name_96 WHERE president = "andrew jackson"
SELECT "siena_2002" FROM "table_name_96" WHERE "andrew jackson" = "president"
0.075195
CREATE TABLE table_name_21 (away_team VARCHAR2, home_team VARCHAR2)
What is the score of the away team who played home team Hawthorn?
SELECT away_team AS score FROM table_name_21 WHERE home_team = "hawthorn"
SELECT "away_team" AS "score" FROM "table_name_21" WHERE "hawthorn" = "home_team"
0.079102
CREATE TABLE table_name_63 (week NUMBER, attendance VARCHAR2)
What was the latest week of a game that had an attendance of 63,001?
SELECT MAX(week) FROM table_name_63 WHERE attendance = "63,001"
SELECT MAX("week") FROM "table_name_63" WHERE "63,001" = "attendance"
0.067383
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 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 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)
provide the number of patients whose admission year is less than 2200 and diagnoses icd9 code is e8791?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2200" AND diagnoses.icd9_code = "E8791"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "E8791" = "diagnoses"."icd9_code" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "2200" > "demographic"."admityear"
0.209961
CREATE TABLE jobs (job_id CLOB, job_title CLOB, min_salary NUMBER, max_salary NUMBER) CREATE TABLE regions (region_id NUMBER, region_name CLOB) CREATE TABLE locations (location_id NUMBER, street_address CLOB, postal_code CLOB, city CLOB, state_province CLOB, country_id CLOB) CREATE TABLE employees (employee_id NUMBER, first_name CLOB, last_name CLOB, email CLOB, phone_number CLOB, hire_date TIME, job_id CLOB, salary NUMBER, commission_pct NUMBER, manager_id NUMBER, department_id NUMBER) CREATE TABLE job_history (employee_id NUMBER, start_date TIME, end_date TIME, job_id CLOB, department_id NUMBER) CREATE TABLE countries (country_id CLOB, country_name CLOB, region_id NUMBER) CREATE TABLE departments (department_id NUMBER, department_name CLOB, manager_id NUMBER, location_id NUMBER)
display job title and average salary of employees.
SELECT job_title, AVG(salary) FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id GROUP BY T2.job_title
SELECT "job_title", AVG("salary") FROM "employees" "T1" JOIN "jobs" "T2" ON "T1"."job_id" = "T2"."job_id" GROUP BY "T2"."job_title"
0.12793
CREATE TABLE shop (shop_id NUMBER, shop_name CLOB, location CLOB, open_date CLOB, open_year NUMBER) CREATE TABLE device (device_id NUMBER, device CLOB, carrier CLOB, package_version CLOB, applications CLOB, software_platform CLOB) CREATE TABLE stock (shop_id NUMBER, device_id NUMBER, quantity NUMBER)
What are the carriers of devices that are not in stock anywhere?
SELECT carrier FROM device WHERE NOT device_id IN (SELECT device_id FROM stock)
SELECT "carrier" FROM "device" WHERE NOT "device_id" IN (SELECT "device_id" FROM "stock")
0.086914
CREATE TABLE table_name_67 (bronze NUMBER, gold VARCHAR2, silver VARCHAR2)
What is the total amount of bronze medals a team with 1 gold and more than 3 silver medals has?
SELECT SUM(bronze) FROM table_name_67 WHERE gold = 1 AND silver > 3
SELECT SUM("bronze") FROM "table_name_67" WHERE "gold" = 1 AND "silver" > 3
0.073242
CREATE TABLE table_58813 ("Tie no" CLOB, "Home team" CLOB, "Score" CLOB, "Away team" CLOB, "Date" CLOB)
What was the score when the Tie no was 9?
SELECT "Score" FROM table_58813 WHERE "Tie no" = '9'
SELECT "Score" FROM "table_58813" WHERE "Tie no" = '9'
0.052734
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 procedures (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) CREATE TABLE diagnoses (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)
what is diagnoses short title and drug route of subject id 2560?
SELECT diagnoses.short_title, prescriptions.route FROM diagnoses INNER JOIN prescriptions ON diagnoses.hadm_id = prescriptions.hadm_id WHERE diagnoses.subject_id = "2560"
SELECT "diagnoses"."short_title", "prescriptions"."route" FROM "diagnoses" JOIN "prescriptions" ON "diagnoses"."hadm_id" = "prescriptions"."hadm_id" WHERE "2560" = "diagnoses"."subject_id"
0.183594
CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME) CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime 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 vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME) CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME)
did patient 015-910 undergone a external fixation device procedure in 2105?
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-910')) AND treatment.treatmentname = 'external fixation device' AND STRFTIME('%y', treatment.treatmenttime) = '2105'
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '015-910' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT COUNT(*) > 0 FROM "treatment" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "treatment"."patientunitstayid" WHERE "treatment"."treatmentname" = 'external fixation device' AND NOT "_u_1"."" IS NULL AND STRFTIME('%y', "treatment"."treatmenttime") = '2105'
0.591797
CREATE TABLE tourist_attractions (tourist_attraction_id NUMBER, attraction_type_code CLOB, location_id NUMBER, how_to_get_there CLOB, name CLOB, description CLOB, opening_hours CLOB, other_details CLOB) CREATE TABLE photos (photo_id NUMBER, tourist_attraction_id NUMBER, name CLOB, description CLOB, filename CLOB, other_details CLOB) CREATE TABLE royal_family (royal_family_id NUMBER, royal_family_details CLOB) CREATE TABLE hotels (hotel_id NUMBER, star_rating_code CLOB, pets_allowed_yn CLOB, price_range NUMBER, other_hotel_details CLOB) CREATE TABLE street_markets (market_id NUMBER, market_details CLOB) CREATE TABLE ref_attraction_types (attraction_type_code CLOB, attraction_type_description CLOB) CREATE TABLE locations (location_id NUMBER, location_name CLOB, address CLOB, other_details CLOB) CREATE TABLE museums (museum_id NUMBER, museum_details CLOB) CREATE TABLE shops (shop_id NUMBER, shop_details CLOB) CREATE TABLE staff (staff_id NUMBER, tourist_attraction_id NUMBER, name CLOB, other_details CLOB) CREATE TABLE theme_parks (theme_park_id NUMBER, theme_park_details CLOB) CREATE TABLE tourist_attraction_features (tourist_attraction_id NUMBER, feature_id NUMBER) CREATE TABLE visits (visit_id NUMBER, tourist_attraction_id NUMBER, tourist_id NUMBER, visit_date TIME, visit_details CLOB) CREATE TABLE features (feature_id NUMBER, feature_details CLOB) CREATE TABLE visitors (tourist_id NUMBER, tourist_details CLOB) CREATE TABLE ref_hotel_star_ratings (star_rating_code CLOB, star_rating_description CLOB)
Tell me the name of the staff in charge of the attraction called 'US museum'.
SELECT T1.name FROM staff AS T1 JOIN tourist_attractions AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id WHERE T2.name = "US museum"
SELECT "T1"."name" FROM "staff" "T1" JOIN "tourist_attractions" "T2" ON "T1"."tourist_attraction_id" = "T2"."tourist_attraction_id" AND "T2"."name" = "US museum"
0.157227
CREATE TABLE table_name_93 (venue VARCHAR2, year VARCHAR2, competition VARCHAR2, event VARCHAR2)
what is the venue when the competition is asian games, the event is 4x400 m relay and the year is 2002?
SELECT venue FROM table_name_93 WHERE competition = "asian games" AND event = "4x400 m relay" AND year = 2002
SELECT "venue" FROM "table_name_93" WHERE "4x400 m relay" = "event" AND "asian games" = "competition" AND "year" = 2002
0.116211
CREATE TABLE table_name_91 (finish VARCHAR2, year VARCHAR2, chassis VARCHAR2, start VARCHAR2)
What did the Dallara chassis with a 5 start in 2006 finish?
SELECT finish FROM table_name_91 WHERE chassis = "dallara" AND start = "5" AND year = 2006
SELECT "finish" FROM "table_name_91" WHERE "5" = "start" AND "chassis" = "dallara" AND "year" = 2006
0.097656
CREATE TABLE table_name_16 (game NUMBER, opponent VARCHAR2, points VARCHAR2)
What's the highest game against the New York Rangers with more than 55 points?
SELECT MAX(game) FROM table_name_16 WHERE opponent = "new york rangers" AND points > 55
SELECT MAX("game") FROM "table_name_16" WHERE "new york rangers" = "opponent" AND "points" > 55
0.092773
CREATE TABLE table_name_81 (event VARCHAR2, competition VARCHAR2)
Which event was part of the World Cross Country championships?
SELECT event FROM table_name_81 WHERE competition = "world cross country championships"
SELECT "event" FROM "table_name_81" WHERE "competition" = "world cross country championships"
0.09082
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 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 code_description (code VARCHAR2, description CLOB) 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 compartment_class (compartment VARCHAR2, class_type VARCHAR2) 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 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 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 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_fare (flight_id NUMBER, fare_id NUMBER) CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight 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 airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant NUMBER) CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2) CREATE TABLE food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description 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 city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2) CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB) 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)
what flights go from PITTSBURGH to NEWARK after 823 in the morning
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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEWARK' AND flight.departure_time > 823 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' 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" = 'PITTSBURGH' JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" AND "flight"."departure_time" > 823 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" = 'NEWARK'
0.519531
CREATE TABLE table_name_99 (wins NUMBER, top_5 VARCHAR2, top_10 VARCHAR2)
What is the average win with a top 5 greater than 2 and a top 10 less than 5?
SELECT AVG(wins) FROM table_name_99 WHERE top_5 > 2 AND top_10 < 5
SELECT AVG("wins") FROM "table_name_99" WHERE "top_10" < 5 AND "top_5" > 2
0.072266
CREATE TABLE table_26860595_2 (texture___gt__s_ VARCHAR2, tdp__watts__gpu_only VARCHAR2)
How many texture (gt/s) the card has if the tdp (watts) GPU only is 18?
SELECT COUNT(texture___gt__s_) FROM table_26860595_2 WHERE tdp__watts__gpu_only = "18"
SELECT COUNT("texture___gt__s_") FROM "table_26860595_2" WHERE "18" = "tdp__watts__gpu_only"
0.089844
CREATE TABLE table_name_90 (director VARCHAR2, primary_language_s_ VARCHAR2, original_title VARCHAR2)
What is Director, when Primary Language(s) is 'Azerbaijani', and when Original Title is 'Buta'?
SELECT director FROM table_name_90 WHERE primary_language_s_ = "azerbaijani" AND original_title = "buta"
SELECT "director" FROM "table_name_90" WHERE "azerbaijani" = "primary_language_s_" AND "buta" = "original_title"
0.109375
CREATE TABLE table_506 ("Institution" CLOB, "Main Campus Location" CLOB, "Founded" FLOAT, "Mascot" CLOB, "School Colors" CLOB)
What is the mascot for the instition of Kansas city Kansas community college?
SELECT "Mascot" FROM table_506 WHERE "Institution" = 'Kansas City Kansas Community College'
SELECT "Mascot" FROM "table_506" WHERE "Institution" = 'Kansas City Kansas Community College'
0.09082
CREATE TABLE table_name_42 (record VARCHAR2, date VARCHAR2, time__seconds_ VARCHAR2)
What is the Record for 23 january 2010, with a time smaller than 42.679 seconds?
SELECT record FROM table_name_42 WHERE date = "23 january 2010" AND time__seconds_ < 42.679
SELECT "record" FROM "table_name_42" WHERE "23 january 2010" = "date" AND "time__seconds_" < 42.679
0.09668
CREATE TABLE table_name_73 (points NUMBER, chassis VARCHAR2, year VARCHAR2)
What point is the lowest for listings of chassis labeled AGS JH23 before 1988?
SELECT MIN(points) FROM table_name_73 WHERE chassis = "ags jh23" AND year < 1988
SELECT MIN("points") FROM "table_name_73" WHERE "ags jh23" = "chassis" AND "year" < 1988
0.085938
CREATE TABLE table_17156199_1 (year__ceremony_ VARCHAR2, original_title VARCHAR2)
How many years was the original title was (swopnodanay)?
SELECT COUNT(year__ceremony_) FROM table_17156199_1 WHERE original_title = "স্বপ্নডানায় (Swopnodanay)"
SELECT COUNT("year__ceremony_") FROM "table_17156199_1" WHERE "original_title" = "স্বপ্নডানায় (Swopnodanay)"
0.106445
CREATE TABLE table_name_79 (college VARCHAR2, player VARCHAR2)
What college had Jim Leonhard Category:articles with hcards?
SELECT college FROM table_name_79 WHERE player = "jim leonhard category:articles with hcards"
SELECT "college" FROM "table_name_79" WHERE "jim leonhard category:articles with hcards" = "player"
0.09668
CREATE TABLE table_name_22 (sideline_reporter_s_ VARCHAR2, year VARCHAR2, network VARCHAR2, play_by_play VARCHAR2)
Who are the sideline reporter(s) on NBC with al michaels on the play-by-play after 2013?
SELECT sideline_reporter_s_ FROM table_name_22 WHERE network = "nbc" AND play_by_play = "al michaels" AND year > 2013
SELECT "sideline_reporter_s_" FROM "table_name_22" WHERE "al michaels" = "play_by_play" AND "nbc" = "network" AND "year" > 2013
0.124023
CREATE TABLE table_57381 ("Driver" CLOB, "Constructor" CLOB, "Laps" FLOAT, "Time/Retired" CLOB, "Grid" FLOAT)
What number of laps were done by driver Ronnie Peterson?
SELECT "Laps" FROM table_57381 WHERE "Driver" = 'ronnie peterson'
SELECT "Laps" FROM "table_57381" WHERE "Driver" = 'ronnie peterson'
0.06543
CREATE TABLE table_38929 ("Outcome" CLOB, "Date" CLOB, "Tournament" CLOB, "Surface" CLOB, "Partner" CLOB, "Opponents in the final" CLOB, "Score in the final" CLOB)
Which Tournament has a Partner of mart n rodr guez?
SELECT "Tournament" FROM table_38929 WHERE "Partner" = 'martín rodríguez'
SELECT "Tournament" FROM "table_38929" WHERE "Partner" = 'martín rodríguez'
0.073242
CREATE TABLE table_name_31 (points_classification VARCHAR2, stage VARCHAR2)
Name the points classification of stage 16
SELECT points_classification FROM table_name_31 WHERE stage = "16"
SELECT "points_classification" FROM "table_name_31" WHERE "16" = "stage"
0.070313
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 ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2) CREATE TABLE semester (semester_id NUMBER, semester VARCHAR2, year NUMBER) CREATE TABLE jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER) CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college VARCHAR2) CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER) CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2) CREATE TABLE program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2) CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER) 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 program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req VARCHAR2) 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 area (course_id NUMBER, area VARCHAR2) CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER) 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 instructor (instructor_id NUMBER, name VARCHAR2, uniqname 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 program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction VARCHAR2)
Was MUSED 371 ever offered in the Spring ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MUSED' AND course.number = 371 AND semester.semester = 'Spring' AND semester.semester_id = course_offering.semester
SELECT COUNT(*) > 0 FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" JOIN "semester" ON "course_offering"."semester" = "semester"."semester_id" AND "semester"."semester" = 'Spring' WHERE "course"."department" = 'MUSED' AND "course"."number" = 371
0.283203
CREATE TABLE table_name_16 (builder VARCHAR2, pennant VARCHAR2)
What is the building for the r90 pennant?
SELECT builder FROM table_name_16 WHERE pennant = "r90"
SELECT "builder" FROM "table_name_16" WHERE "pennant" = "r90"
0.05957
CREATE TABLE table_6323 ("Year" FLOAT, "Chassis" CLOB, "Engine" CLOB, "Start" CLOB, "Finish" CLOB, "Team" CLOB)
What is shown for Chassis for the year of 2007?
SELECT "Chassis" FROM table_6323 WHERE "Year" = '2007'
SELECT "Chassis" FROM "table_6323" WHERE "Year" = '2007'
0.054688
CREATE TABLE table_75448 ("Celebrity" CLOB, "Famous for" CLOB, "Entered" CLOB, "Exited" CLOB, "Finished" CLOB)
What celebrity is famous for being an actor?
SELECT "Celebrity" FROM table_75448 WHERE "Famous for" = 'actor'
SELECT "Celebrity" FROM "table_75448" WHERE "Famous for" = 'actor'
0.064453
CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare NUMBER) CREATE TABLE code_description (code VARCHAR2, description CLOB) 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 equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2) CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_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 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 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 days (days_code VARCHAR2, day_name VARCHAR2) CREATE TABLE compartment_class (compartment VARCHAR2, class_type 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 airline (airline_code VARCHAR2, airline_name CLOB, note 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) CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_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 date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2) CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt NUMBER) CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant 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 state (state_code CLOB, state_name CLOB, country_name CLOB) CREATE TABLE month (month_number NUMBER, month_name CLOB)
is there a flight from DENVER to SAN FRANCISCO on CO leaving after 1200 o'clock in the 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, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time > 1200 AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code) AND flight.airline_code = 'CO'
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" = 'DENVER' JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" AND "flight"."airline_code" = 'CO' AND "flight"."departure_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" = 'SAN FRANCISCO'
0.557617
CREATE TABLE university (School_ID NUMBER, School CLOB, Location CLOB, Founded FLOAT, Affiliation CLOB, Enrollment FLOAT, Nickname CLOB, Primary_conference CLOB) CREATE TABLE basketball_match (Team_ID NUMBER, School_ID NUMBER, Team_Name CLOB, ACC_Regular_Season CLOB, ACC_Percent CLOB, ACC_Home CLOB, ACC_Road CLOB, All_Games CLOB, All_Games_Percent NUMBER, All_Home CLOB, All_Road CLOB, All_Neutral CLOB)
Draw a pie chart about the proportion of Team_Name and ACC_Percent.
SELECT Team_Name, ACC_Percent FROM basketball_match
SELECT "Team_Name", "ACC_Percent" FROM "basketball_match"
0.055664
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 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 airline (airline_code VARCHAR2, airline_name CLOB, note CLOB) CREATE TABLE flight_fare (flight_id NUMBER, fare_id NUMBER) CREATE TABLE state (state_code CLOB, state_name CLOB, country_name 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) CREATE TABLE compartment_class (compartment VARCHAR2, class_type VARCHAR2) CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2) 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 food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2) CREATE TABLE class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB) CREATE TABLE airport_service (city_code VARCHAR2, airport_code VARCHAR2, miles_distant NUMBER, direction VARCHAR2, minutes_distant 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 date_day (month_number NUMBER, day_number NUMBER, year NUMBER, day_name VARCHAR2) CREATE TABLE time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt 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 equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_code VARCHAR2) CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER) CREATE TABLE city (city_code VARCHAR2, city_name VARCHAR2, state_code VARCHAR2, country_name VARCHAR2, time_zone_code VARCHAR2) 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)
how far is OAK airport from downtown
SELECT DISTINCT AIRPORT_SERVICE_0.miles_distant FROM airport, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city WHERE AIRPORT_SERVICE_0.airport_code = 'OAK' AND airport.airport_code = 'OAK' AND airport.airport_code = AIRPORT_SERVICE_1.airport_code AND city.city_code = AIRPORT_SERVICE_0.city_code AND city.city_code = AIRPORT_SERVICE_1.city_code
SELECT DISTINCT "AIRPORT_SERVICE_0"."miles_distant" FROM "airport" JOIN "airport_service" "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "airport"."airport_code" JOIN "city" ON "AIRPORT_SERVICE_1"."city_code" = "city"."city_code" JOIN "airport_service" "AIRPORT_SERVICE_0" ON "AIRPORT_SERVICE_0"."airport_code" = 'OAK' AND "AIRPORT_SERVICE_0"."city_code" = "city"."city_code" WHERE "airport"."airport_code" = 'OAK'
0.416992
CREATE TABLE table_7185 ("Date" CLOB, "Opponent" CLOB, "Venue" CLOB, "Result" CLOB, "Attendance" FLOAT)
What is the Venue with an Attendance that is larger than 6,938?
SELECT "Venue" FROM table_7185 WHERE "Attendance" > '6,938'
SELECT "Venue" FROM "table_7185" WHERE "Attendance" > '6,938'
0.05957
CREATE TABLE table_65191 ("Rank" FLOAT, "Athlete" CLOB, "Country" CLOB, "Time" CLOB, "Notes" CLOB)
Which Rank has Notes of fb, and a Time of 5:57.31?
SELECT "Rank" FROM table_65191 WHERE "Notes" = 'fb' AND "Time" = '5:57.31'
SELECT "Rank" FROM "table_65191" WHERE "Notes" = 'fb' AND "Time" = '5:57.31'
0.074219
CREATE TABLE comment_instructor (instructor_id NUMBER, student_id NUMBER, score NUMBER, comment_text VARCHAR2) CREATE TABLE course_prerequisite (pre_course_id NUMBER, course_id NUMBER) 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 ta (campus_job_id NUMBER, student_id NUMBER, location VARCHAR2) CREATE TABLE area (course_id NUMBER, area 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 jobs (job_id NUMBER, job_title VARCHAR2, description VARCHAR2, requirement VARCHAR2, city VARCHAR2, state VARCHAR2, country VARCHAR2, zip NUMBER) CREATE TABLE requirement (requirement_id NUMBER, requirement VARCHAR2, college 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 program_requirement (program_id NUMBER, category VARCHAR2, min_credit NUMBER, additional_req 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 semester (semester_id NUMBER, semester VARCHAR2, year NUMBER) CREATE TABLE program (program_id NUMBER, name VARCHAR2, college VARCHAR2, introduction 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 program_course (program_id NUMBER, course_id NUMBER, workload NUMBER, category VARCHAR2) CREATE TABLE offering_instructor (offering_instructor_id NUMBER, offering_id NUMBER, instructor_id NUMBER) CREATE TABLE instructor (instructor_id NUMBER, name VARCHAR2, uniqname VARCHAR2) CREATE TABLE gsi (course_offering_id NUMBER, student_id NUMBER)
Are there any courses that are worth 6 credits ?
SELECT DISTINCT name, number FROM course WHERE credits = 6 AND department = 'EECS'
SELECT DISTINCT "name", "number" FROM "course" WHERE "credits" = 6 AND "department" = 'EECS'
0.089844
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 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)
provide the number of patients whose death status is 1 and drug name is hydrocortisone oint 0.5%?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.drug = "Hydrocortisone Oint 0.5%"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "Hydrocortisone Oint 0.5%" = "prescriptions"."drug" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "1" = "demographic"."expire_flag"
0.234375
CREATE TABLE table_name_71 (constructor VARCHAR2, circuit VARCHAR2)
Who is the constructor whose circuit was Oulton Park?
SELECT constructor FROM table_name_71 WHERE circuit = "oulton park"
SELECT "constructor" FROM "table_name_71" WHERE "circuit" = "oulton park"
0.071289
CREATE TABLE table_9406 ("Country" CLOB, "Date" CLOB, "Label" CLOB, "Format" CLOB, "Catalog" CLOB)
Which Catalog has a Country of Japan?
SELECT "Catalog" FROM table_9406 WHERE "Country" = 'japan'
SELECT "Catalog" FROM "table_9406" WHERE "Country" = 'japan'
0.058594
CREATE TABLE table_16576 ("Club" CLOB, "Position in 2012\\u201313" CLOB, "First season in top division" CLOB, "Number of seasons in top division" FLOAT, "Number of seasons in the Premier League" FLOAT, "First season of current spell in top division" CLOB, "Top division titles" FLOAT, "Last top division title" CLOB)
What is the least number of seasons in top division?
SELECT MIN("Number of seasons in top division") FROM table_16576
SELECT MIN("Number of seasons in top division") FROM "table_16576"
0.064453
CREATE TABLE event (ID NUMBER, Name CLOB, Stadium_ID NUMBER, Year CLOB) CREATE TABLE swimmer (ID NUMBER, name CLOB, Nationality CLOB, meter_100 FLOAT, meter_200 CLOB, meter_300 CLOB, meter_400 CLOB, meter_500 CLOB, meter_600 CLOB, meter_700 CLOB, Time CLOB) CREATE TABLE stadium (ID NUMBER, name CLOB, Capacity NUMBER, City CLOB, Country CLOB, Opening_year NUMBER) CREATE TABLE record (ID NUMBER, Result CLOB, Swimmer_ID NUMBER, Event_ID NUMBER)
Give me the comparison about the amount of Nationality over the Nationality , and group by attribute Nationality, and show in ascending by the X-axis.
SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY Nationality
SELECT "Nationality", COUNT("Nationality") FROM "swimmer" GROUP BY "Nationality" ORDER BY "Nationality"
0.100586
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 microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name CLOB) CREATE TABLE outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value NUMBER) 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 inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER) CREATE TABLE d_labitems (row_id NUMBER, itemid NUMBER, label CLOB) CREATE TABLE d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto 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 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 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 cost (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, event_type CLOB, event_id NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title 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)
what's the number of times heparin flush picc (100 units/ml) was prescribed until 2104?
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'heparin flush picc (100 units/ml)' AND STRFTIME('%y', prescriptions.startdate) <= '2104'
SELECT COUNT(*) FROM "prescriptions" WHERE "prescriptions"."drug" = 'heparin flush picc (100 units/ml)' AND STRFTIME('%y', "prescriptions"."startdate") <= '2104'
0.157227
CREATE TABLE table_3064 ("Week" FLOAT, "Date" CLOB, "Kickoff" CLOB, "Opponent" CLOB, "Final score" CLOB, "Team record" CLOB, "Game site" CLOB, "Attendance" FLOAT)
What was the Rhein Fire team record on week 8?
SELECT "Team record" FROM table_3064 WHERE "Week" = '8'
SELECT "Team record" FROM "table_3064" WHERE "Week" = '8'
0.055664
CREATE TABLE table_32103 ("Title" CLOB, "Japan" CLOB, "North America" CLOB, "Europe" CLOB, "Australia" CLOB)
Tell me north america for january 23, 2013
SELECT "North America" FROM table_32103 WHERE "Japan" = 'january 23, 2013'
SELECT "North America" FROM "table_32103" WHERE "Japan" = 'january 23, 2013'
0.074219
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)
Give the neames of wines with prices below 50 and with appelations in Monterey county, and count them by a bar chart, sort X from low to high order.
SELECT Name, COUNT(Name) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.Price < 50 GROUP BY Name ORDER BY Name
SELECT "Name", COUNT("Name") FROM "appellations" "T1" JOIN "wine" "T2" ON "T1"."Appelation" = "T2"."Appelation" AND "T2"."Price" < 50 WHERE "Monterey" = "T1"."County" GROUP BY "Name" ORDER BY "Name"
0.193359
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) CREATE TABLE diagnoses (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 procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
calculate the total number of unmarried male patients.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.gender = "M"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "M" = "demographic"."gender" AND "SINGLE" = "demographic"."marital_status"
0.145508
CREATE TABLE table_7219 ("Date" CLOB, "Tournament" CLOB, "Winning score" CLOB, "Margin of victory" CLOB, "Runner ( s ) -up" CLOB)
For the tournament played on 16 Jan 2011, what was the winning score?
SELECT "Winning score" FROM table_7219 WHERE "Date" = '16 jan 2011'
SELECT "Winning score" FROM "table_7219" WHERE "Date" = '16 jan 2011'
0.067383
CREATE TABLE table_77468 ("Team" CLOB, "Athletes" CLOB, "Run 1" CLOB, "Run 2" CLOB, "Run 3" CLOB, "Run 4" CLOB, "Final" CLOB)
Which Final has a Team of liechtenstein (lie) liechtenstein i?
SELECT "Final" FROM table_77468 WHERE "Team" = 'liechtenstein (lie) liechtenstein i'
SELECT "Final" FROM "table_77468" WHERE "Team" = 'liechtenstein (lie) liechtenstein i'
0.083984
CREATE TABLE film (film_id NUMBER, rank_in_series NUMBER, number_in_season NUMBER, title CLOB, directed_by CLOB, original_air_date CLOB, production_code CLOB) CREATE TABLE schedule (cinema_id NUMBER, film_id NUMBER, date CLOB, show_times_per_day NUMBER, price NUMBER) CREATE TABLE cinema (cinema_id NUMBER, name CLOB, openning_year NUMBER, capacity NUMBER, location CLOB)
What is total number of show times per dat for each cinema?
SELECT T2.name, SUM(T1.show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinema_id = T2.cinema_id GROUP BY T1.cinema_id
SELECT "T2"."name", SUM("T1"."show_times_per_day") FROM "schedule" "T1" JOIN "cinema" "T2" ON "T1"."cinema_id" = "T2"."cinema_id" GROUP BY "T1"."cinema_id"
0.151367
CREATE TABLE table_name_47 (best VARCHAR2, name VARCHAR2)
What was Alex Figge's Best?
SELECT best FROM table_name_47 WHERE name = "alex figge"
SELECT "best" FROM "table_name_47" WHERE "alex figge" = "name"
0.060547
CREATE TABLE table_name_25 (successes NUMBER, failures VARCHAR2, launches VARCHAR2)
What is the greatest successes that have failures greater than 1 and launches less than 28?
SELECT MAX(successes) FROM table_name_25 WHERE failures > 1 AND launches < 28
SELECT MAX("successes") FROM "table_name_25" WHERE "failures" > 1 AND "launches" < 28
0.083008
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 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 procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
find the number of emergency hospital admission patients who were diagnosed with abnormal involuntary movements.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Abnormal involuntary movements"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Abnormal involuntary movements" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "EMERGENCY" = "demographic"."admission_type"
0.245117
CREATE TABLE table_name_98 (date VARCHAR2, loss VARCHAR2)
What was the date of the game that had a loss of Gott (2-7)?
SELECT date FROM table_name_98 WHERE loss = "gott (2-7)"
SELECT "date" FROM "table_name_98" WHERE "gott (2-7)" = "loss"
0.060547
CREATE TABLE table_name_98 (event VARCHAR2, year VARCHAR2, result VARCHAR2)
In which event did he place 6th in 1971?
SELECT event FROM table_name_98 WHERE year = 1971 AND result = "6th"
SELECT "event" FROM "table_name_98" WHERE "6th" = "result" AND "year" = 1971
0.074219
CREATE TABLE microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) 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 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 treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME) CREATE TABLE cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME) CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME)
this year, what are the top three most common procedures that patients received in the same hospital visit after diagnosis of seen by physical therapy consult?
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'seen by physical therapy consult' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) AS t1 JOIN (SELECT patient.uniquepid, treatment.treatmentname, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.treatmenttime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid GROUP BY t2.treatmentname) AS t3 WHERE t3.c1 <= 3
WITH "t2" AS (SELECT "patient"."uniquepid", "treatment"."treatmentname", "treatment"."treatmenttime", "patient"."patienthealthsystemstayid" FROM "treatment" JOIN "patient" ON "patient"."patientunitstayid" = "treatment"."patientunitstayid" WHERE DATETIME("treatment"."treatmenttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')), "t3" AS (SELECT "t2"."treatmentname", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" JOIN "t2" "t2" ON "diagnosis"."diagnosistime" < "t2"."treatmenttime" AND "patient"."patienthealthsystemstayid" = "t2"."patienthealthsystemstayid" AND "patient"."uniquepid" = "t2"."uniquepid" WHERE "diagnosis"."diagnosisname" = 'seen by physical therapy consult' AND DATETIME("diagnosis"."diagnosistime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY "t2"."treatmentname") SELECT "t3"."treatmentname" FROM "t3" "t3" WHERE "t3"."c1" <= 3
0.991211
CREATE TABLE table_204_99 (id NUMBER, "#" NUMBER, "club" CLOB, "winner" NUMBER, "last win" NUMBER, "runner-up" NUMBER, "last losing final" NUMBER)
what club is before saipa ?
SELECT "club" FROM table_204_99 WHERE id = (SELECT id FROM table_204_99 WHERE "club" = 'saipa') - 1
SELECT "club" FROM "table_204_99" WHERE "id" = (SELECT "id" FROM "table_204_99" WHERE "club" = 'saipa') - 1
0.104492
CREATE TABLE table_name_6 (semifinalists VARCHAR2, tournament VARCHAR2)
Who were the semifinalists in the Rome tournament?
SELECT semifinalists FROM table_name_6 WHERE tournament = "rome"
SELECT "semifinalists" FROM "table_name_6" WHERE "rome" = "tournament"
0.068359
CREATE TABLE table_746 ("District" CLOB, "Incumbent" CLOB, "Party" CLOB, "First elected" FLOAT, "Result" CLOB, "Candidates" CLOB)
What party did Frank J. Becker represent?
SELECT "Party" FROM table_746 WHERE "Incumbent" = 'Frank J. Becker'
SELECT "Party" FROM "table_746" WHERE "Incumbent" = 'Frank J. Becker'
0.067383
CREATE TABLE diagnoses_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE procedures_icd (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icd9_code CLOB, charttime TIME) CREATE TABLE inputevents_cv (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, amount NUMBER) 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 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 d_items (row_id NUMBER, itemid NUMBER, label CLOB, linksto CLOB) CREATE TABLE labevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, itemid NUMBER, charttime TIME, valuenum NUMBER, valueuom CLOB) CREATE TABLE patients (row_id NUMBER, subject_id NUMBER, gender CLOB, dob TIME, dod TIME) CREATE TABLE d_icd_diagnoses (row_id NUMBER, icd9_code CLOB, short_title CLOB, long_title 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_procedures (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 outputevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, icustay_id NUMBER, charttime TIME, itemid NUMBER, value 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 microbiologyevents (row_id NUMBER, subject_id NUMBER, hadm_id NUMBER, charttime TIME, spec_type_desc CLOB, org_name 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 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)
calculate the number of people who died after being diagnosed with hx of colonic malignancy in the same month until 3 years ago.
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hx of colonic malignancy')) AS t1 GROUP BY t1.subject_id HAVING MIN(t1.charttime) = t1.charttime AND DATETIME(t1.charttime) <= DATETIME(CURRENT_TIME(), '-3 year')) AS t2 JOIN (SELECT patients.subject_id, admissions.hadm_id, patients.dod FROM admissions JOIN patients ON patients.subject_id = admissions.subject_id WHERE NOT patients.dod IS NULL AND DATETIME(patients.dod) <= DATETIME(CURRENT_TIME(), '-3 year')) AS t3 ON t2.subject_id = t3.subject_id WHERE DATETIME(t2.charttime, 'start of month') = DATETIME(t3.dod, 'start of month')
WITH "t2" AS (SELECT "admissions"."subject_id", "diagnoses_icd"."charttime" FROM "diagnoses_icd" JOIN "d_icd_diagnoses" ON "d_icd_diagnoses"."icd9_code" = "diagnoses_icd"."icd9_code" AND "d_icd_diagnoses"."short_title" = 'hx of colonic malignancy' JOIN "admissions" ON "admissions"."hadm_id" = "diagnoses_icd"."hadm_id" GROUP BY "admissions"."subject_id" HAVING "diagnoses_icd"."charttime" = MIN("diagnoses_icd"."charttime") AND DATETIME("diagnoses_icd"."charttime") <= DATETIME(CURRENT_TIME(), '-3 year')), "t3" AS (SELECT "patients"."subject_id", "patients"."dod" FROM "admissions" JOIN "patients" ON "admissions"."subject_id" = "patients"."subject_id" AND DATETIME("patients"."dod") <= DATETIME(CURRENT_TIME(), '-3 year') AND NOT "patients"."dod" IS NULL) SELECT COUNT(DISTINCT "t2"."subject_id") FROM "t2" "t2" JOIN "t3" "t3" ON "t2"."subject_id" = "t3"."subject_id" AND DATETIME("t2"."charttime", 'start of month') = DATETIME("t3"."dod", 'start of month')
0.9375
CREATE TABLE table_203_114 (id NUMBER, "week" NUMBER, "date" CLOB, "tv time" CLOB, "opponent" CLOB, "result" CLOB, "game site" CLOB, "record" CLOB, "attendance" NUMBER, "bye" CLOB)
which week -lrb- s -rrb- did not have more than 75,000 in attendance ?
SELECT "week" FROM table_203_114 WHERE "attendance" <= 75000
SELECT "week" FROM "table_203_114" WHERE "attendance" <= 75000
0.060547
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 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) CREATE TABLE procedures (subject_id CLOB, hadm_id CLOB, icd9_code CLOB, short_title CLOB, long_title CLOB)
provide the number of patients whose gender is f and days of hospital stay is greater than 2?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.days_stay > "2"
SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "2" < "demographic"."days_stay" AND "F" = "demographic"."gender"
0.135742
CREATE TABLE table_name_75 (silver NUMBER, gold NUMBER)
What is the average of the silver that has less than 0 gold
SELECT AVG(silver) FROM table_name_75 WHERE gold < 0
SELECT AVG("silver") FROM "table_name_75" WHERE "gold" < 0
0.056641
CREATE TABLE Problems (problem_id NUMBER, product_id NUMBER, closure_authorised_by_staff_id NUMBER, reported_by_staff_id NUMBER, date_problem_reported DATETIME, date_problem_closed DATETIME, problem_description VARCHAR2, other_problem_details VARCHAR2) CREATE TABLE Problem_Status_Codes (problem_status_code VARCHAR2, problem_status_description VARCHAR2) CREATE TABLE Problem_Log (problem_log_id NUMBER, assigned_to_staff_id NUMBER, problem_id NUMBER, problem_category_code VARCHAR2, problem_status_code VARCHAR2, log_entry_date DATETIME, log_entry_description VARCHAR2, log_entry_fix VARCHAR2, other_log_details VARCHAR2) CREATE TABLE Problem_Category_Codes (problem_category_code VARCHAR2, problem_category_description VARCHAR2) CREATE TABLE Product (product_id NUMBER, product_name VARCHAR2, product_details VARCHAR2) CREATE TABLE Staff (staff_id NUMBER, staff_first_name VARCHAR2, staff_last_name VARCHAR2, other_staff_details VARCHAR2)
Find all dates of the logs for the problem whose id is 10, show me a bar chart that bins the dates into the weekday interval, and counts the dates, could you display by the y axis in asc?
SELECT log_entry_date, COUNT(log_entry_date) FROM Problem_Log WHERE problem_id = 10 ORDER BY COUNT(log_entry_date)
SELECT "log_entry_date", COUNT("log_entry_date") FROM "Problem_Log" WHERE "problem_id" = 10 ORDER BY COUNT("log_entry_date")
0.121094
CREATE TABLE days (days_code VARCHAR2, day_name VARCHAR2) CREATE TABLE ground_service (city_code CLOB, airport_code CLOB, transport_type CLOB, ground_fare 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 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 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 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 time_zone (time_zone_code CLOB, time_zone_name CLOB, hours_from_gmt 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 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 food_service (meal_code CLOB, meal_number NUMBER, compartment CLOB, meal_description VARCHAR2) 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 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_fare (flight_id NUMBER, fare_id NUMBER) CREATE TABLE time_interval (period CLOB, begin_time NUMBER, end_time 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 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 equipment_sequence (aircraft_code_sequence VARCHAR2, aircraft_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 class_of_service (booking_class VARCHAR2, rank NUMBER, class_description CLOB) CREATE TABLE month (month_number NUMBER, month_name CLOB) CREATE TABLE flight_leg (flight_id NUMBER, leg_number NUMBER, leg_flight NUMBER)
what types of ground transportation are available in DENVER
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DENVER' AND ground_service.city_code = city.city_code
SELECT DISTINCT "ground_service"."transport_type" FROM "city" JOIN "ground_service" ON "city"."city_code" = "ground_service"."city_code" WHERE "city"."city_name" = 'DENVER'
0.167969
CREATE TABLE table_17391 ("No. in series" CLOB, "No. in season" CLOB, "Title" CLOB, "Directed by" CLOB, "Written by" CLOB, "Original air date" CLOB, "Production code" CLOB)
What's the season number of the episode titled 'Houseboat'?
SELECT "No. in season" FROM table_17391 WHERE "Title" = 'Houseboat'
SELECT "No. in season" FROM "table_17391" WHERE "Title" = 'Houseboat'
0.067383
CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME) 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 diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) CREATE TABLE lab (labid NUMBER, patientunitstayid NUMBER, labname CLOB, labresult NUMBER, labresulttime TIME) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime 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 microlab (microlabid NUMBER, patientunitstayid NUMBER, culturesite CLOB, organism CLOB, culturetakentime TIME) CREATE TABLE allergy (allergyid NUMBER, patientunitstayid NUMBER, drugname CLOB, allergyname CLOB, allergytime TIME)
until 2104, what were the top four most frequently ordered microbiology tests for patients during the same month after receiving antiplatelet agent - aspirin?
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antiplatelet agent - aspirin' AND STRFTIME('%y', treatment.treatmenttime) <= '2104') AS t1 JOIN (SELECT patient.uniquepid, microlab.culturesite, microlab.culturetakentime FROM microlab JOIN patient ON microlab.patientunitstayid = patient.patientunitstayid WHERE STRFTIME('%y', microlab.culturetakentime) <= '2104') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.treatmenttime < t2.culturetakentime AND DATETIME(t1.treatmenttime, 'start of month') = DATETIME(t2.culturetakentime, 'start of month') GROUP BY t2.culturesite) AS t3 WHERE t3.c1 <= 4
WITH "t2" AS (SELECT "patient"."uniquepid", "microlab"."culturesite", "microlab"."culturetakentime" FROM "microlab" JOIN "patient" ON "microlab"."patientunitstayid" = "patient"."patientunitstayid" WHERE STRFTIME('%y', "microlab"."culturetakentime") <= '2104'), "t3" AS (SELECT "t2"."culturesite", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS "c1" FROM "treatment" JOIN "patient" ON "patient"."patientunitstayid" = "treatment"."patientunitstayid" JOIN "t2" "t2" ON "patient"."uniquepid" = "t2"."uniquepid" AND "t2"."culturetakentime" > "treatment"."treatmenttime" AND DATETIME("t2"."culturetakentime", 'start of month') = DATETIME("treatment"."treatmenttime", 'start of month') WHERE "treatment"."treatmentname" = 'antiplatelet agent - aspirin' AND STRFTIME('%y', "treatment"."treatmenttime") <= '2104' GROUP BY "t2"."culturesite") SELECT "t3"."culturesite" FROM "t3" "t3" WHERE "t3"."c1" <= 4
0.87207
CREATE TABLE table_73216 ("Shareholder" CLOB, "s A share" FLOAT, "s B share" FLOAT, "Percent of capital" CLOB, "Percent of votes" CLOB)
What is the s B share for Handelsbanken funds incl XACT?
SELECT "s B share" FROM table_73216 WHERE "Shareholder" = 'Handelsbanken funds incl XACT'
SELECT "s B share" FROM "table_73216" WHERE "Shareholder" = 'Handelsbanken funds incl XACT'
0.088867
CREATE TABLE table_30219 ("Council" CLOB, "TUV" FLOAT, "Democratic Unionist" FLOAT, "Ulster Unionist" FLOAT, "Alliance" FLOAT, "SDLP" FLOAT, "Sinn F\\u00e9in" FLOAT, "Green ( NI ) " FLOAT, "Independent" FLOAT, "Others" CLOB, "Total" FLOAT)
What is the SDLP of Belfast?
SELECT MAX("SDLP") FROM table_30219 WHERE "Council" = 'Belfast'
SELECT MAX("SDLP") FROM "table_30219" WHERE "Council" = 'Belfast'
0.063477
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 cost (costid NUMBER, uniquepid CLOB, patienthealthsystemstayid NUMBER, eventtype CLOB, eventid NUMBER, chargetime TIME, cost NUMBER) 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) CREATE TABLE intakeoutput (intakeoutputid NUMBER, patientunitstayid NUMBER, cellpath CLOB, celllabel CLOB, cellvaluenumeric NUMBER, intakeoutputtime TIME) CREATE TABLE diagnosis (diagnosisid NUMBER, patientunitstayid NUMBER, diagnosisname CLOB, diagnosistime TIME, icd9code CLOB) CREATE TABLE medication (medicationid NUMBER, patientunitstayid NUMBER, drugname CLOB, dosage CLOB, routeadmin CLOB, drugstarttime TIME, drugstoptime TIME) CREATE TABLE treatment (treatmentid NUMBER, patientunitstayid NUMBER, treatmentname CLOB, treatmenttime TIME) CREATE TABLE vitalperiodic (vitalperiodicid NUMBER, patientunitstayid NUMBER, temperature NUMBER, sao2 NUMBER, heartrate NUMBER, respiration NUMBER, systemicsystolic NUMBER, systemicdiastolic NUMBER, systemicmean NUMBER, observationtime TIME)
what is patient 002-3736's first output on 02/26/2103?
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-3736')) AND intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y-%m-%d', intakeoutput.intakeoutputtime) = '2103-02-26' ORDER BY intakeoutput.intakeoutputtime LIMIT 1
WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '002-3736' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT "intakeoutput"."celllabel" FROM "intakeoutput" LEFT JOIN "_u_1" "_u_1" ON "_u_1"."" = "intakeoutput"."patientunitstayid" WHERE "intakeoutput"."cellpath" LIKE '%output%' AND NOT "_u_1"."" IS NULL AND STRFTIME('%y-%m-%d', "intakeoutput"."intakeoutputtime") = '2103-02-26' ORDER BY "intakeoutput"."intakeoutputtime" FETCH FIRST 1 ROWS ONLY
0.680664
CREATE TABLE table_name_91 (years VARCHAR2, decile VARCHAR2)
The Decile of 6 has which corresponding Years?
SELECT years FROM table_name_91 WHERE decile = "6"
SELECT "years" FROM "table_name_91" WHERE "6" = "decile"
0.054688
CREATE TABLE table_1403 ("Position" FLOAT, "Club" CLOB, "Games played" FLOAT, "Wins" FLOAT, "Draws" FLOAT, "Loses" FLOAT, "Goals scored" FLOAT, "Goals conceded" FLOAT, "Points" FLOAT)
what is the highest number of draws for sveikata kybartai
SELECT MAX("Draws") FROM table_1403 WHERE "Club" = 'Sveikata Kybartai'
SELECT MAX("Draws") FROM "table_1403" WHERE "Club" = 'Sveikata Kybartai'
0.070313
CREATE TABLE photos (id NUMBER, camera_lens_id NUMBER, mountain_id NUMBER, color CLOB, name CLOB) CREATE TABLE mountain (id NUMBER, name CLOB, Height FLOAT, Prominence FLOAT, Range CLOB, Country CLOB) CREATE TABLE camera_lens (id NUMBER, brand CLOB, name CLOB, focal_length_mm FLOAT, max_aperture FLOAT)
Please draw a bar chart to show the total number of different color, I want to show X from high to low order.
SELECT color, COUNT(color) FROM photos GROUP BY color ORDER BY color DESC
SELECT "color", COUNT("color") FROM "photos" GROUP BY "color" ORDER BY "color" DESC
0.081055