schema stringlengths 20 14.6k | query stringlengths 17 2.58k | question stringlengths 8 1.06k |
|---|---|---|
<table0>[Order_Items] { <col0>[order_item_id]:[INTEGER] <col1>[product_id]:[INTEGER] <col2>[order_id]:[INTEGER] <col3>[order_item_status]:[VARCHAR] <col4>[order_item_details]:[VARCHAR] } <table1>[Products] { <col0>[product_id]:[INTEGER] <col1>[product_name]:[VARCHAR] <col2>[product_details]:[VARCHAR] } <table2>[Invoi... | SELECT T3.product_name, SUM( COUNT( * ) ) FROM `<table5>` AS T1 JOIN Order_Items AS T2 JOIN Products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_name | List the name and count of each product in all orders. Plot them as pie chart.
|
<table0>[Products] { <col0>[Code]:[INTEGER] <col1>[VARCHAR]:[255] <col2>[Price]:[DECIMAL] <col3>[Manufacturer]:[INTEGER] } <table1>[Manufacturers] { <col0>[Code]:[INTEGER] <col1>[VARCHAR]:[255] <col2>[Headquarter]:[VARCHAR] <col3>[255]:[Founder] <col4>[VARCHAR]:[255] <col5>[Revenue]:[REAL] } | SELECT T1.Name, T2.Revenue FROM `<table0>` AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T2.Revenue | For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the sum of revenue , and group by attribute name, list by the Y-axis in ascending.
|
<table0>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_cd]:[text] <col6>[route]:[text] <col7>[drug_dose]:[text] } <table1>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text]... | SELECT `<table1>`.language FROM `<table1>` WHERE `<table1>`.name = "Paul Edwards" | which language does patient paul edwards speak? |
<table0>[Dorm] { <col0>[dormid]:[INTEGER] <col1>[dorm_name]:[VARCHAR] <col2>[student_capacity]:[INTEGER] <col3>[gender]:[VARCHAR] } <table1>[Dorm_amenity] { <col0>[amenid]:[INTEGER] <col1>[amenity_name]:[VARCHAR] } <table2>[Has_amenity] { <col0>[dormid]:[INTEGER] <col1>[amenid]:[INTEGER] } <table3>[Student] { <col0>... | SELECT city_code, COUNT( * ) FROM `<table3>` GROUP BY `<col7>` ORDER BY `<col7>` DESC | Create a bar chart showing the total number across city code, I want to order bar in desc order.
|
<table0>[company] { <col0>[INT]:[name] <col1>[VARCHAR]:[num_employees] <col2>[INT]:[founder_gender] <col3>[VARCHAR]:[INSERT] } | SELECT COUNT( * ) FROM `<table0>` WHERE num_employees > 10 AND founder_gender = 'Female'; | How many female founders are there in companies with more than 10 employees? |
<table0>[dual_carrier] { <col0>[main_airline]:[varchar] <col1>[low_flight_number]:[int] <col2>[high_flight_number]:[int] <col3>[dual_airline]:[varchar] <col4>[service_name]:[text] } <table1>[class_of_service] { <col0>[booking_class]:[varchar] <col1>[rank]:[int] <col2>[class_description]:[text] } <table2>[airport_serv... | SELECT DISTINCT flight.flight_id FROM `<table2>` AS AIRPORT_SERVICE_0, `<table2>` AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ( CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCIS... | what is the earliest flight from PITTSBURGH to SAN FRANCISCO |
<table0>[lab] { <col0>[labid]:[number] <col1>[patientunitstayid]:[number] <col2>[labname]:[text] <col3>[labresult]:[number] <col4>[labresulttime]:[time] } <table1>[allergy] { <col0>[allergyid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[allergyname]:[text] <col4>[allergytime]:[time] } <... | SELECT MAX( `<table0>`.`<table0>`result ) FROM `<table0>` WHERE `<table0>`.`<table3>`unitstayid IN ( SELECT `<table3>`.`<table3>`unitstayid FROM `<table3>` WHERE `<table3>`.`<table3>`healthsystemstayid IN ( SELECT `<table3>`.`<table3>`healthsystemstayid FROM `<table3>` WHERE `<table3>`.uniquepid = '015-67291' ) ) AND `... | until 1 month ago, what was the monthly maximum value of the vancomycin - random of patient 015-67291?
|
<table0>[Manufacturers] { <col0>[Code]:[INTEGER] <col1>[VARCHAR]:[255] <col2>[Headquarter]:[VARCHAR] <col3>[255]:[Founder] <col4>[VARCHAR]:[255] <col5>[Revenue]:[REAL] } <table1>[Products] { <col0>[Code]:[INTEGER] <col1>[VARCHAR]:[255] <col2>[Price]:[DECIMAL] <col3>[Manufacturer]:[INTEGER] } | SELECT Name, `<col3>` FROM `<table1>` WHERE `<col2>` BETWEEN 60 AND 120 | For those products with a price between 60 and 120, draw a bar chart about the distribution of name and manufacturer . |
<table0>[arctic_biodiversity] { <col0>[species_id]:[INT] <col1>[species_name]:[VARCHAR] <col2>[255]:[population] <col3>[INT]:[region] <col4>[VARCHAR]:[255] } <table1>[iucn_redlist] { <col0>[species_id]:[INT] <col1>[conservation_status]:[VARCHAR] } | SELECT a.species_name FROM `<table0>` a LEFT JOIN iucn_redlist r ON a.species_id = r.species_id WHERE r.species_id IS NULL; | List the species in the 'arctic_biodiversity' table that are not present in the 'iucn_redlist' table. |
<table0>[awards_players] { <col0>[playerID]:[text] <col1>[award]:[text] <col2>[year]:[integer] <col3>[lgID]:[text] <col4>[note]:[text] <col5>[pos]:[text] } <table1>[coaches] { <col0>[coachID]:[text] <col1>[year]:[integer] <col2>[tmID]:[text] <col3>[lgID]:[text] <col4>[stint]:[integer] <col5>[won]:[integer] <col6>[lost... | SELECT coachID, won, `<col6>` FROM `<table1>` WHERE `<col1>` = 1950 AND `<col2>` = 'BOS' | Who is the coach for 'BOS' team in year 1950. List the coach ID together with the number of game won and lost. |
<table0>[people] { <col0>[People_ID]:[int] <col1>[District]:[text] <col2>[text]:[Party] <col3>[text]:[Age] } <table1>[debate] { <col0>[Debate_ID]:[int] <col1>[Date]:[text] <col2>[Venue]:[text] <col3>[Num_of_Audience]:[int] } <table2>[debate_people] { <col0>[Debate_ID]:[int] <col1>[Affirmative]:[int] <col2>[Negative]:... | SELECT Venue, COUNT( Venue ) FROM `<table2>` AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID GROUP BY Venue ORDER BY Venue DESC | A bar chart showing the number of debates in each venue for those on the affirmative side, and show bar in descending order please.
|
<table0>[MuseumAttendees] { <col0>[attendeeID]:[INT] <col1>[visitDate]:[DATE] <col2>[age]:[INT] } | SELECT MIN( `<col2>` ) FROM `<table0>` WHERE `<col1>` >= '2022-01-01' AND `<col1>` <= '2022-12-31'; | What is the minimum age of attendees who visited the museum last year? |
<table0>[table_3846] { <col0>[Game]:[real] <col1>[Date]:[text] <col2>[Team]:[text] <col3>[Score]:[text] <col4>[High]:[points] <col5>[text]:[High] <col6>[rebounds]:[text] <col7>[High]:[assists] <col8>[text]:[Location] <col9>[Attendance]:[text] <col10>[Series]:[text] } | SELECT COUNT( "Team" ) FROM `<table0>` WHERE "High rebounds" = 'Chris Bosh , LeBron James ( 8 )' | How many teams were there when chris bosh , lebron james (8) had the high rebounds?
|
<table0>[PendingFlags] { <col0>[number]:[FlagTypeId] <col1>[number]:[PostId] <col2>[number]:[CreationDate] <col3>[time]:[CloseReasonTypeId] <col4>[number]:[CloseAsOffTopicReasonTypeId] <col5>[number]:[DuplicateOfQuestionId] <col6>[number]:[BelongsOnBaseHostAddress] } <table1>[PostsWithDeleted] { <col0>[number]:[PostTy... | SELECT COUNT( * ) AS "total", SUM( CASE WHEN Reputation % 2 = 0 THEN 1 ELSE 0 END ) AS "even", SUM( CASE WHEN Reputation % 2 = 1 THEN 1 ELSE 0 END ) AS "odd", ROUND( ( SUM( CASE WHEN Reputation % 2 = 0 THEN 1 ELSE 0 END ) * 100.0 ) / COUNT( * ), 3 ) AS "%even", ROUND( ( SUM( CASE WHEN Reputation % 2 = 1 THEN 1 ELSE 0 E... | Simple data on reputation parity above a given lower bound. |
<table0>[Manufacturers] { <col0>[Code]:[INTEGER] <col1>[VARCHAR]:[255] <col2>[Headquarter]:[VARCHAR] <col3>[255]:[Founder] <col4>[VARCHAR]:[255] <col5>[Revenue]:[REAL] } <table1>[Products] { <col0>[Code]:[INTEGER] <col1>[VARCHAR]:[255] <col2>[Price]:[DECIMAL] <col3>[Manufacturer]:[INTEGER] } | SELECT T1.Name, T1.Code FROM `<table1>` AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Code | For those records from the products and each product's manufacturer, show me about the distribution of name and code , and group by attribute headquarter in a bar chart, and order in ascending by the Y.
|
<table0>[ships] { <col0>[INT]:[name] <col1>[VARCHAR]:[100] <col2>[type]:[VARCHAR] <col3>[capacity]:[INT] <col4>[year]:[INT] } | SELECT MAX( `<col3>` ) FROM `<table0>` WHERE `<col2>` = 'Container' AND `<col4>` <= 2022; | What is the maximum capacity of the largest container ship in the fleet as of 2022? |
<table0>[table_name_7] { <col0>[claimant]:[VARCHAR] <col1>[rank]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 200 | Which claimant's rank is 200?
|
<table0>[table_name_91] { <col0>[democratic_seat_plurality]:[VARCHAR] <col1>[state_ranked_in_partisan_order]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "new hampshire" | What is the democratic seat plurality with partisan order of New Hampshire?
|
<table0>[table_name_7] { <col0>[year]:[INTEGER] <col1>[event]:[VARCHAR] <col2>[venue]:[VARCHAR] } | SELECT MIN( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "foil team" AND `<col2>` = "melbourne" | What is the lowest year that had foil team as the event at Melbourne? |
<table0>[table_5961] { <col0>[County]:[text] <col1>[Bush]:[real] <col2>[Bush]:[text] <col3>[Kerry]:[real] <col4>[Kerry]:[text] <col5>[real]:[text] <col6>[Total]:[real] } | SELECT "Others #" FROM `<table0>` WHERE "Bush %" = '63.98%' | What was the other number with 63.98% bush?
|
<table0>[Comments] { <col0>[number]:[PostId] <col1>[number]:[Score] <col2>[number]:[Text] <col3>[text]:[CreationDate] <col4>[time]:[UserDisplayName] <col5>[text]:[UserId] <col6>[number]:[ContentLicense] } <table1>[ReviewTaskResultTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table2>[PostHistoryTypes] {... | SELECT COUNT( Q.Id ) FROM `<table17>` AS Q WHERE Q.AcceptedAnswerId IS NULL AND Q.PostTypeId = 1 AND q.ClosedDate IS NULL | Count of Question with no Accepted Answer.
|
<table0>[DefenseContracts] { <col0>[INT]:[Contractor] <col1>[VARCHAR]:[Value] <col2>[FLOAT]:[Year] <col3>[INT]:[INSERT] } | SELECT Contractor, SUM( Value ) as Total FROM `<table0>` WHERE Year = 2020 GROUP BY Contractor ORDER BY Total DESC LIMIT 3; | List the top 3 defense contractors by total contract value for the year 2020, in descending order. |
<table0>[marine_species_count] { <col0>[ocean]:[TEXT] <col1>[species_count]:[INT] } | SELECT ( `<col1>` - ( SELECT `<col1>` FROM `<table0>` WHERE `<col0>` = 'Indian Ocean' ) ) AS difference FROM `<table0>` WHERE `<col0>` = 'Atlantic Ocean'; | What is the difference between the total number of marine species found in the Atlantic and Indian Oceans? |
<table0>[labor_statistics] { <col0>[INT]:[added_date] <col1>[DATE]:[category] <col2>[VARCHAR]:[255] <col3>[title]:[VARCHAR] <col4>[255]:[hourly_wage] } | SELECT DATE_FORMAT( added_date, '%Y-%m' ) as month, COUNT( * ) as records_added FROM `<table0>` WHERE YEAR( added_date ) = 2019 GROUP BY month; | How many labor statistics records were added per month in 2019? |
<table0>[table_25042332_22] { <col0>[tertiary__18_24_years]:[VARCHAR] <col1>[secondary__14_17_years]:[VARCHAR] } | SELECT tertiary__18_24_years_ FROM `<table0>` WHERE secondary__14_17_years_ = "71.43" | What is the enrollment ratio in tertiary in the region where the enrollment ration in secondary is 71.43? |
<table0>[table_name_76] { <col0>[machine]:[VARCHAR] <col1>[rider]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "keith t. gawler" | What machine did Keith T. Gawler ride? |
<table0>[acidification_levels] { <col0>[measurement_id]:[INTEGER] <col1>[acidification_level]:[FLOAT] } | SELECT MIN( acidification_level ), MAX( acidification_level ) FROM acidification_levels; | What are the minimum and maximum ocean acidification levels recorded? |
<table0>[microlab] { <col0>[microlabid]:[number] <col1>[patientunitstayid]:[number] <col2>[culturesite]:[text] <col3>[organism]:[text] <col4>[culturetakentime]:[time] } <table1>[patient] { <col0>[uniquepid]:[text] <col1>[patienthealthsystemstayid]:[number] <col2>[patientunitstayid]:[number] <col3>[gender]:[text] <col4... | SELECT `<table4>`.`<table4>`time FROM `<table4>` WHERE `<table4>`.`<table1>`unitstayid IN ( SELECT `<table1>`.`<table1>`unitstayid FROM `<table1>` WHERE `<table1>`.`<table1>`healthsystemstayid IN ( SELECT `<table1>`.`<table1>`healthsystemstayid FROM `<table1>` WHERE `<table1>`.uniquepid = '002-39753' ) ) AND `<table4>`... | what was the first urine incontinence output time of patient 002-39753 until 12/03/2105?
|
<table0>[ATT_CLASSES] { <col0>[ATT_CLASS_ID]:[integer] <col1>[ATT_CLASS]:[text] } <table1>[OBJ_CLASSES] { <col0>[OBJ_CLASS_ID]:[integer] <col1>[OBJ_CLASS]:[text] } <table2>[IMG_OBJ] { <col0>[IMG_ID]:[integer] <col1>[OBJ_SAMPLE_ID]:[integer] <col2>[OBJ_CLASS_ID]:[integer] <col3>[integer]:[integer] <col4>[integer]:[int... | SELECT T1.IMG_ID AS IMGID FROM IMG_OBJ_att AS T1 INNER JOIN ATT_CLASSES AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T2.ATT_CLASS = 'white' GROUP BY T1.IMG_ID ORDER BY COUNT( T1.ATT_CLASS_ID ) DESC LIMIT 1 | Which image has the highest number of "white" class attributes? |
<table0>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table1>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[la... | SELECT COUNT( DISTINCT `<table4>`.subject_id ) FROM `<table4>` INNER JOIN prescriptions ON `<table4>`.hadm_id = prescriptions.hadm_id WHERE `<table4>`.dod_year <= "2122.0" AND prescriptions.formulary_drug_cd = "PRED5SM" | what is the number of patients who died in or before 2122 and with drug code pred5sm?
|
<table0>[medication] { <col0>[medicationid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[dosage]:[text] <col4>[routeadmin]:[text] <col5>[drugstarttime]:[time] <col6>[drugstoptime]:[time] } <table1>[allergy] { <col0>[allergyid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[... | SELECT COUNT( * ) FROM `<table0>` WHERE `<table0>`.drugname = 'phenylephrine hcl' AND DATETIME( `<table0>`.drugstarttime, 'start of year' ) = DATETIME( CURRENT_TIME( ), 'start of year', '-1 year' ) | how many prescription cases of phenylephrine hcl were made during the previous year? |
<table0>[suppliers] { <col0>[INT]:[PRIMARY] <col1>[KEY]:[supplier_name] <col2>[VARCHAR]:[255] <col3>[circular_economy_rating]:[DECIMAL] <col4>[product_count]:[INT] } | SELECT supplier_name, AVG( `<col3>` ) as average_rating, `<col4>` FROM `<table0>` GROUP BY supplier_name ORDER BY average_rating DESC LIMIT 3; | List the top 3 suppliers with the highest circular economy ratings, displaying the supplier name, average rating, and the number of products they supply, arranged by the average rating in descending order. |
<table0>[table_name_35] { <col0>[total]:[INTEGER] <col1>[e_score]:[VARCHAR] <col2>[t_score]:[VARCHAR] } | SELECT MAX( `<col0>` ) FROM `<table0>` WHERE `<col1>` > 9.35 AND `<col2>` < 4 | How large was the total when the E Score was greater than 9.35 and T Score was less than 4?
|
<table0>[basketball_match] { <col0>[Team_ID]:[int] <col1>[School_ID]:[int] <col2>[Team_Name]:[text] <col3>[ACC_Regular_Season]:[text] <col4>[ACC_Percent]:[text] <col5>[ACC_Home]:[text] <col6>[ACC_Road]:[text] <col7>[All_Games]:[text] <col8>[All_Games_Percent]:[int] <col9>[All_Home]:[text] <col10>[All_Road]:[text] <col1... | SELECT School_ID, `<col4>` FROM `<table0>` | What is the relationship between School_ID and ACC_Percent ?
|
<table0>[farmer_country] { <col0>[farmer_id]:[INT] <col1>[name]:[VARCHAR] <col2>[age]:[INT] <col3>[country]:[VARCHAR] } | SELECT country, MAX( `<col2>` ) FROM `<table0>` GROUP BY country; | What is the maximum age of farmers in each country in the 'rural_development' database? |
<table0>[Courts] { <col0>[Location]:[VARCHAR] <col1>[255]:[CourtID] } <table1>[Cases] { <col0>[CaseID]:[INT] <col1>[CourtID]:[INT] } | SELECT `<table0>`.Location, SUM( 1 ) OVER( PARTITION BY `<table0>`.Location ) AS TotalCases FROM `<table0>` JOIN Cases ON `<table0>`.CourtID = Cases.CourtID GROUP BY `<table0>`.Location, `<table0>`.CourtID ORDER BY TotalCases DESC; | What is the total number of cases for each court location, ordered by the total number of cases in descending order? |
<table0>[table_1818254_1] { <col0>[population]:[INTEGER] <col1>[city]:[VARCHAR] } | SELECT MAX( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "Minneapolis" | What was the population of Minneapolis in 2012?
|
<table0>[sourcing] { <col0>[country]:[VARCHAR] <col1>[255]:[material] <col2>[VARCHAR]:[255] <col3>[eco_friendly]:[BOOLEAN] } | SELECT country, material, COUNT( * ) as eco_friendly_materials_count FROM `<table0>` WHERE `<col3>` = TRUE GROUP BY country, material; | What is the distribution of eco-friendly materials sourced by country and material type? |
<table0>[transactions] { <col0>[INT]:[initiative_type] <col1>[VARCHAR]:[255] <col2>[transaction_date]:[DATE] <col3>[country]:[VARCHAR] } | SELECT COUNT( * ) FROM `<table0>` WHERE initiative_type = 'socially responsible lending' AND `<col3>` = 'United Kingdom' AND `<col2>` >= DATEADD( year, -1, GETDATE( ) ); | Count the number of transactions for socially responsible lending initiatives in the United Kingdom over the past year. |
<table0>[table_68142] { <col0>[Year]:[text] <col1>[Start]:[text] <col2>[Qual]:[text] <col3>[Rank]:[text] <col4>[Finish]:[text] <col5>[Laps]:[real] } | SELECT MAX( "Laps" ) FROM `<table0>` WHERE "Rank" = '14' | What is the highest laps of the year when the rank was 14?
|
<table0>[marine_species_observations] { <col0>[INT]:[country] <col1>[VARCHAR]:[species] <col2>[VARCHAR]:[date] <col3>[DATE]:[INSERT] } | SELECT country, COUNT( * ) AS total_species FROM `<table0>` GROUP BY country ORDER BY total_species DESC LIMIT 3; | Identify the top 3 countries with the most marine species observed in their waters. |
<table0>[diagnosis] { <col0>[diagnosisid]:[number] <col1>[patientunitstayid]:[number] <col2>[diagnosisname]:[text] <col3>[diagnosistime]:[time] <col4>[icd9code]:[text] } <table1>[cost] { <col0>[costid]:[number] <col1>[uniquepid]:[text] <col2>[patienthealthsystemstayid]:[number] <col3>[eventtype]:[text] <col4>[eventid]... | SELECT t3.drugname FROM ( SELECT t2.drugname, DENSE_RANK( ) OVER ( ORDER BY COUNT( * ) DESC ) AS c1 FROM ( SELECT patient.uniquepid, `<table0>`.`<table0>`time FROM `<table0>` JOIN patient ON `<table0>`.patientunitstayid = patient.patientunitstayid WHERE `<table0>`.`<table0>`name = 'hyperglycemia - stress related' AND D... | what are the four most commonly prescribed drugs that patients of the 30s were prescribed within 2 months after having been diagnosed with hyperglycemia - stress related since 5 years ago? |
<table0>[table_25610] { <col0>[Season]:[text] <col1>[text]:[Teams] <col2>[real]:[Relegated] <col3>[League]:[text] <col4>[Promoted]:[League] <col5>[text]:[Promoted] <col6>[League]:[text] <col7>[Relegated]:[League] } | SELECT "Name" FROM `<table0>` WHERE "Promoted to League" = 'Henley Manchester' | Name the name for henley manchester
|
<table0>[requirement] { <col0>[requirement_id]:[int] } <table1>[program_requirement] { <col0>[program_id]:[int] <col1>[category]:[varchar] <col2>[min_credit]:[int] <col3>[additional_req]:[varchar] } <table2>[student] { <col0>[student_id]:[int] <col1>[lastname]:[varchar] <col2>[firstname]:[varchar] <col3>[program_id]:... | SELECT DISTINCT `<table15>`.department, `<table15>`.name, `<table15>`.number FROM `<table15>` INNER JOIN program_`<table15>` ON program_`<table15>`.`<table15>`_id = `<table15>`.`<table15>`_id WHERE `<table15>`.credits = 11 AND program_`<table15>`.category LIKE 'ULCS' | Which of the upper-level classes being offered are 11 credits ?
|
<table0>[table_name_44] { } | SELECT 2009 FROM `<table0>` WHERE 2010 = "1r" AND 2012 = "a" AND 2008 = "2r" | Name the 2009 ffor 2010 of 1r and 2012 of a and 2008 of 2r
|
<table0>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table1>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[la... | SELECT `<table0>`.short_title FROM `<table0>` WHERE `<table0>`.subject_id = "74032" | what is procedure short title of subject id 74032?
|
<table0>[Episode] { <col0>[episode_id]:[text] <col1>[series]:[text] <col2>[season]:[integer] <col3>[episode]:[integer] <col4>[number_in_series]:[integer] <col5>[title]:[text] <col6>[summary]:[text] <col7>[air_date]:[date] <col8>[episode_image]:[text] <col9>[rating]:[real] <col10>[votes]:[integer] } <table1>[Keyword] {... | SELECT COUNT( `<col0>` ) FROM `<table3>` WHERE `<col9>` = 'Winner' AND `<col4>` = 'Television' AND `<col1>` = 'American Bar Association Silver Gavel `<table3>`s for Media and the Arts' | How many winners have been awarded a Television award by the "American Bar Association Silver Gavel Awards for Media and the Arts"? |
<table0>[table_15621965_10] { <col0>[player]:[VARCHAR] <col1>[school_club_team]:[VARCHAR] } | SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "Arizona" | Name the number of players from arizona |
<table0>[table_52151] { <col0>[Date]:[text] <col1>[Venue]:[text] <col2>[Result]:[text] <col3>[Competition]:[text] <col4>[Goals]:[real] } | SELECT MIN( "Goals" ) FROM `<table0>` WHERE "Venue" = 'tehran, iran' AND "Date" = '1948-10-28' | In 1948-10-28, what were the lowest Goals in Tehran, Iran?
|
<table0>[ReviewTasks] { <col0>[number]:[ReviewTaskTypeId] <col1>[number]:[CreationDate] <col2>[time]:[DeletionDate] <col3>[time]:[ReviewTaskStateId] <col4>[number]:[PostId] <col5>[number]:[SuggestedEditId] <col6>[number]:[CompletedByReviewTaskId] } <table1>[Votes] { <col0>[number]:[PostId] <col1>[number]:[VoteTypeId] ... | SELECT ROW_NUMBER( ) OVER ( ORDER BY p.Id ) AS RowNum, p.Id, p.Title, p.PostTypeId, p.CreationDate, p.ClosedDate, p.Score, p.ViewCount, p.AnswerCount, p.Tags, p.OwnerUserId, p.OwnerDisplayName, owner.Location, owner.Reputation, c.Id AS AnswerId, c.Score AS AnswerScore, responseOwner.Id AS ResponseOwnerId, responseOwner... | Data Science - Posts and Users. |
<table0>[accounts] { <col0>[customer_id]:[INT] <col1>[account_type]:[VARCHAR] <col2>[branch]:[VARCHAR] <col3>[balance]:[DECIMAL] } | SELECT MAX( `<col3>` ) FROM `<table0>` WHERE `<col1>` = 'Checking' AND `<col2>` = 'Santiago'; | What is the maximum checking account balance in the Santiago branch? |
<table0>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[label]:[text] <col7>[fluid]:[text] } <table1>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type... | SELECT COUNT( DISTINCT `<table4>`.subject_id ) FROM `<table4>` WHERE `<table4>`.religion = "JEHOVAH'S WITNESS" | what is the number of patients whose religion is jehovah's witness? |
<table0>[virtual_tours] { <col0>[tour_id]:[INT] <col1>[hotel_name]:[VARCHAR] <col2>[255]:[city] <col3>[VARCHAR]:[255] <col4>[country]:[VARCHAR] <col5>[255]:[duration] <col6>[INT]:[INSERT] } | SELECT AVG( duration ) FROM `<table0>` WHERE city = 'Mexico City' AND `<col4>` = 'Mexico'; | What is the average virtual tour engagement duration in Mexico City, Mexico? |
<table0>[ReviewTaskTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table1>[TagSynonyms] { <col0>[number]:[SourceTagName] <col1>[text]:[TargetTagName] <col2>[text]:[CreationDate] <col3>[time]:[OwnerUserId] <col4>[number]:[AutoRenameCount] <col5>[number]:[LastAutoRename] <col6>[time]:[Score] <col7>[number]:... | SELECT p.Score AS "post score", COUNT( * ) AS "# posts" FROM `<table23>` AS p WHERE p.OwnerUserId = '##UserId:int##' GROUP BY p.Score ORDER BY p.Score DESC | Histogram of this user's post scores.
|
<table0>[community_development] { <col0>[INT]:[project_name] <col1>[TEXT]:[start_date] <col2>[DATE]:[INSERT] } | SELECT * FROM `<table0>` WHERE project_name LIKE '%Africa%' AND start_date > '2020-01-01'; | List all community development projects in Africa that were started after January 1, 2020. |
<table0>[budgets] { <col0>[INT]:[category] <col1>[VARCHAR]:[INT] <col2>[province]:[VARCHAR] } | SELECT SUM( amount ) FROM `<table0>` WHERE category = 'Education' AND `<col2>` = 'Ontario'; | What is the total budget for education in Ontario? |
<table0>[flight_stop] { <col0>[flight_id]:[int] <col1>[stop_number]:[int] <col2>[stop_days]:[text] <col3>[stop_airport]:[text] <col4>[arrival_time]:[int] <col5>[arrival_airline]:[text] <col6>[arrival_flight_number]:[int] <col7>[departure_time]:[int] <col8>[departure_airline]:[text] <col9>[departure_flight_number]:[int]... | SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'BALTIMORE' AND flight.to_airport = airport_service.airport_code | i would like to fly to BALTIMORE |
<table0>[table_31830] { <col0>[Time]:[text] <col1>[text]:[Nationality] <col2>[text]:[Date] <col3>[text]:[Event] <col4>[Place]:[text] <col5>[Source]:[text] } | SELECT "Time" FROM `<table0>` WHERE "Name" = 'derek graham' | What was Derek Graham's time?
|
<table0>[patients] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[gender]:[text] <col3>[dob]:[time] <col4>[dod]:[time] } <table1>[diagnoses_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table2>[microbiologyevents]... | SELECT COUNT( * ) FROM `<table14>` WHERE `<table14>`.icustay_id IN ( SELECT `<table13>`.icustay_id FROM `<table13>` WHERE `<table13>`.hadm_id IN ( SELECT `<table8>`.hadm_id FROM `<table8>` WHERE `<table8>`.subject_id = 1902 ) ) AND `<table14>`.itemid IN ( SELECT `<table10>`.itemid FROM `<table10>` WHERE `<table10>`.lab... | what is the number of times patient 1902 has had a chest tube #1 today? |
<table0>[table_name_25] { <col0>[year]:[VARCHAR] <col1>[uk_albums]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "15" | 15 albums were released in the UK during which year? |
<table0>[table_19495707_1] { <col0>[application]:[VARCHAR] <col1>[developed_by]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Caligari Corporation" | Name the application for caligari corporation |
<table0>[Products] { <col0>[product_id]:[INTEGER] <col1>[product_type_code]:[VARCHAR] <col2>[product_name]:[VARCHAR] <col3>[product_price]:[DECIMAL] } <table1>[Addresses] { <col0>[address_id]:[INTEGER] <col1>[address_details]:[VARCHAR] } <table2>[Suppliers] { <col0>[supplier_id]:[INTEGER] <col1>[supplier_name]:[VARCH... | SELECT product_type_code, AVG( `<col3>` ) FROM `<table0>` GROUP BY `<col1>` | Give the proportion of what is the average price for each type of product? |
<table0>[table_train_200] { <col0>[int]:[gender] <col1>[string]:[fasting_triglycerides] <col2>[int]:[fasting_plasma_glucose] <col3>[int]:[smoking] <col4>[bool]:[body_mass_index_bmi] <col5>[float]:[age] <col6>[float]:[NOUSE] } | SELECT * FROM `<table0>` WHERE fasting_plasma_glucose < 240 | fasting plasma glucose < 240 mg / dl at screening
|
<table0>[party] { <col0>[Party_ID]:[VARCHAR] <col1>[Party]:[VARCHAR] } <table1>[election] { <col0>[Committee]:[VARCHAR] <col1>[Party]:[VARCHAR] } | SELECT T1.Committee FROM `<table1>` AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Democratic" INTERSECT SELECT T1.Committee FROM `<table1>` AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T2.Party = "Liberal" | Which committees have delegates from both democratic party and liberal party?
|
<table0>[ReviewTasks] { <col0>[number]:[ReviewTaskTypeId] <col1>[number]:[CreationDate] <col2>[time]:[DeletionDate] <col3>[time]:[ReviewTaskStateId] <col4>[number]:[PostId] <col5>[number]:[SuggestedEditId] <col6>[number]:[CompletedByReviewTaskId] } <table1>[Tags] { <col0>[number]:[TagName] <col1>[text]:[Count] <col2>[... | SELECT usere AS "user_link", TagWiki, Excerpt FROM ( SELECT COUNT( * ) AS TagWiki, h.OwnerUserId AS userw FROM `<table2>` AS p JOIN SuggestedEdits AS h ON p.Id = h.PostId WHERE p.PostTypeId = 5 GROUP BY h.OwnerUserId ) AS t1 RIGHT JOIN ( SELECT COUNT( * ) AS Excerpt, h.OwnerUserId AS usere FROM `<table2>` AS p JOIN Sug... | Tag wiki and excerpt edits per user.
|
<table0>[microbiologyevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[charttime]:[time] <col4>[spec_type_desc]:[text] <col5>[org_name]:[text] } <table1>[outputevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] ... | SELECT DISTINCT `<table2>`.`<table2>` FROM `<table2>` WHERE `<table2>`.event_type = '`<table7>`' AND `<table2>`.event_id IN ( SELECT `<table7>`.row_id FROM `<table7>` WHERE `<table7>`.icd9_code = ( SELECT `<table9>`.icd9_code FROM `<table9>` WHERE `<table9>`.short_title = 'dis of gallbladder nec' ) ) | tell me the cost for the dis of gallbladder nec diagnosis? |
<table0>[table_23840623_4] { <col0>[dirty_electric_grid_rocky_mountains__denver]:[VARCHAR] <col1>[epa_rated_combined_fuel_economy]:[VARCHAR] } | SELECT COUNT( dirty_electric_grid_rocky_mountains__denver_ ) FROM `<table0>` WHERE `<col1>` = "102 mpg-e ( 33kW-hrs/100mi )" | How many dirty electric grid rocky mountains (denver) vehicles have an epa rated combined fuel economy of 102 mpg-e (33kw-hrs/100mi)? |
<table0>[table_name_35] { <col0>[week]:[VARCHAR] <col1>[attendance]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "63,447" | Which Week has an Attendance of 63,447? |
<table0>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[text] <col4>[age]:[text] <col5>[dob]:[text] <col6>[gender]:[text] <col7>[language]:[text] <col8>[religion]:[text] <col9>[admission_type]:[text] <col10>[days_stay]:[text] <col11>[insurance]:[text] <col12>... | SELECT COUNT( DISTINCT `<table0>`.subject_id ) FROM `<table0>` INNER JOIN lab ON `<table0>`.hadm_id = lab.hadm_id WHERE `<table0>`.ethnicity = "WHITE" AND lab.label = "Hyaline Casts" | get me the number of white ethnic background patients who had hyaline casts lab test. |
<table0>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_cd]:[text] <col6>[route]:[text] <col7>[drug_dose]:[text] } <table1>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[t... | SELECT COUNT( DISTINCT `<table4>`.subject_id ) FROM `<table4>` INNER JOIN lab ON `<table4>`.hadm_id = lab.hadm_id WHERE `<table4>`.dob_year < "2043" AND lab.fluid = "Urine" | what is the number of patients whose year of birth is less than 2043 and lab test fluid is urine?
|
<table0>[course] { <col0>[course_id]:[int] <col1>[name]:[varchar] <col2>[department]:[varchar] <col3>[number]:[varchar] <col4>[credits]:[varchar] <col5>[advisory_requirement]:[varchar] <col6>[enforced_requirement]:[varchar] <col7>[description]:[varchar] <col8>[num_semesters]:[int] <col9>[num_enrolled]:[int] <col10>[has... | SELECT DISTINCT `<col1>` FROM `<table14>` WHERE NOT `<col1>` IN ( SELECT INSTRUCTORalias1.name FROM `<table0>` AS COURSEalias0 INNER JOIN `<table0>`_offering AS COURSE_OFFERINGalias0 ON COURSEalias0.`<table0>`_id = COURSE_OFFERINGalias0.`<table0>`_id INNER JOIN offering_`<table14>` AS OFFERING_INSTRUCTOR ON OFFERING_OF... | Who has not taught TURKISH 202 ?
|
<table0>[d_items] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] <col3>[linksto]:[text] } <table1>[d_icd_diagnoses] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table2>[admissions] { <col0>[row_id]:[number] <col1>[subject_id]:[numbe... | SELECT ( SELECT COUNT( DISTINCT t1.subject_id ) FROM ( SELECT admissions.subject_id, `<table8>`.charttime FROM `<table8>` JOIN admissions ON `<table8>`.hadm_id = admissions.hadm_id WHERE `<table8>`.icd9_code = ( SELECT `<table1>`.icd9_code FROM `<table1>` WHERE `<table1>`.short_title = 'esoph varice oth dis nos' ) AND ... | during this year, how many patients have not come back to the hospital within 2 months after diagnosed with esoph varice oth dis nos.
|
<table0>[PostsWithDeleted] { <col0>[number]:[PostTypeId] <col1>[number]:[AcceptedAnswerId] <col2>[number]:[ParentId] <col3>[number]:[CreationDate] <col4>[time]:[DeletionDate] <col5>[time]:[Score] <col6>[number]:[ViewCount] <col7>[number]:[Body] <col8>[text]:[OwnerUserId] <col9>[number]:[OwnerDisplayName] <col10>[text]:... | SELECT TagName, COUNT( * ) AS UpVotes FROM `<table21>` INNER JOIN Post`<table21>` ON Post`<table21>`.TagId = `<table21>`.Id INNER JOIN Posts ON Posts.ParentId = Post`<table21>`.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 WHERE Posts.OwnerUserId = @UserId GROUP BY TagName ORDER BY UpVotes DESC | -- How many upvotes do I have for each tag? -- how long before I get tag badges? DECLARE @UserId in.
|
<table0>[Rooms] { <col0>[RoomId]:[TEXT] <col1>[roomName]:[TEXT] <col2>[beds]:[INTEGER] <col3>[bedType]:[TEXT] <col4>[maxOccupancy]:[INTEGER] <col5>[basePrice]:[INTEGER] <col6>[decor]:[TEXT] } <table1>[Reservations] { <col0>[Code]:[INTEGER] <col1>[Room]:[TEXT] <col2>[CheckIn]:[TEXT] <col3>[CheckOut]:[TEXT] <col4>[Rate]... | SELECT bedType, COUNT( * ) FROM `<table0>` GROUP BY `<col3>` | Return a bar chart on what are the number of rooms for each bed type? |
<table0>[table_41054] { <col0>[Year]:[real] <col1>[Actor]:[text] <col2>[Award]:[text] <col3>[Motion]:[Picture] <col4>[text]:[Result] } | SELECT "Motion Picture" FROM `<table0>` WHERE "Year" > '2003' AND "Result" = 'nominated' AND "Actor" = 'viola davis' AND "Award" = 'best supporting actress' | What Motion Picture after 2003 had Viola Davis nominated for Best Supporting Actress?
|
<table0>[PostNoticeTypes] { <col0>[number]:[ClassId] <col1>[number]:[text] <col2>[Body]:[text] <col3>[IsHidden]:[boolean] <col4>[Predefined]:[boolean] <col5>[PostNoticeDurationId]:[number] } <table1>[PostHistoryTypes] { <col0>[number]:[text] } <table2>[CloseReasonTypes] { <col0>[number]:[text] <col1>[Description]:[te... | SELECT COUNT( * ) AS Volume, SUM( ViewCount ) AS PageViews, COUNT( DISTINCT OwnerUserId ) AS UniqueOPs, TIME_TO_STR( P.CreationDate, '%Y' ) AS "year", TIME_TO_STR( P.CreationDate, '%m' ) AS Month FROM `<table22>` AS P WHERE ( Tags LIKE '%<html5%' OR Tags LIKE '%<html-canvas>%' OR Tags LIKE '%<xhtml5>%' ) AND PostTypeId... | HTML5 thread volume, page views, unique OPs by month. |
<table0>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[text] <col4>[age]:[text] <col5>[dob]:[text] <col6>[gender]:[text] <col7>[language]:[text] <col8>[religion]:[text] <col9>[admission_type]:[text] <col10>[days_stay]:[text] <col11>[insurance]:[text] <col12>... | SELECT COUNT( DISTINCT `<table0>`.subject_id ) FROM `<table0>` INNER JOIN lab ON `<table0>`.hadm_id = lab.hadm_id WHERE `<table0>`.expire_flag = "0" AND lab.label = "Cortisol" | provide the number of patients whose death status is 0 and lab test name is cortisol? |
<table0>[patient] { <col0>[uniquepid]:[text] <col1>[patienthealthsystemstayid]:[number] <col2>[patientunitstayid]:[number] <col3>[gender]:[text] <col4>[age]:[text] <col5>[ethnicity]:[text] <col6>[hospitalid]:[number] <col7>[wardid]:[number] <col8>[admissionheight]:[number] <col9>[admissionweight]:[number] <col10>[disch... | SELECT COUNT( DISTINCT `<table0>`.uniquepid ) FROM `<table0>` WHERE `<table0>`.`<table0>`unitstayid IN ( SELECT `<table8>`.`<table0>`unitstayid FROM `<table8>` WHERE `<table8>`.drugname = 'amiodarone 900 mg in 500 ml d5w' AND STRFTIME( '%y', `<table8>`.drugstarttime ) = '2105' ) | just count how many patients have been prescribed amiodarone 900 mg in 500 ml d5w in 2105.
|
<table0>[properties] { <col0>[INT]:[city] <col1>[VARCHAR]:[listing_price] <col2>[FLOAT]:[INSERT] } | SELECT COUNT( * ) FROM `<table0>` WHERE city = 'Phoenix' AND listing_price > ( SELECT AVG( listing_price ) FROM `<table0>` WHERE city = 'Phoenix' ); | What is the total number of properties in the city of Phoenix that have a listing price above the median listing price? |
<table0>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_cd]:[text] <col6>[route]:[text] <col7>[drug_dose]:[text] } <table1>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3... | SELECT COUNT( DISTINCT `<table3>`.subject_id ) FROM `<table3>` INNER JOIN lab ON `<table3>`.hadm_id = lab.hadm_id WHERE `<table3>`.admission_type = "ELECTIVE" AND lab."CATEGORY" = "Chemistry" | tell me the number of elective hospital admission patients categorized under chemistry lab test. |
<table0>[open_data_initiatives] { <col0>[initiative_id]:[INT] <col1>[initiative_name]:[VARCHAR] <col2>[255]:[state] <col3>[VARCHAR]:[255] <col4>[region]:[VARCHAR] <col5>[255]:[launch_date] <col6>[DATE]:[INSERT] } | SELECT COUNT( * ) FROM `<table0>` WHERE `<col4>` = 'Northeast' AND launch_date >= DATEADD( year, -1, GETDATE( ) ); | What is the number of open data initiatives launched in the Northeast in the past year? |
<table0>[diagnoses] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table1>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table2>[prescr... | SELECT `<table3>`.age, `<table3>`.religion FROM `<table3>` WHERE `<table3>`.subject_id = "65652" | provide the age and religion of subject id 65652.
|
<table0>[SecureComm] { <col0>[CommunicationSales]:[INT] <col1>[manufacturer]:[VARCHAR] <col2>[255]:[model] <col3>[VARCHAR]:[255] <col4>[quantity]:[INT] <col5>[price]:[DECIMAL] <col6>[buyer_country]:[VARCHAR] <col7>[255]:[sale_date] } | SELECT MIN( price ) FROM SecureComm.CommunicationSales WHERE buyer_country = 'United States'; | What is the minimum price of military communication systems sold by SecureComm to the US government? |
<table0>[Equipment] { <col0>[EID]:[INT] <col1>[Type]:[VARCHAR] <col2>[VendorID]:[INT] <col3>[MaintenanceCost]:[INT] } <table1>[Vendors] { <col0>[VID]:[INT] <col1>[VARCHAR]:[100] } | SELECT v.Name, AVG( `<table0>`.MaintenanceCost ) as AvgMaintenanceCost, COUNT( DISTINCT `<table0>`.Type ) as Num`<table0>`Types FROM `<table0>` JOIN Vendors v ON `<table0>`.VendorID = v.VID GROUP BY v.Name ORDER BY AvgMaintenanceCost DESC; | Which vendors have the highest average maintenance costs for military equipment, and the number of different equipment types maintained by these vendors? |
<table0>[diagnoses_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table1>[inputevents_cv] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[charttime]:[time] <col5>[... | SELECT `<table14>`.short_title FROM `<table14>` WHERE `<table14>`.icd9_code IN ( SELECT t3.icd9_code FROM ( SELECT t2.icd9_code, DENSE_RANK( ) OVER ( ORDER BY COUNT( * ) DESC ) AS c1 FROM ( SELECT admissions.subject_id, `<table0>`.charttime, admissions.hadm_id FROM `<table0>` JOIN admissions ON `<table0>`.hadm_id = adm... | what are the top three most frequent procedures that patients received during the same hospital visit after being diagnosed with periph vascular dis nos during the last year? |
<table0>[takes] { <col0>[varchar]:[course_id] <col1>[varchar]:[sec_id] <col2>[varchar]:[semester] <col3>[varchar]:[year] <col4>[numeric]:[grade] } <table1>[instructor] { <col0>[varchar]:[name] <col1>[varchar]:[dept_name] <col2>[varchar]:[salary] } <table2>[course] { <col0>[course_id]:[varchar] <col1>[title]:[varchar]... | SELECT title, SUM( `<col3>` ) FROM `<table2>` AS T1 JOIN prereq AS T2 ON T1.`<table2>`_id = T2.`<table2>`_id GROUP BY `<col1>` ORDER BY `<col1>` | What is the sum of credit value of courses with more than one prerequisite for each title? Return a bar chart, rank in asc by the x-axis.
|
<table0>[table_2231241_1] { <col0>[seat_no_1]:[VARCHAR] <col1>[mayor]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "John J. Seguier" | Who is seat no 1 when the mayor was john j. seguier |
<table0>[state] { <col0>[state_code]:[text] <col1>[state_name]:[text] <col2>[country_name]:[text] } <table1>[ground_service] { <col0>[city_code]:[text] <col1>[airport_code]:[text] <col2>[transport_type]:[text] <col3>[ground_fare]:[int] } <table2>[equipment_sequence] { <col0>[aircraft_code_sequence]:[varchar] <col1>[a... | SELECT DISTINCT flight.flight_id FROM `<table22>` AS AIRPORT_SERVICE_0, `<table22>` AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CHARLOTTE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CLEVELAND' A... | show me all the flights from CHARLOTTE to CLEVELAND |
<table0>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[text] <col4>[age]:[text] <col5>[dob]:[text] <col6>[gender]:[text] <col7>[language]:[text] <col8>[religion]:[text] <col9>[admission_type]:[text] <col10>[days_stay]:[text] <col11>[insurance]:[text] <col12>... | SELECT COUNT( DISTINCT `<table0>`.subject_id ) FROM `<table0>` WHERE `<table0>`.discharge_location = "DEAD/EXPIRED" | count the number of patients whose discharge location is dead/expired. |
<table0>[table_48510] { <col0>[Year]:[real] <col1>[Award]:[text] <col2>[Nominated]:[Work] <col3>[text]:[Category] <col4>[text]:[Result] } | SELECT "Award" FROM `<table0>` WHERE "Category" = 'cabello maluco' | What is Award, when Category is Cabello Maluco?
|
<table0>[allergy_type] { <col0>[allergy]:[text] <col1>[allergytype]:[text] } <table1>[student] { <col0>[stuid]:[number] <col1>[lname]:[text] <col2>[fname]:[text] <col3>[age]:[number] <col4>[sex]:[text] <col5>[major]:[number] <col6>[advisor]:[number] <col7>[city_code]:[text] } <table2>[has_allergy] { <col0>[stuid]:[nu... | SELECT fname, lname, `<col3>` FROM `<table1>` WHERE `<col4>` = 'F' | What are the full names and ages for all female students whose sex is F? |
<table0>[table_2616] { <col0>[Stage]:[real] <col1>[Stage]:[winner] <col2>[text]:[General] <col3>[classification]:[text] <col4>[Points]:[classification] <col5>[text]:[Mountains] <col6>[classification]:[text] <col7>[Malaysian]:[rider] <col8>[classification]:[text] <col9>[Team]:[classification] <col10>[text]:[Malaysian] <... | SELECT "Team classification" FROM `<table0>` WHERE "Stage winner" = 'Taiji Nishitani' | Which team classification has taiji nishitani as the stage winner? |
<table0>[documents_with_expenses] { <col0>[document_id]:[number] <col1>[budget_type_code]:[text] <col2>[document_details]:[text] } <table1>[ref_document_types] { <col0>[document_type_code]:[text] <col1>[document_type_name]:[text] <col2>[document_type_description]:[text] } <table2>[ref_budget_codes] { <col0>[budget_ty... | SELECT T1.statement_id, T2.statement_details, T1.account_details FROM `<table4>` AS T1 JOIN statements AS T2 ON T1.statement_id = T2.statement_id | What are the statement ids, statement details, and account details, for all accounts? |
<table0>[employee] { <col0>[employee_id]:[integer] <col1>[first_name]:[text] <col2>[last_name]:[text] <col3>[address]:[text] <col4>[city]:[text] <col5>[state]:[text] <col6>[zip]:[integer] <col7>[phone]:[text] <col8>[title]:[text] <col9>[salary]:[integer] <col10>[supervisor]:[integer] } <table1>[establishment] { <col0>... | SELECT SUM( T3.fine ) FROM `<table1>` AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no INNER JOIN violation AS T3 ON T2.inspection_id = T3.inspection_id WHERE T1.dba_name = 'HACIENDA LOS TORRES' AND T1.ward = 36 AND T2.results = 'Fail' | How much did Hacienda Los Torres from ward 36 fine for failing an inspection? |
<table0>[film] { <col0>[Studio]:[VARCHAR] <col1>[Gross_in_dollar]:[INTEGER] } | SELECT `<col0>` FROM `<table0>` GROUP BY `<col0>` HAVING AVG( `<col1>` ) >= 4500000 | List the studios which average gross is above 4500000. |
<table0>[lab] { <col0>[labid]:[number] <col1>[patientunitstayid]:[number] <col2>[labname]:[text] <col3>[labresult]:[number] <col4>[labresulttime]:[time] } <table1>[intakeoutput] { <col0>[intakeoutputid]:[number] <col1>[patientunitstayid]:[number] <col2>[cellpath]:[text] <col3>[celllabel]:[text] <col4>[cellvaluenumeric... | SELECT `<table8>`.hospitaldischargetime FROM `<table8>` WHERE `<table8>`.uniquepid = '006-83902' AND STRFTIME( '%y', `<table8>`.hospitaldischargetime ) = '2102' ORDER BY `<table8>`.hospitaldischargetime LIMIT 1 | when patient 006-83902 has left the hospital the first time in 2102? |
<table0>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_cd]:[text] <col6>[route]:[text] <col7>[drug_dose]:[text] } <table1>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text]... | SELECT COUNT( DISTINCT `<table1>`.subject_id ) FROM `<table1>` INNER JOIN diagnoses ON `<table1>`.hadm_id = diagnoses.hadm_id WHERE `<table1>`.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.long_title = "Acidosis" | provide the number of patients whose admission location is clinic referral/premature and diagnoses long title is acidosis?
|
<table0>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[text] <col4>[age]:[text] <col5>[dob]:[text] <col6>[gender]:[text] <col7>[language]:[text] <col8>[religion]:[text] <col9>[admission_type]:[text] <col10>[days_stay]:[text] <col11>[insurance]:[text] <col12>... | SELECT COUNT( DISTINCT `<table0>`.subject_id ) FROM `<table0>` WHERE `<table0>`.diagnosis = "PNEUMONIA" AND `<table0>`.dod_year <= "2155.0" | count the number of patients whose primary disease is pneumonia and who died in or before year 2155.
|
<table0>[table_204_513] { <col0>[number]:[date] <col1>[text]:[time] <col2>[text]:[opponent] <col3>[text]:[site] <col4>[text]:[text] <col5>[result]:[text] <col6>[attendance]:[number] } | SELECT COUNT( * ) FROM `<table0>` WHERE "attendance" > 30000 | how many times is attendance over 30,000 ?
|
<table0>[table_71054] { <col0>[Date]:[text] <col1>[City]:[text] <col2>[Event]:[text] <col3>[Winner]:[text] <col4>[Prize]:[text] } | SELECT "Event" FROM `<table0>` WHERE "City" = 'copenhagen' | What was the Event in the city of copenhagen?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.