schema
stringlengths
20
14.6k
query
stringlengths
17
2.58k
question
stringlengths
8
1.06k
<table0>[table_name_30] { <col0>[stadium]:[VARCHAR] <col1>[final_score]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "27-34"
In what stadium did a game result in a final scoreline reading 27-34?
<table0>[graduate_students] { <col0>[student_id]:[INT] <col1>[name]:[VARCHAR] <col2>[country]:[VARCHAR] } <table1>[research_grants] { <col0>[grant_id]:[INT] <col1>[student_id]:[INT] <col2>[INT]:[INSERT] }
SELECT SUM( rg.amount ) FROM `<table1>` rg JOIN graduate_students gs ON rg.student_id = gs.student_id WHERE gs.country = 'USA';
What is the total number of research grants awarded to graduate students from the United States?
<table0>[diagnoses_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table1>[admissions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[admittime]:[time] <col4>[dischtime]:[time] <col5>[admission_type]:[text] <col6>[admission_location]:[text] <col7>[discharge_location]:[text] <col8>[insurance]:[text] <col9>[language]:[text] <col10>[marital_status]:[text] <col11>[ethnicity]:[text] <col12>[age]:[number] } <table2>[d_icd_diagnoses] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table3>[labevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[itemid]:[number] <col4>[charttime]:[time] <col5>[valuenum]:[number] <col6>[valueuom]:[text] } <table4>[prescriptions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[startdate]:[time] <col4>[enddate]:[time] <col5>[drug]:[text] <col6>[dose_val_rx]:[text] <col7>[dose_unit_rx]:[text] <col8>[route]:[text] } <table5>[inputevents_cv] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[charttime]:[time] <col5>[itemid]:[number] } <table6>[outputevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[charttime]:[time] <col5>[itemid]:[number] <col6>[value]:[number] } <table7>[transfers] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[eventtype]:[text] <col5>[careunit]:[text] <col6>[wardid]:[number] <col7>[intime]:[time] <col8>[outtime]:[time] } <table8>[patients] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[gender]:[text] <col3>[dob]:[time] <col4>[dod]:[time] } <table9>[d_items] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] <col3>[linksto]:[text] } <table10>[procedures_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table11>[d_icd_procedures] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table12>[d_labitems] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] } <table13>[chartevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[itemid]:[number] <col5>[charttime]:[time] <col6>[valuenum]:[number] <col7>[valueuom]:[text] } <table14>[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] } <table15>[cost] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[event_type]:[text] <col4>[event_id]:[number] <col5>[chargetime]:[time] } <table16>[icustays] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[first_careunit]:[text] <col5>[last_careunit]:[text] <col6>[first_wardid]:[number] <col7>[last_wardid]:[number] <col8>[intime]:[time] <col9>[outtime]:[time] }
SELECT COUNT( DISTINCT t1.subject_id ) FROM ( SELECT admissions.subject_id, `<table0>`.charttime FROM `<table0>` JOIN admissions ON `<table0>`.hadm_id = admissions.hadm_id WHERE `<table0>`.icd9_code = ( SELECT `<table2>`.icd9_code FROM `<table2>` WHERE `<table2>`.short_title = 'adv eff antilipemics' ) AND DATETIME( `<table0>`.charttime ) >= DATETIME( CURRENT_TIME( ), '-4 year' ) ) AS t1 JOIN ( SELECT admissions.subject_id, `<table0>`.charttime FROM `<table0>` JOIN admissions ON `<table0>`.hadm_id = admissions.hadm_id WHERE `<table0>`.icd9_code = ( SELECT `<table2>`.icd9_code FROM `<table2>` WHERE `<table2>`.short_title = 'food/vomit pneumonitis' ) AND DATETIME( `<table0>`.charttime ) >= DATETIME( CURRENT_TIME( ), '-4 year' ) ) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND DATETIME( t1.charttime, 'start of month' ) = DATETIME( t2.charttime, 'start of month' )
since 4 years ago, how many patients were diagnosed with food/vomit pneumonitis during the same month after the previous diagnosis of adv eff antilipemics?
<table0>[table_name_94] { <col0>[state]:[VARCHAR] <col1>[title]:[VARCHAR] <col2>[royal_house]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "duke" AND `<col2>` = "ji"
What state had a title of duke for the royal house of ji?
<table0>[table_204_295] { <col0>[number]:[model] <col1>[text]:[origin] <col2>[text]:[type] <col3>[text]:[version] <col4>[text]:[service] <col5>[number]:[notes] }
SELECT COUNT( "model" ) FROM `<table0>`
what is the total number of models listed ?
<table0>[Africa_Carbon_Offset] { <col0>[project]:[VARCHAR] <col1>[255]:[carbon_offset] <col2>[INT]:[INSERT] }
SELECT project, carbon_offset FROM `<table0>` ORDER BY carbon_offset DESC;
Show the carbon offset projects in Africa, sorted by the amount of carbon offset in descending order.
<table0>[table_name_59] { <col0>[grid]:[VARCHAR] <col1>[rider]:[VARCHAR] <col2>[laps]:[VARCHAR] }
SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "fonsi nieto" AND `<col2>` > 22
What is the total grid number when Fonsi Nieto had more than 22 laps?
<table0>[project_solar] { <col0>[project_name]:[TEXT] <col1>[country]:[TEXT] }
SELECT country, COUNT( * ) FROM `<table0>` GROUP BY `<col1>` ORDER BY COUNT( * ) DESC;
Which countries have the most solar power projects?
<table0>[indian_ocean_species] { <col0>[species]:[TEXT] <col1>[biomass]:[INT] }
SELECT SUM( `<col1>` ) FROM `<table0>` WHERE `<col1>` >= 100;
What is the total biomass of all species in the Indian Ocean, excluding species with a biomass less than 100?
<table0>[table_name_19] { <col0>[new_channel_s]:[VARCHAR] <col1>[programme]:[VARCHAR] }
SELECT new_channel_s_ FROM `<table0>` WHERE `<col1>` = "gladiators"
What channel is Gladiators on?
<table0>[table_72476] { <col0>[Locale]:[text] <col1>[Skip]:[text] <col2>[real]:[real] <col3>[real]:[real] <col4>[Ends]:[Won] <col5>[real]:[Ends] <col6>[Lost]:[real] <col7>[Blank]:[Ends] <col8>[real]:[Stolen] <col9>[Ends]:[real] <col10>[Shot]:[Pct] }
SELECT MIN( "PA" ) FROM `<table0>` WHERE "Ends Lost" = '45'
What is the minimum PA when ends lost is 45?
<table0>[table_name_65] { <col0>[language]:[VARCHAR] <col1>[draw]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 9
What's the language of Draw number 9?
<table0>[ground_service] { <col0>[city_code]:[text] <col1>[airport_code]:[text] <col2>[transport_type]:[text] <col3>[ground_fare]:[int] } <table1>[class_of_service] { <col0>[booking_class]:[varchar] <col1>[rank]:[int] <col2>[class_description]:[text] } <table2>[state] { <col0>[state_code]:[text] <col1>[state_name]:[text] <col2>[country_name]:[text] } <table3>[flight_fare] { <col0>[flight_id]:[int] <col1>[fare_id]:[int] } <table4>[flight_leg] { <col0>[flight_id]:[int] <col1>[leg_number]:[int] <col2>[leg_flight]:[int] } <table5>[food_service] { <col0>[meal_code]:[text] <col1>[meal_number]:[int] <col2>[compartment]:[text] <col3>[meal_description]:[varchar] } <table6>[equipment_sequence] { <col0>[aircraft_code_sequence]:[varchar] <col1>[aircraft_code]:[varchar] } <table7>[airline] { <col0>[airline_code]:[varchar] <col1>[airline_name]:[text] <col2>[note]:[text] } <table8>[date_day] { <col0>[month_number]:[int] <col1>[day_number]:[int] <col2>[year]:[int] <col3>[day_name]:[varchar] } <table9>[dual_carrier] { <col0>[main_airline]:[varchar] <col1>[low_flight_number]:[int] <col2>[high_flight_number]:[int] <col3>[dual_airline]:[varchar] <col4>[service_name]:[text] } <table10>[fare] { <col0>[fare_id]:[int] <col1>[from_airport]:[varchar] <col2>[to_airport]:[varchar] <col3>[fare_basis_code]:[text] <col4>[fare_airline]:[text] <col5>[restriction_code]:[text] <col6>[one_direction_cost]:[int] <col7>[round_trip_cost]:[int] <col8>[round_trip_required]:[varchar] } <table11>[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] <col10>[stop_time]:[int] } <table12>[flight] { <col0>[aircraft_code_sequence]:[text] <col1>[airline_code]:[varchar] } <table13>[code_description] { <col0>[code]:[varchar] <col1>[description]:[text] } <table14>[airport_service] { <col0>[city_code]:[varchar] <col1>[airport_code]:[varchar] <col2>[miles_distant]:[int] <col3>[direction]:[varchar] <col4>[minutes_distant]:[int] } <table15>[aircraft] { <col0>[aircraft_code]:[varchar] <col1>[aircraft_description]:[varchar] <col2>[manufacturer]:[varchar] <col3>[basic_type]:[varchar] <col4>[engines]:[int] <col5>[propulsion]:[varchar] <col6>[wide_body]:[varchar] <col7>[wing_span]:[int] <col8>[length]:[int] <col9>[weight]:[int] <col10>[capacity]:[int] <col11>[pay_load]:[int] <col12>[cruising_speed]:[int] <col13>[range_miles]:[int] <col14>[pressurized]:[varchar] } <table16>[city] { <col0>[city_code]:[varchar] <col1>[city_name]:[varchar] <col2>[state_code]:[varchar] <col3>[country_name]:[varchar] <col4>[time_zone_code]:[varchar] } <table17>[compartment_class] { <col0>[compartment]:[varchar] <col1>[class_type]:[varchar] } <table18>[airport] { <col0>[airport_code]:[varchar] <col1>[airport_name]:[text] <col2>[airport_location]:[text] <col3>[state_code]:[varchar] <col4>[country_name]:[varchar] <col5>[time_zone_code]:[varchar] <col6>[minimum_connect_time]:[int] } <table19>[days] { <col0>[days_code]:[varchar] <col1>[day_name]:[varchar] } <table20>[fare_basis] { <col0>[fare_basis_code]:[text] <col1>[booking_class]:[text] <col2>[class_type]:[text] <col3>[premium]:[text] <col4>[economy]:[text] <col5>[discounted]:[text] <col6>[night]:[text] <col7>[season]:[text] <col8>[basis_days]:[text] } <table21>[time_interval] { <col0>[period]:[text] <col1>[begin_time]:[int] <col2>[end_time]:[int] } <table22>[time_zone] { <col0>[time_zone_code]:[text] <col1>[time_zone_name]:[text] <col2>[hours_from_gmt]:[int] } <table23>[month] { <col0>[month_number]:[int] <col1>[month_name]:[text] } <table24>[restriction] { <col0>[restriction_code]:[text] <col1>[advance_purchase]:[int] <col2>[stopovers]:[text] <col3>[saturday_stay_required]:[text] <col4>[minimum_stay]:[int] <col5>[maximum_stay]:[int] <col6>[application]:[text] <col7>[no_discounts]:[text] }
SELECT DISTINCT `<table15>`_code FROM `<table15>` WHERE `<table15>`_code = 'M80'
what is the seating capacity of the M80
<table0>[districts] { <col0>[INT]:[name] <col1>[VARCHAR]:[255] } <table1>[calls] { <col0>[cid]:[INT] <col1>[INT]:[time] <col2>[DATETIME]:[response_time] <col3>[INT]:[INSERT] <col4>[districts]:[VALUES] <col5>[Downtown]:[Uptown] }
SELECT d.name, AVG( c.response_time ) as avg_response_time FROM `<table0>` d JOIN calls c ON d.did = c.did GROUP BY d.did;
What is the average response time for emergency calls in each city district?
<table0>[table_256286_45] { <col0>[no_votes]:[VARCHAR] <col1>[description]:[VARCHAR] }
SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "Forest Rehabilitation Debt Limit Amendment"
How many figures are there for No votes for the Forest Rehabilitation Debt Limit Amendment?
<table0>[bridge_construction] { <col0>[INT]:[project_name] <col1>[TEXT]:[location] <col2>[TEXT]:[cost] <col3>[INT]:[completion_date] <col4>[DATE]:[INSERT] }
SELECT SUM( cost ) FROM `<table0>` WHERE location = 'Texas' AND YEAR( completion_date ) = 2018;
What was the total cost of bridge construction projects in 'Texas' in 2018?
<table0>[PostFeedback] { <col0>[number]:[PostId] <col1>[number]:[IsAnonymous] <col2>[boolean]:[VoteTypeId] <col3>[number]:[CreationDate] } <table1>[PostLinks] { <col0>[number]:[CreationDate] <col1>[time]:[PostId] <col2>[number]:[RelatedPostId] <col3>[number]:[LinkTypeId] } <table2>[SuggestedEdits] { <col0>[number]:[PostId] <col1>[number]:[CreationDate] <col2>[time]:[ApprovalDate] <col3>[time]:[RejectionDate] <col4>[time]:[OwnerUserId] <col5>[number]:[Comment] <col6>[text]:[Text] <col7>[text]:[Title] <col8>[text]:[Tags] <col9>[text]:[RevisionGUID] } <table3>[Badges] { <col0>[number]:[UserId] <col1>[number]:[text] <col2>[Date]:[time] <col3>[Class]:[number] <col4>[TagBased]:[boolean] } <table4>[ReviewRejectionReasons] { <col0>[number]:[text] <col1>[Description]:[text] <col2>[PostTypeId]:[number] } <table5>[PostTypes] { <col0>[number]:[text] } <table6>[ReviewTaskStates] { <col0>[number]:[text] <col1>[Description]:[text] } <table7>[CloseReasonTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table8>[PostHistory] { <col0>[number]:[PostHistoryTypeId] <col1>[number]:[PostId] <col2>[number]:[RevisionGUID] <col3>[CreationDate]:[time] <col4>[UserId]:[number] <col5>[UserDisplayName]:[text] <col6>[Comment]:[text] <col7>[Text]:[text] <col8>[ContentLicense]:[text] } <table9>[Users] { <col0>[number]:[Reputation] <col1>[number]:[CreationDate] <col2>[time]:[DisplayName] <col3>[text]:[LastAccessDate] <col4>[time]:[WebsiteUrl] <col5>[text]:[Location] <col6>[text]:[AboutMe] <col7>[text]:[Views] <col8>[number]:[UpVotes] <col9>[number]:[DownVotes] <col10>[number]:[ProfileImageUrl] <col11>[text]:[EmailHash] <col12>[text]:[AccountId] } <table10>[FlagTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table11>[TagSynonyms] { <col0>[number]:[SourceTagName] <col1>[text]:[TargetTagName] <col2>[text]:[CreationDate] <col3>[time]:[OwnerUserId] <col4>[number]:[AutoRenameCount] <col5>[number]:[LastAutoRename] <col6>[time]:[Score] <col7>[number]:[ApprovedByUserId] <col8>[number]:[ApprovalDate] } <table12>[PostHistoryTypes] { <col0>[number]:[text] } <table13>[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]:[LastEditorUserId] <col11>[number]:[LastEditorDisplayName] <col12>[text]:[LastEditDate] <col13>[time]:[LastActivityDate] <col14>[time]:[Title] <col15>[text]:[Tags] <col16>[text]:[AnswerCount] <col17>[number]:[CommentCount] <col18>[number]:[FavoriteCount] <col19>[number]:[ClosedDate] <col20>[time]:[CommunityOwnedDate] <col21>[time]:[ContentLicense] } <table14>[PostNotices] { <col0>[number]:[PostId] <col1>[number]:[PostNoticeTypeId] <col2>[number]:[CreationDate] <col3>[time]:[DeletionDate] <col4>[time]:[ExpiryDate] <col5>[time]:[Body] <col6>[text]:[OwnerUserId] <col7>[number]:[DeletionUserId] } <table15>[PendingFlags] { <col0>[number]:[FlagTypeId] <col1>[number]:[PostId] <col2>[number]:[CreationDate] <col3>[time]:[CloseReasonTypeId] <col4>[number]:[CloseAsOffTopicReasonTypeId] <col5>[number]:[DuplicateOfQuestionId] <col6>[number]:[BelongsOnBaseHostAddress] } <table16>[PostNoticeTypes] { <col0>[number]:[ClassId] <col1>[number]:[text] <col2>[Body]:[text] <col3>[IsHidden]:[boolean] <col4>[Predefined]:[boolean] <col5>[PostNoticeDurationId]:[number] } <table17>[SuggestedEditVotes] { <col0>[number]:[SuggestedEditId] <col1>[number]:[UserId] <col2>[number]:[VoteTypeId] <col3>[number]:[CreationDate] <col4>[time]:[TargetUserId] <col5>[number]:[TargetRepChange] } <table18>[VoteTypes] { <col0>[number]:[text] } <table19>[ReviewTasks] { <col0>[number]:[ReviewTaskTypeId] <col1>[number]:[CreationDate] <col2>[time]:[DeletionDate] <col3>[time]:[ReviewTaskStateId] <col4>[number]:[PostId] <col5>[number]:[SuggestedEditId] <col6>[number]:[CompletedByReviewTaskId] } <table20>[ReviewTaskResults] { <col0>[number]:[ReviewTaskId] <col1>[number]:[ReviewTaskResultTypeId] <col2>[number]:[CreationDate] <col3>[time]:[RejectionReasonId] <col4>[number]:[Comment] } <table21>[Comments] { <col0>[number]:[PostId] <col1>[number]:[Score] <col2>[number]:[Text] <col3>[text]:[CreationDate] <col4>[time]:[UserDisplayName] <col5>[text]:[UserId] <col6>[number]:[ContentLicense] } <table22>[Tags] { <col0>[number]:[TagName] <col1>[text]:[Count] <col2>[number]:[ExcerptPostId] <col3>[number]:[WikiPostId] } <table23>[Posts] { <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]:[LastEditorUserId] <col11>[number]:[LastEditorDisplayName] <col12>[text]:[LastEditDate] <col13>[time]:[LastActivityDate] <col14>[time]:[Title] <col15>[text]:[Tags] <col16>[text]:[AnswerCount] <col17>[number]:[CommentCount] <col18>[number]:[FavoriteCount] <col19>[number]:[ClosedDate] <col20>[time]:[CommunityOwnedDate] <col21>[time]:[ContentLicense] } <table24>[Votes] { <col0>[number]:[PostId] <col1>[number]:[VoteTypeId] <col2>[number]:[UserId] <col3>[number]:[CreationDate] <col4>[time]:[BountyAmount] } <table25>[CloseAsOffTopicReasonTypes] { <col0>[number]:[IsUniversal] <col1>[boolean]:[InputTitle] <col2>[text]:[MarkdownInputGuidance] <col3>[text]:[MarkdownPostOwnerGuidance] <col4>[text]:[MarkdownPrivilegedUserGuidance] <col5>[text]:[MarkdownConcensusDescription] <col6>[text]:[CreationDate] <col7>[time]:[CreationModeratorId] <col8>[number]:[ApprovalDate] <col9>[time]:[ApprovalModeratorId] <col10>[number]:[DeactivationDate] <col11>[time]:[DeactivationModeratorId] } <table26>[ReviewTaskResultTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table27>[ReviewTaskTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table28>[PostTags] { <col0>[PostId]:[number] <col1>[TagId]:[number] }
SELECT AnswerCount AS "answers", Id AS "post_link", CommentCount AS "comments" FROM `<table23>` ORDER BY AnswerCount DESC LIMIT 20
Top 20 Most Answered Questions. Top 20 Most Answered Questions on your site. This is intended for sites like Puzzling.SE or Code Golf, but it should work anywhere.
<table0>[Part_Faults] { <col0>[part_id]:[VARCHAR] <col1>[part_fault_id]:[VARCHAR] } <table1>[Skills_Required_To_Fix] { <col0>[part_fault_id]:[VARCHAR] } <table2>[Parts] { <col0>[part_id]:[VARCHAR] <col1>[part_name]:[VARCHAR] }
SELECT T1.part_id, T1.part_name FROM `<table2>` AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id JOIN Skills_Required_To_Fix AS T3 ON T2.part_fault_id = T3.part_fault_id GROUP BY T1.part_id ORDER BY COUNT( * ) DESC LIMIT 1
Which part fault requires the most number of skills to fix? List part id and name.
<table0>[table_15598] { <col0>[1910s]:[real] <col1>[1920s]:[real] <col2>[1930s]:[real] <col3>[1940s]:[real] <col4>[1950s]:[real] <col5>[1960s]:[real] <col6>[1970s]:[real] <col7>[1980s]:[real] <col8>[1990s]:[real] <col9>[2000s]:[real] }
SELECT MIN( "1910s" ) FROM `<table0>` WHERE "1950s" < '1952' AND "1980s" > '1981'
what is the lowest year in the 1910s that would be in the row were the 1950s are no larger than 1952, and the 1980s are no smaller than 1981?
<table0>[Contractors] { <col0>[INT]:[VARCHAR] <col1>[LicenseNumber]:[VARCHAR] <col2>[City]:[VARCHAR] <col3>[State]:[VARCHAR] <col4>[Specialty]:[VARCHAR] } <table1>[ContractorProjects] { <col0>[ContractorId]:[INT] <col1>[ProjectId]:[INT] <col2>[ContractStartDate]:[DATE] <col3>[ContractEndDate]:[DATE] <col4>[ContractAmount]:[DECIMAL] } <table2>[Projects] { <col0>[INT]:[VARCHAR] <col1>[City]:[VARCHAR] <col2>[StartDate]:[DATE] <col3>[EndDate]:[DATE] <col4>[Sustainable]:[BOOLEAN] }
SELECT AVG( cp.ContractAmount ) FROM `<table1>` cp JOIN Contractors c ON cp.ContractorId = c.Id JOIN Projects p ON cp.ProjectId = p.Id WHERE c.State = 'CA' AND c.LicenseNumber IS NOT NULL AND p.Specialty = 'Plumbing';
What is the average contract amount for plumbing projects managed by contractors from California?
<table0>[Comments] { <col0>[number]:[PostId] <col1>[number]:[Score] <col2>[number]:[Text] <col3>[text]:[CreationDate] <col4>[time]:[UserDisplayName] <col5>[text]:[UserId] <col6>[number]:[ContentLicense] } <table1>[Badges] { <col0>[number]:[UserId] <col1>[number]:[text] <col2>[Date]:[time] <col3>[Class]:[number] <col4>[TagBased]:[boolean] } <table2>[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]:[LastEditorUserId] <col11>[number]:[LastEditorDisplayName] <col12>[text]:[LastEditDate] <col13>[time]:[LastActivityDate] <col14>[time]:[Title] <col15>[text]:[Tags] <col16>[text]:[AnswerCount] <col17>[number]:[CommentCount] <col18>[number]:[FavoriteCount] <col19>[number]:[ClosedDate] <col20>[time]:[CommunityOwnedDate] <col21>[time]:[ContentLicense] } <table3>[SuggestedEdits] { <col0>[number]:[PostId] <col1>[number]:[CreationDate] <col2>[time]:[ApprovalDate] <col3>[time]:[RejectionDate] <col4>[time]:[OwnerUserId] <col5>[number]:[Comment] <col6>[text]:[Text] <col7>[text]:[Title] <col8>[text]:[Tags] <col9>[text]:[RevisionGUID] } <table4>[Users] { <col0>[number]:[Reputation] <col1>[number]:[CreationDate] <col2>[time]:[DisplayName] <col3>[text]:[LastAccessDate] <col4>[time]:[WebsiteUrl] <col5>[text]:[Location] <col6>[text]:[AboutMe] <col7>[text]:[Views] <col8>[number]:[UpVotes] <col9>[number]:[DownVotes] <col10>[number]:[ProfileImageUrl] <col11>[text]:[EmailHash] <col12>[text]:[AccountId] } <table5>[PostNoticeTypes] { <col0>[number]:[ClassId] <col1>[number]:[text] <col2>[Body]:[text] <col3>[IsHidden]:[boolean] <col4>[Predefined]:[boolean] <col5>[PostNoticeDurationId]:[number] } <table6>[PostHistoryTypes] { <col0>[number]:[text] } <table7>[PostTags] { <col0>[PostId]:[number] <col1>[TagId]:[number] } <table8>[PostFeedback] { <col0>[number]:[PostId] <col1>[number]:[IsAnonymous] <col2>[boolean]:[VoteTypeId] <col3>[number]:[CreationDate] } <table9>[SuggestedEditVotes] { <col0>[number]:[SuggestedEditId] <col1>[number]:[UserId] <col2>[number]:[VoteTypeId] <col3>[number]:[CreationDate] <col4>[time]:[TargetUserId] <col5>[number]:[TargetRepChange] } <table10>[VoteTypes] { <col0>[number]:[text] } <table11>[Tags] { <col0>[number]:[TagName] <col1>[text]:[Count] <col2>[number]:[ExcerptPostId] <col3>[number]:[WikiPostId] } <table12>[ReviewTaskResults] { <col0>[number]:[ReviewTaskId] <col1>[number]:[ReviewTaskResultTypeId] <col2>[number]:[CreationDate] <col3>[time]:[RejectionReasonId] <col4>[number]:[Comment] } <table13>[FlagTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table14>[TagSynonyms] { <col0>[number]:[SourceTagName] <col1>[text]:[TargetTagName] <col2>[text]:[CreationDate] <col3>[time]:[OwnerUserId] <col4>[number]:[AutoRenameCount] <col5>[number]:[LastAutoRename] <col6>[time]:[Score] <col7>[number]:[ApprovedByUserId] <col8>[number]:[ApprovalDate] } <table15>[PendingFlags] { <col0>[number]:[FlagTypeId] <col1>[number]:[PostId] <col2>[number]:[CreationDate] <col3>[time]:[CloseReasonTypeId] <col4>[number]:[CloseAsOffTopicReasonTypeId] <col5>[number]:[DuplicateOfQuestionId] <col6>[number]:[BelongsOnBaseHostAddress] } <table16>[ReviewRejectionReasons] { <col0>[number]:[text] <col1>[Description]:[text] <col2>[PostTypeId]:[number] } <table17>[PostTypes] { <col0>[number]:[text] } <table18>[PostLinks] { <col0>[number]:[CreationDate] <col1>[time]:[PostId] <col2>[number]:[RelatedPostId] <col3>[number]:[LinkTypeId] } <table19>[PostHistory] { <col0>[number]:[PostHistoryTypeId] <col1>[number]:[PostId] <col2>[number]:[RevisionGUID] <col3>[CreationDate]:[time] <col4>[UserId]:[number] <col5>[UserDisplayName]:[text] <col6>[Comment]:[text] <col7>[Text]:[text] <col8>[ContentLicense]:[text] } <table20>[CloseAsOffTopicReasonTypes] { <col0>[number]:[IsUniversal] <col1>[boolean]:[InputTitle] <col2>[text]:[MarkdownInputGuidance] <col3>[text]:[MarkdownPostOwnerGuidance] <col4>[text]:[MarkdownPrivilegedUserGuidance] <col5>[text]:[MarkdownConcensusDescription] <col6>[text]:[CreationDate] <col7>[time]:[CreationModeratorId] <col8>[number]:[ApprovalDate] <col9>[time]:[ApprovalModeratorId] <col10>[number]:[DeactivationDate] <col11>[time]:[DeactivationModeratorId] } <table21>[ReviewTaskStates] { <col0>[number]:[text] <col1>[Description]:[text] } <table22>[Posts] { <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]:[LastEditorUserId] <col11>[number]:[LastEditorDisplayName] <col12>[text]:[LastEditDate] <col13>[time]:[LastActivityDate] <col14>[time]:[Title] <col15>[text]:[Tags] <col16>[text]:[AnswerCount] <col17>[number]:[CommentCount] <col18>[number]:[FavoriteCount] <col19>[number]:[ClosedDate] <col20>[time]:[CommunityOwnedDate] <col21>[time]:[ContentLicense] } <table23>[ReviewTaskTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table24>[PostNotices] { <col0>[number]:[PostId] <col1>[number]:[PostNoticeTypeId] <col2>[number]:[CreationDate] <col3>[time]:[DeletionDate] <col4>[time]:[ExpiryDate] <col5>[time]:[Body] <col6>[text]:[OwnerUserId] <col7>[number]:[DeletionUserId] } <table25>[ReviewTasks] { <col0>[number]:[ReviewTaskTypeId] <col1>[number]:[CreationDate] <col2>[time]:[DeletionDate] <col3>[time]:[ReviewTaskStateId] <col4>[number]:[PostId] <col5>[number]:[SuggestedEditId] <col6>[number]:[CompletedByReviewTaskId] } <table26>[Votes] { <col0>[number]:[PostId] <col1>[number]:[VoteTypeId] <col2>[number]:[UserId] <col3>[number]:[CreationDate] <col4>[time]:[BountyAmount] } <table27>[CloseReasonTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table28>[ReviewTaskResultTypes] { <col0>[number]:[text] <col1>[Description]:[text] }
SELECT Id AS "post_link", OwnerUserId AS "user_link", Score, Body FROM `<table22>` WHERE Body LIKE '%http%##ext?jpg##%' AND LastActivityDate >= '##Date1?2019-01-01##' AND LastActivityDate <= '##Date2?2020-01-01##' ORDER BY Id
Posts with links to files with particular extension (by LastActivityDate).
<table0>[inputevents_cv] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[charttime]:[time] <col5>[itemid]:[number] } <table1>[chartevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[itemid]:[number] <col5>[charttime]:[time] <col6>[valuenum]:[number] <col7>[valueuom]:[text] } <table2>[transfers] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[eventtype]:[text] <col5>[careunit]:[text] <col6>[wardid]:[number] <col7>[intime]:[time] <col8>[outtime]:[time] } <table3>[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] } <table4>[d_labitems] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] } <table5>[prescriptions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[startdate]:[time] <col4>[enddate]:[time] <col5>[drug]:[text] <col6>[dose_val_rx]:[text] <col7>[dose_unit_rx]:[text] <col8>[route]:[text] } <table6>[cost] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[event_type]:[text] <col4>[event_id]:[number] <col5>[chargetime]:[time] } <table7>[patients] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[gender]:[text] <col3>[dob]:[time] <col4>[dod]:[time] } <table8>[icustays] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[first_careunit]:[text] <col5>[last_careunit]:[text] <col6>[first_wardid]:[number] <col7>[last_wardid]:[number] <col8>[intime]:[time] <col9>[outtime]:[time] } <table9>[d_icd_procedures] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table10>[diagnoses_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table11>[d_items] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] <col3>[linksto]:[text] } <table12>[procedures_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table13>[admissions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[admittime]:[time] <col4>[dischtime]:[time] <col5>[admission_type]:[text] <col6>[admission_location]:[text] <col7>[discharge_location]:[text] <col8>[insurance]:[text] <col9>[language]:[text] <col10>[marital_status]:[text] <col11>[ethnicity]:[text] <col12>[age]:[number] } <table14>[outputevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[charttime]:[time] <col5>[itemid]:[number] <col6>[value]:[number] } <table15>[d_icd_diagnoses] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table16>[labevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[itemid]:[number] <col4>[charttime]:[time] <col5>[valuenum]:[number] <col6>[valueuom]:[text] }
SELECT COUNT( * ) > 0 FROM `<table5>` WHERE `<table5>`.hadm_id IN ( SELECT `<table13>`.hadm_id FROM `<table13>` WHERE `<table13>`.subject_id = 24971 AND NOT `<table13>`.dischtime IS NULL ORDER BY `<table13>`.admittime DESC LIMIT 1 ) AND `<table5>`.drug IN ( 'warfarin', 'albuterol mdi', 'glucagon' )
have patient 24971 been prescribed with the medication warfarin, albuterol mdi, or glucagon on the last hospital visit?
<table0>[table_2850912_12] { <col0>[player]:[VARCHAR] <col1>[college_junior_club_team]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Brynäs IF ( Sweden )"
List the players for team bryn s if (sweden).
<table0>[table_59449] { <col0>[Outcome]:[text] <col1>[Date]:[text] <col2>[Tournament]:[text] <col3>[Surface]:[text] <col4>[Partner]:[text] <col5>[Opponents]:[final] <col6>[text]:[Score] <col7>[final]:[text] }
SELECT "Surface" FROM `<table0>` WHERE "Partner" = 'ruxandra dragomir'
What surface did Ruxandra Dragomir play on?
<table0>[table_name_82] { <col0>[floors]:[INTEGER] <col1>[name]:[VARCHAR] }
SELECT MIN( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "dubai marriott harbour hotel & suites"
What is the lowest number of floors recorded for buildings built by Dubai Marriott Harbour Hotel & Suites?
<table0>[bank_info] { <col0>[bank_name]:[TEXT] <col1>[assets]:[NUMERIC] <col2>[region]:[TEXT] <col3>[socially_responsible]:[BOOLEAN] }
SELECT SUM( `<col1>` ) FROM `<table0>` WHERE `<col2>` = 'Asia-Pacific' AND `<col3>` = TRUE;
What is the total assets of all banks in the Asia-Pacific region that offer socially responsible lending?
<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>[ethnicity]:[text] <col13>[expire_flag]:[text] <col14>[admission_location]:[text] <col15>[discharge_location]:[text] <col16>[diagnosis]:[text] <col17>[dod]:[text] <col18>[dob_year]:[text] <col19>[dod_year]:[text] <col20>[admittime]:[text] <col21>[dischtime]:[text] <col22>[admityear]:[text] } <table1>[diagnoses] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table2>[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] } <table3>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table4>[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] }
SELECT COUNT( DISTINCT `<table0>`.subject_id ) FROM `<table0>` INNER JOIN procedures ON `<table0>`.hadm_id = procedures.hadm_id WHERE `<table0>`.admission_type = "EMERGENCY" AND procedures.short_title = "Enterovesico fist repair"
how many patients admitted in emergency have undergone the procedure with short title enterovesico fist repair?
<table0>[departments] { <col0>[dept_id]:[INT] <col1>[dept_name]:[TEXT] } <table1>[employees] { <col0>[emp_id]:[INT] <col1>[dept_id]:[INT] <col2>[hire_date]:[DATE] <col3>[annual_salary]:[INT] <col4>[INSERT]:[departments] <col5>[dept_id]:[dept_name] <col6>[VALUES]:[Marketing] }
UPDATE employees SET annual_salary = 80000 WHERE dept_id = 2;
Update the annual salary of all employees in the IT department to 80000.
<table0>[appointments] { <col0>[appointment_id]:[INT] <col1>[therapist_id]:[INT] <col2>[appointment_date]:[DATE] }
SELECT therapist_id, COUNT( * ) as count FROM `<table0>` WHERE YEAR( `<col2>` ) = 2022 AND QUARTER( `<col2>` ) = 1 GROUP BY `<col1>` ORDER BY count DESC LIMIT 3;
Who are the top 3 therapists with the most appointments in H1 2022?
<table0>[table_204_226] { <col0>[number]:[municipality] <col1>[communes]:[text] <col2>[coalition]:[citizen] <col3>[text]:[coalition] <col4>[future]:[text] <col5>[independent]:[text] <col6>[winning]:[party] <col7>[coalition]:[text] <col8>[voter]:[turnout] }
SELECT ABS( ( SELECT "coalition for the citizen" FROM `<table0>` WHERE "coalition for the citizen" = 'sabire hoxhaj' ) - ( SELECT "coalition for the future" FROM `<table0>` WHERE "coalition for the future" = 'astrit sejdinaj' ) )
what was the difference in votes -lrb- percentage -rrb- between savire hoxhaj and astrit sejdinaj in the fratar municipality ?
<table0>[job_history] { <col0>[EMPLOYEE_ID]:[decimal] <col1>[START_DATE]:[date] <col2>[END_DATE]:[date] <col3>[JOB_ID]:[varchar] <col4>[DEPARTMENT_ID]:[decimal] } <table1>[jobs] { <col0>[JOB_ID]:[varchar] <col1>[JOB_TITLE]:[varchar] <col2>[MIN_SALARY]:[decimal] <col3>[MAX_SALARY]:[decimal] } <table2>[regions] { <col0>[REGION_ID]:[decimal] <col1>[REGION_NAME]:[varchar] } <table3>[countries] { <col0>[COUNTRY_ID]:[varchar] <col1>[COUNTRY_NAME]:[varchar] <col2>[REGION_ID]:[decimal] } <table4>[employees] { <col0>[EMPLOYEE_ID]:[decimal] <col1>[FIRST_NAME]:[varchar] <col2>[LAST_NAME]:[varchar] <col3>[EMAIL]:[varchar] <col4>[PHONE_NUMBER]:[varchar] <col5>[HIRE_DATE]:[date] <col6>[JOB_ID]:[varchar] <col7>[SALARY]:[decimal] <col8>[COMMISSION_PCT]:[decimal] <col9>[MANAGER_ID]:[decimal] <col10>[DEPARTMENT_ID]:[decimal] } <table5>[locations] { <col0>[LOCATION_ID]:[decimal] <col1>[STREET_ADDRESS]:[varchar] <col2>[POSTAL_CODE]:[varchar] <col3>[CITY]:[varchar] <col4>[STATE_PROVINCE]:[varchar] <col5>[COUNTRY_ID]:[varchar] } <table6>[departments] { <col0>[DEPARTMENT_ID]:[decimal] <col1>[DEPARTMENT_NAME]:[varchar] <col2>[MANAGER_ID]:[decimal] <col3>[LOCATION_ID]:[decimal] }
SELECT HIRE_DATE, AVG( `<col7>` ) FROM `<table4>` WHERE `<col7>` BETWEEN 8000 AND 12000 AND `<col8>` <> "null" OR `<col10>` <> 40 ORDER BY AVG( `<col7>` )
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, find hire_date and the average of salary bin hire_date by time, and visualize them by a bar chart, show Y-axis from low to high order.
<table0>[table_11220799_2] { <col0>[finish]:[VARCHAR] <col1>[first_air_date]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "March 6, 2008"
What were the results of episodes with the first air date of March 6, 2008?
<table0>[table_name_90] { <col0>[winning_driver]:[VARCHAR] <col1>[date]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "30 may"
Who was the winning driver on 30 May?
<table0>[company] { <col0>[INT]:[name] <col1>[TEXT]:[founder_ethnicity] <col2>[TEXT]:[INSERT] } <table1>[investment] { <col0>[INT]:[company_id] <col1>[INT]:[INT] }
SELECT AVG( amount ) FROM `<table1>` JOIN company ON `<table1>`.company_id = company.id WHERE company.founder_ethnicity = 'Latinx'
Show the average amount of funds raised by companies founded by Latinx individuals.
<table0>[Donations] { <col0>[donation_id]:[INT] <col1>[DECIMAL]:[program] <col2>[VARCHAR]:[255] }
SELECT MIN( amount ) FROM `<table0>` WHERE program = 'Arts';
What is the minimum donation amount for the 'Arts' program?
<table0>[address_status] { <col0>[status_id]:[integer] } <table1>[author] { <col0>[author_id]:[integer] <col1>[author_name]:[text] } <table2>[book_language] { <col0>[language_id]:[integer] <col1>[language_code]:[text] <col2>[language_name]:[text] } <table3>[country] { <col0>[country_id]:[integer] <col1>[country_name]:[text] } <table4>[address] { <col0>[address_id]:[integer] <col1>[street_number]:[text] <col2>[street_name]:[text] <col3>[city]:[text] <col4>[country_id]:[integer] } <table5>[customer] { <col0>[customer_id]:[integer] <col1>[first_name]:[text] <col2>[last_name]:[text] <col3>[email]:[text] } <table6>[customer_address] { <col0>[customer_id]:[integer] <col1>[address_id]:[integer] <col2>[status_id]:[integer] } <table7>[order_status] { <col0>[status_id]:[integer] <col1>[status_value]:[text] } <table8>[publisher] { <col0>[publisher_id]:[integer] <col1>[publisher_name]:[text] } <table9>[book] { <col0>[book_id]:[integer] <col1>[title]:[text] <col2>[isbn13]:[text] <col3>[language_id]:[integer] <col4>[num_pages]:[integer] <col5>[publication_date]:[date] <col6>[publisher_id]:[integer] } <table10>[book_author] { <col0>[book_id]:[integer] <col1>[author_id]:[integer] } <table11>[shipping_method] { <col0>[method_id]:[integer] <col1>[method_name]:[text] <col2>[cost]:[real] } <table12>[cust_order] { <col0>[order_id]:[integer] <col1>[order_date]:[datetime] <col2>[customer_id]:[integer] <col3>[shipping_method_id]:[integer] <col4>[dest_address_id]:[integer] } <table13>[order_history] { <col0>[history_id]:[integer] <col1>[order_id]:[integer] <col2>[status_id]:[integer] <col3>[status_date]:[datetime] } <table14>[order_line] { <col0>[line_id]:[integer] <col1>[order_id]:[integer] <col2>[book_id]:[integer] <col3>[price]:[real] }
SELECT strftime( '%J', T2.status_date ) - strftime( '%J', T1.order_date ) FROM `<table12>` AS T1 INNER JOIN order_history AS T2 ON T1.order_id = T2.order_id WHERE T1.order_id = 2398
How much time does it take to update the status of order "2398"?
<table0>[table_11778] { <col0>[Driver]:[text] <col1>[Constructor]:[text] <col2>[Laps]:[real] <col3>[Time]:[Retired] <col4>[text]:[Grid] }
SELECT "Constructor" FROM `<table0>` WHERE "Laps" = '35' AND "Grid" > '5'
Tell me the constructor that has 35 Laps with a grid more than 5
<table0>[diagnoses] { <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>[label]:[text] <col7>[fluid]:[text] } <table2>[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>[ethnicity]:[text] <col13>[expire_flag]:[text] <col14>[admission_location]:[text] <col15>[discharge_location]:[text] <col16>[diagnosis]:[text] <col17>[dod]:[text] <col18>[dob_year]:[text] <col19>[dod_year]:[text] <col20>[admittime]:[text] <col21>[dischtime]:[text] <col22>[admityear]:[text] } <table3>[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] } <table4>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] }
SELECT COUNT( DISTINCT `<table2>`.subject_id ) FROM `<table2>` INNER JOIN diagnoses ON `<table2>`.hadm_id = diagnoses.hadm_id WHERE `<table2>`.gender = "M" AND diagnoses.long_title = "Atherosclerosis of native arteries of the extremities, unspecified"
how many male patients had the diagnosis long title atherosclerosis of native arteries of the extremities, unspecified?
<table0>[table_26880] { <col0>[Rank]:[real] <col1>[text]:[Nationality] <col2>[text]:[1st] <col3>[text]:[2nd] <col4>[text]:[Points] <col5>[text]:[Overall] <col6>[FHT]:[Points] <col7>[text]:[Overall] <col8>[points]:[Rank] }
SELECT "Points" FROM `<table0>` WHERE "Name" = 'Thomas Morgenstern'
Name the points for thomas morgenstern
<table0>[marine_protected_areas] { <col0>[region]:[VARCHAR] <col1>[255]:[area_size] <col2>[FLOAT]:[INSERT] }
SELECT region, area_size - LAG( area_size ) OVER( ORDER BY region ) as area_size_difference FROM marine_protected_areas;
What is the difference in marine protected area size per region?
<table0>[table_name_83] { <col0>[ratt]:[VARCHAR] <col1>[long]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "73"
What is the RAtt when the long is 73?
<table0>[table_25800134_4] { <col0>[director]:[VARCHAR] <col1>[series__number]:[VARCHAR] }
SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` = 158
How many directors worked on #158?
<table0>[table_203_771] { <col0>[number]:[number] <col1>[artist]:[text] <col2>[featuring]:[text] <col3>[title]:[text] <col4>[version]:[text] <col5>[length]:[text] }
SELECT "title" FROM `<table0>` ORDER BY "#" LIMIT 1
what is the title of the first track on the best of benassi bros greatest hit album ?
<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>[ethnicity]:[text] <col13>[expire_flag]:[text] <col14>[admission_location]:[text] <col15>[discharge_location]:[text] <col16>[diagnosis]:[text] <col17>[dod]:[text] <col18>[dob_year]:[text] <col19>[dod_year]:[text] <col20>[admittime]:[text] <col21>[dischtime]:[text] <col22>[admityear]:[text] } <table1>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table2>[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] } <table3>[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] } <table4>[diagnoses] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] }
SELECT `<table0>`.language FROM `<table0>` WHERE `<table0>`.name = "Charles Deshay"
what is language of subject name charles deshay?
<table0>[table_2560677_1] { <col0>[fan_title]:[VARCHAR] <col1>[end_date]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "1967-11-12"
What is the fan title with an end date of 1967-11-12?
<table0>[table_11654169_1] { <col0>[population_in_1000__1931]:[VARCHAR] <col1>[voivodeship_separate_city]:[VARCHAR] }
SELECT population_in_1000__1931_ FROM `<table0>` WHERE `<col1>` = "pomorskie"
What is the population in the city of Pomorskie?
<table0>[table_name_64] { <col0>[grid]:[INTEGER] <col1>[rider]:[VARCHAR] }
SELECT MAX( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "mika kallio"
what is the grid when the rider is mika kallio?
<table0>[SecurityIncidents] { <col0>[INT]:[analyst_id] <col1>[VARCHAR]:[incidents] <col2>[INT]:[resolution_date] }
SELECT MAX( incidents ) as max_incidents FROM `<table0>` WHERE resolution_date >= DATE_SUB( CURRENT_DATE( ), INTERVAL 1 MONTH ) GROUP BY analyst_id ORDER BY max_incidents DESC LIMIT 1;
What is the maximum number of security incidents resolved by a single analyst in the last month?
<table0>[instructor] { <col0>[name]:[VARCHAR] <col1>[dept_name]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 'Comp. Sci.'
Find the names of all instructors in computer science department
<table0>[employee] { <col0>[int]:[name] <col1>[varchar]:[plant] } <table1>[handling] { <col0>[int]:[employee_id] <col1>[int]:[material] <col2>[varchar]:[quantity] <col3>[int]:[INSERT] <col4>[employee]:[name] <col5>[plant]:[VALUES] <col6>[John]:[North] <col7>[Plant]:[Jane] <col8>[South]:[Plant] <col9>[Doe]:[West] <col10>[Plant]:[INSERT] }
SELECT e.name, SUM( h.quantity ) as total_handled FROM `<table0>` e JOIN handling h ON e.id = h.`<table0>`_id WHERE e.plant = 'South Plant' AND material = 'Hazardous' GROUP BY e.name ORDER BY total_handled DESC LIMIT 5;
List the top 5 employees who handled the most hazardous materials in the 'South' plant in 2021.
<table0>[diagnosis] { <col0>[diagnosisid]:[number] <col1>[patientunitstayid]:[number] <col2>[diagnosisname]:[text] <col3>[diagnosistime]:[time] <col4>[icd9code]:[text] } <table1>[vitalperiodic] { <col0>[vitalperiodicid]:[number] <col1>[patientunitstayid]:[number] <col2>[temperature]:[number] <col3>[sao2]:[number] <col4>[heartrate]:[number] <col5>[respiration]:[number] <col6>[systemicsystolic]:[number] <col7>[systemicdiastolic]:[number] <col8>[systemicmean]:[number] <col9>[observationtime]:[time] } <table2>[microlab] { <col0>[microlabid]:[number] <col1>[patientunitstayid]:[number] <col2>[culturesite]:[text] <col3>[organism]:[text] <col4>[culturetakentime]:[time] } <table3>[lab] { <col0>[labid]:[number] <col1>[patientunitstayid]:[number] <col2>[labname]:[text] <col3>[labresult]:[number] <col4>[labresulttime]:[time] } <table4>[allergy] { <col0>[allergyid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[allergyname]:[text] <col4>[allergytime]:[time] } <table5>[intakeoutput] { <col0>[intakeoutputid]:[number] <col1>[patientunitstayid]:[number] <col2>[cellpath]:[text] <col3>[celllabel]:[text] <col4>[cellvaluenumeric]:[number] <col5>[intakeoutputtime]:[time] } <table6>[cost] { <col0>[costid]:[number] <col1>[uniquepid]:[text] <col2>[patienthealthsystemstayid]:[number] <col3>[eventtype]:[text] <col4>[eventid]:[number] <col5>[chargetime]:[time] } <table7>[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>[dischargeweight]:[number] <col11>[hospitaladmittime]:[time] <col12>[hospitaladmitsource]:[text] <col13>[unitadmittime]:[time] <col14>[unitdischargetime]:[time] <col15>[hospitaldischargetime]:[time] <col16>[hospitaldischargestatus]:[text] } <table8>[medication] { <col0>[medicationid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[dosage]:[text] <col4>[routeadmin]:[text] <col5>[drugstarttime]:[time] <col6>[drugstoptime]:[time] } <table9>[treatment] { <col0>[treatmentid]:[number] <col1>[patientunitstayid]:[number] <col2>[treatmentname]:[text] <col3>[treatmenttime]:[time] }
SELECT COUNT( * ) FROM `<table3>` WHERE `<table3>`.`<table7>`unitstayid IN ( SELECT `<table7>`.`<table7>`unitstayid FROM `<table7>` WHERE `<table7>`.`<table7>`healthsystemstayid IN ( SELECT `<table7>`.`<table7>`healthsystemstayid FROM `<table7>` WHERE `<table7>`.uniquepid = '006-62367' ) ) AND `<table3>`.`<table3>`name = 'calcium' AND DATETIME( `<table3>`.`<table3>`resulttime, 'start of month' ) = DATETIME( CURRENT_TIME( ), 'start of month', '-1 month' )
count how many times patient 006-62367 had received a lab calcium test during the last month.
<table0>[diagnosis] { <col0>[diagnosisid]:[number] <col1>[patientunitstayid]:[number] <col2>[diagnosisname]:[text] <col3>[diagnosistime]:[time] <col4>[icd9code]:[text] } <table1>[treatment] { <col0>[treatmentid]:[number] <col1>[patientunitstayid]:[number] <col2>[treatmentname]:[text] <col3>[treatmenttime]:[time] } <table2>[cost] { <col0>[costid]:[number] <col1>[uniquepid]:[text] <col2>[patienthealthsystemstayid]:[number] <col3>[eventtype]:[text] <col4>[eventid]:[number] <col5>[chargetime]:[time] } <table3>[vitalperiodic] { <col0>[vitalperiodicid]:[number] <col1>[patientunitstayid]:[number] <col2>[temperature]:[number] <col3>[sao2]:[number] <col4>[heartrate]:[number] <col5>[respiration]:[number] <col6>[systemicsystolic]:[number] <col7>[systemicdiastolic]:[number] <col8>[systemicmean]:[number] <col9>[observationtime]:[time] } <table4>[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>[dischargeweight]:[number] <col11>[hospitaladmittime]:[time] <col12>[hospitaladmitsource]:[text] <col13>[unitadmittime]:[time] <col14>[unitdischargetime]:[time] <col15>[hospitaldischargetime]:[time] <col16>[hospitaldischargestatus]:[text] } <table5>[intakeoutput] { <col0>[intakeoutputid]:[number] <col1>[patientunitstayid]:[number] <col2>[cellpath]:[text] <col3>[celllabel]:[text] <col4>[cellvaluenumeric]:[number] <col5>[intakeoutputtime]:[time] } <table6>[allergy] { <col0>[allergyid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[allergyname]:[text] <col4>[allergytime]:[time] } <table7>[medication] { <col0>[medicationid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[dosage]:[text] <col4>[routeadmin]:[text] <col5>[drugstarttime]:[time] <col6>[drugstoptime]:[time] } <table8>[lab] { <col0>[labid]:[number] <col1>[patientunitstayid]:[number] <col2>[labname]:[text] <col3>[labresult]:[number] <col4>[labresulttime]:[time] } <table9>[microlab] { <col0>[microlabid]:[number] <col1>[patientunitstayid]:[number] <col2>[culturesite]:[text] <col3>[organism]:[text] <col4>[culturetakentime]:[time] }
SELECT AVG( t1.c1 ) FROM ( SELECT COUNT( DISTINCT `<table0>`.patientunitstayid ) AS c1 FROM `<table0>` WHERE `<table0>`.`<table0>`name = 'anemia - iron deficiency anemia secondary to chronic blood' AND DATETIME( `<table0>`.`<table0>`time ) <= DATETIME( CURRENT_TIME( ), '-4 year' ) GROUP BY STRFTIME( '%y-%m-%d', `<table0>`.`<table0>`time ) ) AS t1
what is the average daily number of patients who have had anemia - iron deficiency anemia secondary to chronic blood until 4 years ago?
<table0>[party] { <col0>[LOCATION]:[VARCHAR] <col1>[Number_of_hosts]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` ORDER BY `<col1>` DESC LIMIT 1
What is the location of the party with the most hosts?
<table0>[agricultural_innovation_projects] { <col0>[INT]:[country] <col1>[VARCHAR]:[255] <col2>[success]:[BOOLEAN] }
SELECT COUNT( * ) FROM `<table0>` WHERE country = 'Indonesia' AND `<col2>` = true AND completion_date BETWEEN '2015-01-01' AND '2017-12-31';
How many agricultural innovation projects were successfully implemented in Indonesia between 2015 and 2017, inclusive?
<table0>[digital_divide] { <col0>[INT]:[PRIMARY] <col1>[KEY]:[problem] <col2>[VARCHAR]:[description] <col3>[TEXT]:[INSERT] }
UPDATE digital_divide SET description = 'Limited digital literacy and skills among older adults' WHERE id = 3;
Update the 'description' of the record with an id of 3 in the 'digital_divide' table to 'Limited digital literacy and skills among older adults'
<table0>[cases] { <col0>[case_id]:[INT] <col1>[category]:[TEXT] }
SELECT COUNT( * ) FROM `<table0>` WHERE `<col1>` = 'Family';
What is the number of cases in the 'Family' category?
<table0>[table_13426649_1] { <col0>[original_air_date]:[VARCHAR] <col1>[number]:[VARCHAR] }
SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE _number = 6
How many different original air dates did the episode number 6 have?
<table0>[table_203_583] { <col0>[number]:[title] <col1>[text]:[release] <col2>[number]:[6th] <col3>[gen]:[text] <col4>[handheld]:[text] <col5>[note]:[text] }
SELECT "release" FROM `<table0>` GROUP BY "release" ORDER BY COUNT( "title" ) DESC LIMIT 1
which year had the most game releases ?
<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>[ethnicity]:[text] <col13>[expire_flag]:[text] <col14>[admission_location]:[text] <col15>[discharge_location]:[text] <col16>[diagnosis]:[text] <col17>[dod]:[text] <col18>[dob_year]:[text] <col19>[dod_year]:[text] <col20>[admittime]:[text] <col21>[dischtime]:[text] <col22>[admityear]:[text] } <table1>[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] } <table2>[diagnoses] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table3>[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] } <table4>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] }
SELECT COUNT( DISTINCT `<table0>`.subject_id ) FROM `<table0>` INNER JOIN diagnoses ON `<table0>`.hadm_id = diagnoses.hadm_id INNER JOIN lab ON `<table0>`.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Injury-hanging" AND lab.flag = "abnormal"
provide the number of patients whose diagnoses short title is injury-hanging and lab test abnormal status is abnormal?
<table0>[table_name_68] { <col0>[top_10]:[INTEGER] <col1>[avg_finish]:[VARCHAR] <col2>[starts]:[VARCHAR] <col3>[winnings]:[VARCHAR] }
SELECT AVG( `<col0>` ) FROM `<table0>` WHERE `<col2>` = 2 AND `<col3>` = "$135,984" AND `<col1>` > 43
What is the average top 10 score for 2 starts, winnings of $135,984 and an average finish more than 43?
<table0>[table_name_40] { <col0>[tournament]:[VARCHAR] <col1>[runner_s__up]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "ryan palmer"
Which tournaments was Ryan Palmer in as a runner-up?
<table0>[CREATE] { <col0>[SCHEMA]:[RuralHealth] <col1>[USE]:[RuralHealth] } <table1>[States] { <col0>[StateName]:[VARCHAR] <col1>[StateAbbreviation]:[VARCHAR] } <table2>[Hospitals] { <col0>[HospitalID]:[INT] <col1>[HospitalName]:[VARCHAR] <col2>[StateAbbreviation]:[VARCHAR] <col3>[Rural]:[BOOLEAN] <col4>[UninsuredPatients]:[FLOAT] <col5>[INSERT]:[States] <col6>[StateName]:[StateAbbreviation] <col7>[VALUES]:[Alabama] <col8>[Alaska]:[INSERT] }
SELECT StateAbbreviation, ( SUM( CASE WHEN `<col3>` THEN `<col4>` ELSE 0 END ) * 100.0 / AVG( `<col4>` ) ) as PercentUninsuredRural`<table2>` FROM `<table2>` GROUP BY `<col2>` ORDER BY PercentUninsuredRural`<table2>` DESC;
What is the percentage of uninsured patients among rural hospitals in each state, ordered from highest to lowest?
<table0>[emissions] { <col0>[country]:[VARCHAR] <col1>[255]:[year] <col2>[INT]:[co2_emission] <col3>[FLOAT]:[INSERT] }
SELECT country, SUM( co2_emission ) as total_co2_emission FROM `<table0>` WHERE year = 2010 GROUP BY `<col0>` ORDER BY total_co2_emission DESC;
What is the total CO2 emission for each country in the 'emissions' table, ordered by total CO2 emission in descending order?
<table0>[EventAttendance] { <col0>[EventID]:[INT] <col1>[PRIMARY]:[KEY] <col2>[EventName]:[VARCHAR] <col3>[100]:[Date] <col4>[DATE]:[TotalAttendance] <col5>[INT]:[INSERT] }
SELECT * FROM `<table0>` WHERE TotalAttendance > 100;
List all events with attendance greater than 100
<table0>[vitalperiodic] { <col0>[vitalperiodicid]:[number] <col1>[patientunitstayid]:[number] <col2>[temperature]:[number] <col3>[sao2]:[number] <col4>[heartrate]:[number] <col5>[respiration]:[number] <col6>[systemicsystolic]:[number] <col7>[systemicdiastolic]:[number] <col8>[systemicmean]:[number] <col9>[observationtime]:[time] } <table1>[diagnosis] { <col0>[diagnosisid]:[number] <col1>[patientunitstayid]:[number] <col2>[diagnosisname]:[text] <col3>[diagnosistime]:[time] <col4>[icd9code]:[text] } <table2>[lab] { <col0>[labid]:[number] <col1>[patientunitstayid]:[number] <col2>[labname]:[text] <col3>[labresult]:[number] <col4>[labresulttime]:[time] } <table3>[treatment] { <col0>[treatmentid]:[number] <col1>[patientunitstayid]:[number] <col2>[treatmentname]:[text] <col3>[treatmenttime]:[time] } <table4>[medication] { <col0>[medicationid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[dosage]:[text] <col4>[routeadmin]:[text] <col5>[drugstarttime]:[time] <col6>[drugstoptime]:[time] } <table5>[microlab] { <col0>[microlabid]:[number] <col1>[patientunitstayid]:[number] <col2>[culturesite]:[text] <col3>[organism]:[text] <col4>[culturetakentime]:[time] } <table6>[cost] { <col0>[costid]:[number] <col1>[uniquepid]:[text] <col2>[patienthealthsystemstayid]:[number] <col3>[eventtype]:[text] <col4>[eventid]:[number] <col5>[chargetime]:[time] } <table7>[allergy] { <col0>[allergyid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[allergyname]:[text] <col4>[allergytime]:[time] } <table8>[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>[dischargeweight]:[number] <col11>[hospitaladmittime]:[time] <col12>[hospitaladmitsource]:[text] <col13>[unitadmittime]:[time] <col14>[unitdischargetime]:[time] <col15>[hospitaldischargetime]:[time] <col16>[hospitaldischargestatus]:[text] } <table9>[intakeoutput] { <col0>[intakeoutputid]:[number] <col1>[patientunitstayid]:[number] <col2>[cellpath]:[text] <col3>[celllabel]:[text] <col4>[cellvaluenumeric]:[number] <col5>[intakeoutputtime]:[time] }
SELECT AVG( t1.c1 ) FROM ( SELECT SUM( `<table6>`.`<table6>` ) AS c1 FROM `<table6>` WHERE `<table6>`.`<table8>`healthsystemstayid IN ( SELECT `<table8>`.`<table8>`healthsystemstayid FROM `<table8>` WHERE `<table8>`.`<table8>`unitstayid IN ( SELECT `<table3>`.`<table8>`unitstayid FROM `<table3>` WHERE `<table3>`.`<table3>`name = 'diagnostic ultrasound of heart - transthoracic echocardiography' ) ) AND STRFTIME( '%y', `<table6>`.chargetime ) = '2105' GROUP BY `<table6>`.`<table8>`healthsystemstayid ) AS t1
what is the average total hospital cost, that includes diagnostic ultrasound of heart - transthoracic echocardiography in 2105?
<table0>[school_details] { <col0>[School_ID]:[int] <col1>[Nickname]:[text] <col2>[Colors]:[text] <col3>[League]:[text] <col4>[Class]:[text] <col5>[Division]:[text] } <table1>[school] { <col0>[School_ID]:[int] <col1>[School]:[text] <col2>[Location]:[text] <col3>[Enrollment]:[real] <col4>[Founded]:[real] <col5>[Denomination]:[text] <col6>[Boys_or_Girls]:[text] <col7>[Day_or_Boarding]:[text] <col8>[Year_Entered_Competition]:[real] <col9>[School_Colors]:[text] } <table2>[school_performance] { <col0>[School_Id]:[int] <col1>[School_Year]:[text] <col2>[Class_A]:[text] <col3>[Class_AA]:[text] } <table3>[player] { <col0>[Player_ID]:[int] <col1>[Player]:[text] <col2>[Team]:[text] <col3>[Age]:[int] <col4>[Position]:[text] <col5>[School_ID]:[int] }
SELECT Denomination, COUNT( * ) FROM `<table1>` GROUP BY `<col5>` ORDER BY COUNT( * ) DESC
Create a bar chart showing the total number across denomination, rank in desc by the Y-axis.
<table0>[table_30060356_3] { <col0>[gt4_cup_winner]:[VARCHAR] <col1>[circuit]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Spa-Francorchamps Report"
List all GT4 Cup winners played on the Spa-Francorchamps Report.
<table0>[Categories] { <col0>[CategoryID]:[integer] <col1>[CategoryName]:[text] <col2>[Description]:[text] } <table1>[Customers] { <col0>[CustomerID]:[integer] <col1>[CustomerName]:[text] <col2>[ContactName]:[text] <col3>[Address]:[text] <col4>[City]:[text] <col5>[PostalCode]:[text] <col6>[Country]:[text] } <table2>[Employees] { <col0>[EmployeeID]:[integer] <col1>[LastName]:[text] <col2>[FirstName]:[text] <col3>[BirthDate]:[date] <col4>[Photo]:[text] <col5>[Notes]:[text] } <table3>[Shippers] { <col0>[ShipperID]:[integer] <col1>[ShipperName]:[text] <col2>[Phone]:[text] } <table4>[Suppliers] { <col0>[SupplierID]:[integer] <col1>[SupplierName]:[text] <col2>[ContactName]:[text] <col3>[Address]:[text] <col4>[City]:[text] <col5>[PostalCode]:[text] <col6>[Country]:[text] <col7>[Phone]:[text] } <table5>[Products] { <col0>[ProductID]:[integer] <col1>[ProductName]:[text] <col2>[SupplierID]:[integer] <col3>[CategoryID]:[integer] <col4>[Unit]:[text] <col5>[Price]:[real] } <table6>[Orders] { <col0>[OrderID]:[integer] <col1>[CustomerID]:[integer] <col2>[EmployeeID]:[integer] <col3>[OrderDate]:[datetime] <col4>[ShipperID]:[integer] } <table7>[OrderDetails] { <col0>[OrderDetailID]:[integer] <col1>[OrderID]:[integer] <col2>[ProductID]:[integer] <col3>[Quantity]:[integer] }
SELECT COUNT( `<col0>` ) FROM `<table2>` WHERE TitleOfCourtesy = 'Dr.'
How many employees have obtained a doctorate?
<table0>[jobs] { <col0>[JOB_ID]:[varchar] <col1>[JOB_TITLE]:[varchar] <col2>[MIN_SALARY]:[decimal] <col3>[MAX_SALARY]:[decimal] } <table1>[locations] { <col0>[LOCATION_ID]:[decimal] <col1>[STREET_ADDRESS]:[varchar] <col2>[POSTAL_CODE]:[varchar] <col3>[CITY]:[varchar] <col4>[STATE_PROVINCE]:[varchar] <col5>[COUNTRY_ID]:[varchar] } <table2>[employees] { <col0>[EMPLOYEE_ID]:[decimal] <col1>[FIRST_NAME]:[varchar] <col2>[LAST_NAME]:[varchar] <col3>[EMAIL]:[varchar] <col4>[PHONE_NUMBER]:[varchar] <col5>[HIRE_DATE]:[date] <col6>[JOB_ID]:[varchar] <col7>[SALARY]:[decimal] <col8>[COMMISSION_PCT]:[decimal] <col9>[MANAGER_ID]:[decimal] <col10>[DEPARTMENT_ID]:[decimal] } <table3>[regions] { <col0>[REGION_ID]:[decimal] <col1>[REGION_NAME]:[varchar] } <table4>[departments] { <col0>[DEPARTMENT_ID]:[decimal] <col1>[DEPARTMENT_NAME]:[varchar] <col2>[MANAGER_ID]:[decimal] <col3>[LOCATION_ID]:[decimal] } <table5>[countries] { <col0>[COUNTRY_ID]:[varchar] <col1>[COUNTRY_NAME]:[varchar] <col2>[REGION_ID]:[decimal] } <table6>[job_history] { <col0>[EMPLOYEE_ID]:[decimal] <col1>[START_DATE]:[date] <col2>[END_DATE]:[date] <col3>[JOB_ID]:[varchar] <col4>[DEPARTMENT_ID]:[decimal] }
SELECT COMMISSION_PCT, `<col9>` FROM `<table2>` WHERE `<col5>` < '2002-06-21'
For those employees who was hired before 2002-06-21, a scatter chart shows the correlation between commission_pct and manager_id .
<table0>[regions] { <col0>[REGION_ID]:[decimal] <col1>[REGION_NAME]:[varchar] } <table1>[countries] { <col0>[COUNTRY_ID]:[varchar] <col1>[COUNTRY_NAME]:[varchar] <col2>[REGION_ID]:[decimal] } <table2>[job_history] { <col0>[EMPLOYEE_ID]:[decimal] <col1>[START_DATE]:[date] <col2>[END_DATE]:[date] <col3>[JOB_ID]:[varchar] <col4>[DEPARTMENT_ID]:[decimal] } <table3>[jobs] { <col0>[JOB_ID]:[varchar] <col1>[JOB_TITLE]:[varchar] <col2>[MIN_SALARY]:[decimal] <col3>[MAX_SALARY]:[decimal] } <table4>[locations] { <col0>[LOCATION_ID]:[decimal] <col1>[STREET_ADDRESS]:[varchar] <col2>[POSTAL_CODE]:[varchar] <col3>[CITY]:[varchar] <col4>[STATE_PROVINCE]:[varchar] <col5>[COUNTRY_ID]:[varchar] } <table5>[departments] { <col0>[DEPARTMENT_ID]:[decimal] <col1>[DEPARTMENT_NAME]:[varchar] <col2>[MANAGER_ID]:[decimal] <col3>[LOCATION_ID]:[decimal] } <table6>[employees] { <col0>[EMPLOYEE_ID]:[decimal] <col1>[FIRST_NAME]:[varchar] <col2>[LAST_NAME]:[varchar] <col3>[EMAIL]:[varchar] <col4>[PHONE_NUMBER]:[varchar] <col5>[HIRE_DATE]:[date] <col6>[JOB_ID]:[varchar] <col7>[SALARY]:[decimal] <col8>[COMMISSION_PCT]:[decimal] <col9>[MANAGER_ID]:[decimal] <col10>[DEPARTMENT_ID]:[decimal] }
SELECT JOB_ID, SUM( `<col10>` ) FROM `<table6>` WHERE `<col5>` < '2002-06-21' GROUP BY `<col6>`
For those employees who was hired before 2002-06-21, give me the comparison about the sum of department_id over the job_id , and group by attribute job_id.
<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]:[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]:[LastEditorUserId] <col11>[number]:[LastEditorDisplayName] <col12>[text]:[LastEditDate] <col13>[time]:[LastActivityDate] <col14>[time]:[Title] <col15>[text]:[Tags] <col16>[text]:[AnswerCount] <col17>[number]:[CommentCount] <col18>[number]:[FavoriteCount] <col19>[number]:[ClosedDate] <col20>[time]:[CommunityOwnedDate] <col21>[time]:[ContentLicense] } <table2>[VoteTypes] { <col0>[number]:[text] } <table3>[Posts] { <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]:[LastEditorUserId] <col11>[number]:[LastEditorDisplayName] <col12>[text]:[LastEditDate] <col13>[time]:[LastActivityDate] <col14>[time]:[Title] <col15>[text]:[Tags] <col16>[text]:[AnswerCount] <col17>[number]:[CommentCount] <col18>[number]:[FavoriteCount] <col19>[number]:[ClosedDate] <col20>[time]:[CommunityOwnedDate] <col21>[time]:[ContentLicense] } <table4>[ReviewTasks] { <col0>[number]:[ReviewTaskTypeId] <col1>[number]:[CreationDate] <col2>[time]:[DeletionDate] <col3>[time]:[ReviewTaskStateId] <col4>[number]:[PostId] <col5>[number]:[SuggestedEditId] <col6>[number]:[CompletedByReviewTaskId] } <table5>[PostHistoryTypes] { <col0>[number]:[text] } <table6>[SuggestedEditVotes] { <col0>[number]:[SuggestedEditId] <col1>[number]:[UserId] <col2>[number]:[VoteTypeId] <col3>[number]:[CreationDate] <col4>[time]:[TargetUserId] <col5>[number]:[TargetRepChange] } <table7>[Tags] { <col0>[number]:[TagName] <col1>[text]:[Count] <col2>[number]:[ExcerptPostId] <col3>[number]:[WikiPostId] } <table8>[ReviewTaskResultTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table9>[PostNoticeTypes] { <col0>[number]:[ClassId] <col1>[number]:[text] <col2>[Body]:[text] <col3>[IsHidden]:[boolean] <col4>[Predefined]:[boolean] <col5>[PostNoticeDurationId]:[number] } <table10>[TagSynonyms] { <col0>[number]:[SourceTagName] <col1>[text]:[TargetTagName] <col2>[text]:[CreationDate] <col3>[time]:[OwnerUserId] <col4>[number]:[AutoRenameCount] <col5>[number]:[LastAutoRename] <col6>[time]:[Score] <col7>[number]:[ApprovedByUserId] <col8>[number]:[ApprovalDate] } <table11>[Comments] { <col0>[number]:[PostId] <col1>[number]:[Score] <col2>[number]:[Text] <col3>[text]:[CreationDate] <col4>[time]:[UserDisplayName] <col5>[text]:[UserId] <col6>[number]:[ContentLicense] } <table12>[Badges] { <col0>[number]:[UserId] <col1>[number]:[text] <col2>[Date]:[time] <col3>[Class]:[number] <col4>[TagBased]:[boolean] } <table13>[ReviewTaskResults] { <col0>[number]:[ReviewTaskId] <col1>[number]:[ReviewTaskResultTypeId] <col2>[number]:[CreationDate] <col3>[time]:[RejectionReasonId] <col4>[number]:[Comment] } <table14>[Votes] { <col0>[number]:[PostId] <col1>[number]:[VoteTypeId] <col2>[number]:[UserId] <col3>[number]:[CreationDate] <col4>[time]:[BountyAmount] } <table15>[FlagTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table16>[SuggestedEdits] { <col0>[number]:[PostId] <col1>[number]:[CreationDate] <col2>[time]:[ApprovalDate] <col3>[time]:[RejectionDate] <col4>[time]:[OwnerUserId] <col5>[number]:[Comment] <col6>[text]:[Text] <col7>[text]:[Title] <col8>[text]:[Tags] <col9>[text]:[RevisionGUID] } <table17>[PostHistory] { <col0>[number]:[PostHistoryTypeId] <col1>[number]:[PostId] <col2>[number]:[RevisionGUID] <col3>[CreationDate]:[time] <col4>[UserId]:[number] <col5>[UserDisplayName]:[text] <col6>[Comment]:[text] <col7>[Text]:[text] <col8>[ContentLicense]:[text] } <table18>[ReviewTaskTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table19>[ReviewRejectionReasons] { <col0>[number]:[text] <col1>[Description]:[text] <col2>[PostTypeId]:[number] } <table20>[ReviewTaskStates] { <col0>[number]:[text] <col1>[Description]:[text] } <table21>[PostFeedback] { <col0>[number]:[PostId] <col1>[number]:[IsAnonymous] <col2>[boolean]:[VoteTypeId] <col3>[number]:[CreationDate] } <table22>[PostTypes] { <col0>[number]:[text] } <table23>[Users] { <col0>[number]:[Reputation] <col1>[number]:[CreationDate] <col2>[time]:[DisplayName] <col3>[text]:[LastAccessDate] <col4>[time]:[WebsiteUrl] <col5>[text]:[Location] <col6>[text]:[AboutMe] <col7>[text]:[Views] <col8>[number]:[UpVotes] <col9>[number]:[DownVotes] <col10>[number]:[ProfileImageUrl] <col11>[text]:[EmailHash] <col12>[text]:[AccountId] } <table24>[PostNotices] { <col0>[number]:[PostId] <col1>[number]:[PostNoticeTypeId] <col2>[number]:[CreationDate] <col3>[time]:[DeletionDate] <col4>[time]:[ExpiryDate] <col5>[time]:[Body] <col6>[text]:[OwnerUserId] <col7>[number]:[DeletionUserId] } <table25>[CloseAsOffTopicReasonTypes] { <col0>[number]:[IsUniversal] <col1>[boolean]:[InputTitle] <col2>[text]:[MarkdownInputGuidance] <col3>[text]:[MarkdownPostOwnerGuidance] <col4>[text]:[MarkdownPrivilegedUserGuidance] <col5>[text]:[MarkdownConcensusDescription] <col6>[text]:[CreationDate] <col7>[time]:[CreationModeratorId] <col8>[number]:[ApprovalDate] <col9>[time]:[ApprovalModeratorId] <col10>[number]:[DeactivationDate] <col11>[time]:[DeactivationModeratorId] } <table26>[CloseReasonTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table27>[PostTags] { <col0>[PostId]:[number] <col1>[TagId]:[number] } <table28>[PostLinks] { <col0>[number]:[CreationDate] <col1>[time]:[PostId] <col2>[number]:[RelatedPostId] <col3>[number]:[LinkTypeId] }
SELECT t.TagName, COUNT( t.Id ) AS AnswersForTag FROM `<table3>` AS q INNER JOIN PostTags AS pt ON pt.PostId = q.Id INNER JOIN Tags AS t ON t.Id = pt.TagId INNER JOIN `<table3>` AS a ON a.ParentId = q.Id WHERE a.OwnerUserId = 68172 GROUP BY t.TagName HAVING COUNT( t.Id ) >= 5 ORDER BY 2 DESC
casperOne's Top Answers by Tags. casperOne's answers aggregated by tag, where the number of answers per tag is greater than or equal to five.
<table0>[traditional_artists] { <col0>[artist_id]:[INT] <col1>[name]:[VARCHAR] <col2>[age]:[INT] <col3>[country]:[VARCHAR] <col4>[art_type]:[VARCHAR] }
SELECT AVG( art_count ) FROM ( SELECT artist_id, COUNT( * ) OVER ( PARTITION BY `<col0>` ) AS art_count FROM `<table0>` ) t;
What is the average number of art pieces per artist in the 'traditional_artists' table?
<table0>[table_name_28] { <col0>[round]:[INTEGER] <col1>[away_team]:[VARCHAR] }
SELECT MAX( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "pohang steelers"
What is the latest round for Pohang Steelers as the away team?
<table0>[Policyholders] { <col0>[INT]:[PRIMARY] <col1>[KEY]:[FirstName] <col2>[VARCHAR]:[LastName] <col3>[VARCHAR]:[Age] <col4>[INT]:[Gender] <col5>[VARCHAR]:[City] } <table1>[Policies] { <col0>[INT]:[PRIMARY] <col1>[KEY]:[PolicyholderId] <col2>[INT]:[PolicyType] <col3>[VARCHAR]:[CoverageAmount] <col4>[DECIMAL]:[FOREIGN] <col5>[KEY]:[PolicyholderId] <col6>[REFERENCES]:[Policyholders] } <table2>[Claims] { <col0>[INT]:[PRIMARY] <col1>[KEY]:[PolicyId] <col2>[INT]:[ClaimAmount] <col3>[DECIMAL]:[ClaimDate] <col4>[DATE]:[FOREIGN] <col5>[KEY]:[PolicyId] <col6>[REFERENCES]:[Policies] }
SELECT P.City, P.FirstName, P.LastName, AVG( C.ClaimAmount ) as AverageClaimAmount, COUNT( C.Id ) as NumberOfClaims FROM `<table0>` P JOIN Policies PL ON P.Id = PL.PolicyholderId JOIN Claims C ON PL.Id = C.PolicyId WHERE P.City = 'Seattle' GROUP BY P.Id HAVING NumberOfClaims > 2 ORDER BY AverageClaimAmount DESC;
What is the average claim amount and number of claims for policyholders in the city of Seattle, WA, who have made more than 2 claims?
<table0>[table_name_10] { <col0>[sr_no]:[INTEGER] <col1>[builder]:[VARCHAR] <col2>[secr_no]:[VARCHAR] }
SELECT AVG( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "beyer peacock" AND `<col2>` = 769
What is Beyer Peacock's SR number with a SECR number of 769?
<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 Headquarter, SUM( Revenue ) FROM `<table0>` AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC
For those records from the products and each product's manufacturer, give me the comparison about the sum of revenue over the headquarter , and group by attribute headquarter by a bar chart, and list by the X from high to low.
<table0>[table_17355408_4] { <col0>[record]:[VARCHAR] <col1>[team]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "New Orleans"
Name the record for new orleans
<table0>[vehicle_accessibility] { <col0>[vehicle_id]:[INT] <col1>[vehicle_type]:[VARCHAR] <col2>[accessible]:[BOOLEAN] }
SELECT vehicle_type, SUM( `<col2>` ) as number_of_accessible_vehicles, SUM( NOT `<col2>` ) as number_of_non_accessible_vehicles FROM `<table0>` GROUP BY vehicle_type;
Find the number of accessible and non-accessible vehicles in the fleet
<table0>[table_29747178_2] { <col0>[title]:[VARCHAR] <col1>[series__number]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 7
What is the title when the series # is 7?
<table0>[ReviewTaskResults] { <col0>[number]:[ReviewTaskId] <col1>[number]:[ReviewTaskResultTypeId] <col2>[number]:[CreationDate] <col3>[time]:[RejectionReasonId] <col4>[number]:[Comment] } <table1>[SuggestedEditVotes] { <col0>[number]:[SuggestedEditId] <col1>[number]:[UserId] <col2>[number]:[VoteTypeId] <col3>[number]:[CreationDate] <col4>[time]:[TargetUserId] <col5>[number]:[TargetRepChange] } <table2>[CloseAsOffTopicReasonTypes] { <col0>[number]:[IsUniversal] <col1>[boolean]:[InputTitle] <col2>[text]:[MarkdownInputGuidance] <col3>[text]:[MarkdownPostOwnerGuidance] <col4>[text]:[MarkdownPrivilegedUserGuidance] <col5>[text]:[MarkdownConcensusDescription] <col6>[text]:[CreationDate] <col7>[time]:[CreationModeratorId] <col8>[number]:[ApprovalDate] <col9>[time]:[ApprovalModeratorId] <col10>[number]:[DeactivationDate] <col11>[time]:[DeactivationModeratorId] } <table3>[VoteTypes] { <col0>[number]:[text] } <table4>[Votes] { <col0>[number]:[PostId] <col1>[number]:[VoteTypeId] <col2>[number]:[UserId] <col3>[number]:[CreationDate] <col4>[time]:[BountyAmount] } <table5>[PendingFlags] { <col0>[number]:[FlagTypeId] <col1>[number]:[PostId] <col2>[number]:[CreationDate] <col3>[time]:[CloseReasonTypeId] <col4>[number]:[CloseAsOffTopicReasonTypeId] <col5>[number]:[DuplicateOfQuestionId] <col6>[number]:[BelongsOnBaseHostAddress] } <table6>[PostLinks] { <col0>[number]:[CreationDate] <col1>[time]:[PostId] <col2>[number]:[RelatedPostId] <col3>[number]:[LinkTypeId] } <table7>[Posts] { <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]:[LastEditorUserId] <col11>[number]:[LastEditorDisplayName] <col12>[text]:[LastEditDate] <col13>[time]:[LastActivityDate] <col14>[time]:[Title] <col15>[text]:[Tags] <col16>[text]:[AnswerCount] <col17>[number]:[CommentCount] <col18>[number]:[FavoriteCount] <col19>[number]:[ClosedDate] <col20>[time]:[CommunityOwnedDate] <col21>[time]:[ContentLicense] } <table8>[PostHistoryTypes] { <col0>[number]:[text] } <table9>[PostTags] { <col0>[PostId]:[number] <col1>[TagId]:[number] } <table10>[ReviewTaskResultTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table11>[TagSynonyms] { <col0>[number]:[SourceTagName] <col1>[text]:[TargetTagName] <col2>[text]:[CreationDate] <col3>[time]:[OwnerUserId] <col4>[number]:[AutoRenameCount] <col5>[number]:[LastAutoRename] <col6>[time]:[Score] <col7>[number]:[ApprovedByUserId] <col8>[number]:[ApprovalDate] } <table12>[PostNotices] { <col0>[number]:[PostId] <col1>[number]:[PostNoticeTypeId] <col2>[number]:[CreationDate] <col3>[time]:[DeletionDate] <col4>[time]:[ExpiryDate] <col5>[time]:[Body] <col6>[text]:[OwnerUserId] <col7>[number]:[DeletionUserId] } <table13>[SuggestedEdits] { <col0>[number]:[PostId] <col1>[number]:[CreationDate] <col2>[time]:[ApprovalDate] <col3>[time]:[RejectionDate] <col4>[time]:[OwnerUserId] <col5>[number]:[Comment] <col6>[text]:[Text] <col7>[text]:[Title] <col8>[text]:[Tags] <col9>[text]:[RevisionGUID] } <table14>[PostHistory] { <col0>[number]:[PostHistoryTypeId] <col1>[number]:[PostId] <col2>[number]:[RevisionGUID] <col3>[CreationDate]:[time] <col4>[UserId]:[number] <col5>[UserDisplayName]:[text] <col6>[Comment]:[text] <col7>[Text]:[text] <col8>[ContentLicense]:[text] } <table15>[PostFeedback] { <col0>[number]:[PostId] <col1>[number]:[IsAnonymous] <col2>[boolean]:[VoteTypeId] <col3>[number]:[CreationDate] } <table16>[ReviewTaskStates] { <col0>[number]:[text] <col1>[Description]:[text] } <table17>[Comments] { <col0>[number]:[PostId] <col1>[number]:[Score] <col2>[number]:[Text] <col3>[text]:[CreationDate] <col4>[time]:[UserDisplayName] <col5>[text]:[UserId] <col6>[number]:[ContentLicense] } <table18>[PostNoticeTypes] { <col0>[number]:[ClassId] <col1>[number]:[text] <col2>[Body]:[text] <col3>[IsHidden]:[boolean] <col4>[Predefined]:[boolean] <col5>[PostNoticeDurationId]:[number] } <table19>[Users] { <col0>[number]:[Reputation] <col1>[number]:[CreationDate] <col2>[time]:[DisplayName] <col3>[text]:[LastAccessDate] <col4>[time]:[WebsiteUrl] <col5>[text]:[Location] <col6>[text]:[AboutMe] <col7>[text]:[Views] <col8>[number]:[UpVotes] <col9>[number]:[DownVotes] <col10>[number]:[ProfileImageUrl] <col11>[text]:[EmailHash] <col12>[text]:[AccountId] } <table20>[PostTypes] { <col0>[number]:[text] } <table21>[Tags] { <col0>[number]:[TagName] <col1>[text]:[Count] <col2>[number]:[ExcerptPostId] <col3>[number]:[WikiPostId] } <table22>[ReviewTaskTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table23>[ReviewRejectionReasons] { <col0>[number]:[text] <col1>[Description]:[text] <col2>[PostTypeId]:[number] } <table24>[FlagTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table25>[CloseReasonTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table26>[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]:[LastEditorUserId] <col11>[number]:[LastEditorDisplayName] <col12>[text]:[LastEditDate] <col13>[time]:[LastActivityDate] <col14>[time]:[Title] <col15>[text]:[Tags] <col16>[text]:[AnswerCount] <col17>[number]:[CommentCount] <col18>[number]:[FavoriteCount] <col19>[number]:[ClosedDate] <col20>[time]:[CommunityOwnedDate] <col21>[time]:[ContentLicense] } <table27>[Badges] { <col0>[number]:[UserId] <col1>[number]:[text] <col2>[Date]:[time] <col3>[Class]:[number] <col4>[TagBased]:[boolean] } <table28>[ReviewTasks] { <col0>[number]:[ReviewTaskTypeId] <col1>[number]:[CreationDate] <col2>[time]:[DeletionDate] <col3>[time]:[ReviewTaskStateId] <col4>[number]:[PostId] <col5>[number]:[SuggestedEditId] <col6>[number]:[CompletedByReviewTaskId] }
SELECT `<table7>`.Id, `<table7>`.Id AS "post_link" FROM `<table7>` WHERE OwnerDisplayName = '##DisplayName##' AND PostTypeId = '##PostType##' ORDER BY `<table7>`.CreationDate DESC
Posts by a given user by displayname.
<table0>[table_1342218_11] { <col0>[first_elected]:[VARCHAR] <col1>[candidates]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "William M. Wheeler ( D ) Unopposed"
What year was first elected william m. wheeler (d) unopposed?
<table0>[vitalperiodic] { <col0>[vitalperiodicid]:[number] <col1>[patientunitstayid]:[number] <col2>[temperature]:[number] <col3>[sao2]:[number] <col4>[heartrate]:[number] <col5>[respiration]:[number] <col6>[systemicsystolic]:[number] <col7>[systemicdiastolic]:[number] <col8>[systemicmean]:[number] <col9>[observationtime]:[time] } <table1>[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>[dischargeweight]:[number] <col11>[hospitaladmittime]:[time] <col12>[hospitaladmitsource]:[text] <col13>[unitadmittime]:[time] <col14>[unitdischargetime]:[time] <col15>[hospitaldischargetime]:[time] <col16>[hospitaldischargestatus]:[text] } <table2>[intakeoutput] { <col0>[intakeoutputid]:[number] <col1>[patientunitstayid]:[number] <col2>[cellpath]:[text] <col3>[celllabel]:[text] <col4>[cellvaluenumeric]:[number] <col5>[intakeoutputtime]:[time] } <table3>[allergy] { <col0>[allergyid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[allergyname]:[text] <col4>[allergytime]:[time] } <table4>[cost] { <col0>[costid]:[number] <col1>[uniquepid]:[text] <col2>[patienthealthsystemstayid]:[number] <col3>[eventtype]:[text] <col4>[eventid]:[number] <col5>[chargetime]:[time] } <table5>[medication] { <col0>[medicationid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[dosage]:[text] <col4>[routeadmin]:[text] <col5>[drugstarttime]:[time] <col6>[drugstoptime]:[time] } <table6>[lab] { <col0>[labid]:[number] <col1>[patientunitstayid]:[number] <col2>[labname]:[text] <col3>[labresult]:[number] <col4>[labresulttime]:[time] } <table7>[diagnosis] { <col0>[diagnosisid]:[number] <col1>[patientunitstayid]:[number] <col2>[diagnosisname]:[text] <col3>[diagnosistime]:[time] <col4>[icd9code]:[text] } <table8>[treatment] { <col0>[treatmentid]:[number] <col1>[patientunitstayid]:[number] <col2>[treatmentname]:[text] <col3>[treatmenttime]:[time] } <table9>[microlab] { <col0>[microlabid]:[number] <col1>[patientunitstayid]:[number] <col2>[culturesite]:[text] <col3>[organism]:[text] <col4>[culturetakentime]:[time] }
SELECT COUNT( DISTINCT t1.uniquepid ) FROM ( SELECT patient.uniquepid, `<table8>`.`<table8>`time, patient.patienthealthsystemstayid FROM `<table8>` JOIN patient ON `<table8>`.patientunitstayid = patient.patientunitstayid WHERE `<table8>`.`<table8>`name = 'oncology consultation' AND STRFTIME( '%y', `<table8>`.`<table8>`time ) = '2105' ) AS t1 JOIN ( SELECT patient.uniquepid, `<table7>`.`<table7>`time, patient.patienthealthsystemstayid FROM `<table7>` JOIN patient ON `<table7>`.patientunitstayid = patient.patientunitstayid WHERE `<table7>`.`<table7>`name = 'hypercoagulable state - heparin induced thrombocytopenia' AND STRFTIME( '%y', `<table7>`.`<table7>`time ) = '2105' ) AS t2 WHERE t1.`<table8>`time < t2.`<table7>`time AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid
how many patients were diagnosed with hypercoagulable state - heparin induced thrombocytopenia in the same hospital visit in 2105 after they underwent oncology consultation?
<table0>[mobile_subscriptions] { <col0>[INT]:[user_id] <col1>[INT]:[subscription_plan] <col2>[VARCHAR]:[upgrade_date] <col3>[DATE]:[INSERT] }
SELECT COUNT( DISTINCT user_id ) * 100.0 / ( SELECT COUNT( DISTINCT user_id ) FROM `<table0>` ) as pct_upgraded FROM `<table0>` WHERE upgrade_date >= DATEADD( quarter, -1, GETDATE( ) ) GROUP BY subscription_plan;
What is the percentage of mobile users who upgraded their subscription plan in the last quarter?
<table0>[table_203_67] { <col0>[number]:[place] <col1>[number]:[team] <col2>[text]:[played] <col3>[number]:[won] <col4>[number]:[draw] <col5>[number]:[lost] <col6>[number]:[goals] <col7>[nscored]:[number] <col8>[goals]:[nconceded] <col9>[number]:[number] <col10>[points]:[number] }
SELECT SUM( "played" ) FROM `<table0>`
how many games were played ?
<table0>[table_204_27] { <col0>[number]:[name] <col1>[text]:[position] <col2>[text]:[year] <col3>[text]:[league] <col4>[napps]:[number] <col5>[league]:[ngoals] <col6>[number]:[total] <col7>[napps]:[number] <col8>[total]:[ngoals] <col9>[number]:[notes] }
SELECT "name" FROM `<table0>` WHERE "total\ngoals" = "total\napps"
which player 's number of total goals is the same as his number of total appearances ?
<table0>[labevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[itemid]:[number] <col4>[charttime]:[time] <col5>[valuenum]:[number] <col6>[valueuom]:[text] } <table1>[icustays] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[first_careunit]:[text] <col5>[last_careunit]:[text] <col6>[first_wardid]:[number] <col7>[last_wardid]:[number] <col8>[intime]:[time] <col9>[outtime]:[time] } <table2>[admissions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[admittime]:[time] <col4>[dischtime]:[time] <col5>[admission_type]:[text] <col6>[admission_location]:[text] <col7>[discharge_location]:[text] <col8>[insurance]:[text] <col9>[language]:[text] <col10>[marital_status]:[text] <col11>[ethnicity]:[text] <col12>[age]:[number] } <table3>[patients] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[gender]:[text] <col3>[dob]:[time] <col4>[dod]:[time] } <table4>[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] } <table5>[inputevents_cv] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[charttime]:[time] <col5>[itemid]:[number] } <table6>[procedures_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table7>[d_icd_procedures] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table8>[d_labitems] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] } <table9>[d_items] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] <col3>[linksto]:[text] } <table10>[outputevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[charttime]:[time] <col5>[itemid]:[number] <col6>[value]:[number] } <table11>[cost] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[event_type]:[text] <col4>[event_id]:[number] <col5>[chargetime]:[time] } <table12>[chartevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[itemid]:[number] <col5>[charttime]:[time] <col6>[valuenum]:[number] <col7>[valueuom]:[text] } <table13>[d_icd_diagnoses] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table14>[prescriptions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[startdate]:[time] <col4>[enddate]:[time] <col5>[drug]:[text] <col6>[dose_val_rx]:[text] <col7>[dose_unit_rx]:[text] <col8>[route]:[text] } <table15>[diagnoses_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table16>[transfers] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[eventtype]:[text] <col5>[careunit]:[text] <col6>[wardid]:[number] <col7>[intime]:[time] <col8>[outtime]:[time] }
SELECT `<table0>`.charttime FROM `<table0>` WHERE `<table0>`.itemid IN ( SELECT `<table8>`.itemid FROM `<table8>` WHERE `<table8>`.label = 'neutrophils' ) AND `<table0>`.hadm_id IN ( SELECT `<table2>`.hadm_id FROM `<table2>` WHERE `<table2>`.subject_id = 10624 ) AND STRFTIME( '%y-%m', `<table0>`.charttime ) = '2105-12' ORDER BY `<table0>`.charttime LIMIT 1
when did patient 10624 receive a neutrophils lab test, the first time, in 12/2105?
<table0>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table1>[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>[ethnicity]:[text] <col13>[expire_flag]:[text] <col14>[admission_location]:[text] <col15>[discharge_location]:[text] <col16>[diagnosis]:[text] <col17>[dod]:[text] <col18>[dob_year]:[text] <col19>[dod_year]:[text] <col20>[admittime]:[text] <col21>[dischtime]:[text] <col22>[admityear]:[text] } <table2>[diagnoses] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table3>[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] } <table4>[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] }
SELECT MIN( `<table1>`.age ) FROM `<table1>` WHERE `<table1>`.expire_flag = "0" AND `<table1>`.discharge_location = "DISC-TRAN CANCER/CHLDRN H"
tell me the minimum age of patients with death status as 0 and discharge location as disc-tran cancer chldrn h.
<table0>[table_name_23] { <col0>[snow__days_year]:[INTEGER] <col1>[sunshine__hrs_year]:[VARCHAR] <col2>[storms__days_year]:[VARCHAR] }
SELECT AVG( snow__days_year_ ) FROM `<table0>` WHERE sunshine__hrs_year_ = "1 633" AND storms__days_year_ < 29
What is the amount of snow where the sunshine is 1 633, and storms are lower than 29?
<table0>[microlab] { <col0>[microlabid]:[number] <col1>[patientunitstayid]:[number] <col2>[culturesite]:[text] <col3>[organism]:[text] <col4>[culturetakentime]:[time] } <table1>[treatment] { <col0>[treatmentid]:[number] <col1>[patientunitstayid]:[number] <col2>[treatmentname]:[text] <col3>[treatmenttime]:[time] } <table2>[allergy] { <col0>[allergyid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[allergyname]:[text] <col4>[allergytime]:[time] } <table3>[lab] { <col0>[labid]:[number] <col1>[patientunitstayid]:[number] <col2>[labname]:[text] <col3>[labresult]:[number] <col4>[labresulttime]:[time] } <table4>[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>[dischargeweight]:[number] <col11>[hospitaladmittime]:[time] <col12>[hospitaladmitsource]:[text] <col13>[unitadmittime]:[time] <col14>[unitdischargetime]:[time] <col15>[hospitaldischargetime]:[time] <col16>[hospitaldischargestatus]:[text] } <table5>[intakeoutput] { <col0>[intakeoutputid]:[number] <col1>[patientunitstayid]:[number] <col2>[cellpath]:[text] <col3>[celllabel]:[text] <col4>[cellvaluenumeric]:[number] <col5>[intakeoutputtime]:[time] } <table6>[diagnosis] { <col0>[diagnosisid]:[number] <col1>[patientunitstayid]:[number] <col2>[diagnosisname]:[text] <col3>[diagnosistime]:[time] <col4>[icd9code]:[text] } <table7>[cost] { <col0>[costid]:[number] <col1>[uniquepid]:[text] <col2>[patienthealthsystemstayid]:[number] <col3>[eventtype]:[text] <col4>[eventid]:[number] <col5>[chargetime]:[time] } <table8>[vitalperiodic] { <col0>[vitalperiodicid]:[number] <col1>[patientunitstayid]:[number] <col2>[temperature]:[number] <col3>[sao2]:[number] <col4>[heartrate]:[number] <col5>[respiration]:[number] <col6>[systemicsystolic]:[number] <col7>[systemicdiastolic]:[number] <col8>[systemicmean]:[number] <col9>[observationtime]:[time] } <table9>[medication] { <col0>[medicationid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[dosage]:[text] <col4>[routeadmin]:[text] <col5>[drugstarttime]:[time] <col6>[drugstoptime]:[time] }
SELECT t2.drugname FROM ( SELECT `<table4>`.uniquepid, `<table1>`.`<table1>`time FROM `<table1>` JOIN `<table4>` ON `<table1>`.`<table4>`unitstayid = `<table4>`.`<table4>`unitstayid WHERE `<table4>`.`<table4>`healthsystemstayid IN ( SELECT `<table4>`.`<table4>`healthsystemstayid FROM `<table4>` WHERE `<table4>`.uniquepid = '012-58944' ) AND `<table1>`.`<table1>`name = 'trauma surgery consultation' AND DATETIME( `<table1>`.`<table1>`time ) >= DATETIME( CURRENT_TIME( ), '-83 month' ) ) AS t1 JOIN ( SELECT `<table4>`.uniquepid, `<table9>`.drugname, `<table9>`.drugstarttime FROM `<table9>` JOIN `<table4>` ON `<table9>`.`<table4>`unitstayid = `<table4>`.`<table4>`unitstayid WHERE `<table4>`.`<table4>`healthsystemstayid IN ( SELECT `<table4>`.`<table4>`healthsystemstayid FROM `<table4>` WHERE `<table4>`.uniquepid = '012-58944' ) AND DATETIME( `<table9>`.drugstarttime ) >= DATETIME( CURRENT_TIME( ), '-83 month' ) ) AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.`<table1>`time < t2.drugstarttime AND DATETIME( t1.`<table1>`time, 'start of day' ) = DATETIME( t2.drugstarttime, 'start of day' )
tell me the name of the drug that patient 012-58944 was prescribed in the same day after having received a trauma surgery consultation procedure since 83 months ago.
<table0>[CREATE] { <col0>[SCHEMA]:[urban_agriculture] } <table1>[urban_crops] { <col0>[INT]:[type] <col1>[VARCHAR]:[planting_date] <col2>[DATE]:[INSERT] }
SELECT type, planting_date FROM urban_agriculture.urban_crops;
Identify the types of crops grown in urban areas, along with their respective planting dates, from the 'urban_agriculture' schema?
<table0>[table_name_83] { <col0>[team]:[VARCHAR] <col1>[laps]:[VARCHAR] <col2>[co_drivers]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` < 315 AND `<col2>` = "david brabham franck lagorce"
Name the team with laps less than 315 and co-drivers of david brabham franck lagorce?
<table0>[table_name_97] { <col0>[bronze]:[VARCHAR] <col1>[gold]:[VARCHAR] <col2>[silver]:[VARCHAR] <col3>[total]:[VARCHAR] }
SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col2>` > 0 AND `<col3>` = 7 AND `<col1>` < 1
What is the total number of bronze a team with more than 0 silver, a total of 7 medals, and less than 1 gold medal has?
<table0>[drug_approval] { <col0>[INT]:[drug_id] <col1>[INT]:[country] <col2>[VARCHAR]:[INSERT] }
SELECT da.drug_id, da.country FROM `<table0>` da WHERE da.country = 'Canada';
Which drugs have been approved in a specific country?
<table0>[table_name_43] { <col0>[record]:[VARCHAR] <col1>[leading_scorer]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "andrew bogut ( 21 )"
What is the record of the game with Andrew Bogut (21) as the leading scorer?
<table0>[table_23950611_2] { <col0>[rank__all__2013]:[VARCHAR] <col1>[name]:[VARCHAR] }
SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "Cenovus Energy"
How many companies named cenovus energy?
<table0>[transfers] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[eventtype]:[text] <col5>[careunit]:[text] <col6>[wardid]:[number] <col7>[intime]:[time] <col8>[outtime]:[time] } <table1>[d_items] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] <col3>[linksto]:[text] } <table2>[diagnoses_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table3>[cost] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[event_type]:[text] <col4>[event_id]:[number] <col5>[chargetime]:[time] } <table4>[procedures_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table5>[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] } <table6>[labevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[itemid]:[number] <col4>[charttime]:[time] <col5>[valuenum]:[number] <col6>[valueuom]:[text] } <table7>[d_icd_diagnoses] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table8>[d_labitems] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] } <table9>[chartevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[itemid]:[number] <col5>[charttime]:[time] <col6>[valuenum]:[number] <col7>[valueuom]:[text] } <table10>[d_icd_procedures] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table11>[inputevents_cv] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[charttime]:[time] <col5>[itemid]:[number] } <table12>[admissions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[admittime]:[time] <col4>[dischtime]:[time] <col5>[admission_type]:[text] <col6>[admission_location]:[text] <col7>[discharge_location]:[text] <col8>[insurance]:[text] <col9>[language]:[text] <col10>[marital_status]:[text] <col11>[ethnicity]:[text] <col12>[age]:[number] } <table13>[patients] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[gender]:[text] <col3>[dob]:[time] <col4>[dod]:[time] } <table14>[outputevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[charttime]:[time] <col5>[itemid]:[number] <col6>[value]:[number] } <table15>[prescriptions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[startdate]:[time] <col4>[enddate]:[time] <col5>[drug]:[text] <col6>[dose_val_rx]:[text] <col7>[dose_unit_rx]:[text] <col8>[route]:[text] } <table16>[icustays] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[first_careunit]:[text] <col5>[last_careunit]:[text] <col6>[first_wardid]:[number] <col7>[last_wardid]:[number] <col8>[intime]:[time] <col9>[outtime]:[time] }
SELECT 24 * ( STRFTIME( '%j', CURRENT_TIME( ) ) - STRFTIME( '%j', `<table12>`.admittime ) ) FROM `<table12>` WHERE `<table12>`.subject_id = 40059 AND `<table12>`.dischtime IS NULL
how many hours have passed since patient 40059 was admitted to the hospital.
<table0>[table_28051859_3] { <col0>[tenure]:[VARCHAR] <col1>[school]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Field"
When were the members tenured in the Field school?
<table0>[machines] { <col0>[INT]:[name] <col1>[VARCHAR]:[operational_status] <col2>[VARCHAR]:[region] <col3>[VARCHAR]:[INSERT] }
SELECT * FROM `<table0>` WHERE operational_status = 'active' AND region = 'South';
List all the machines with an operational status of 'active' in the 'South' region
<table0>[t_kc24] { <col0>[MED_SAFE_PAY_ID]:[text] <col1>[OVERALL_CD_ORG]:[text] <col2>[OVERALL_CD_PERSON]:[text] <col3>[MED_CLINIC_ID]:[text] <col4>[REF_SLT_FLG]:[number] <col5>[CLINIC_SLT_DATE]:[time] <col6>[COMP_ID]:[text] <col7>[PERSON_ID]:[text] <col8>[FLX_MED_ORG_ID]:[text] <col9>[INSU_TYPE]:[text] <col10>[MED_AMOUT]:[number] <col11>[PER_ACC_PAY]:[number] <col12>[OVE_PAY]:[number] <col13>[ILL_PAY]:[number] <col14>[CIVIL_SUBSIDY]:[number] <col15>[PER_SOL]:[number] <col16>[PER_EXP]:[number] <col17>[DATA_ID]:[text] <col18>[SYNC_TIME]:[time] <col19>[OUT_HOSP_DATE]:[time] <col20>[CLINIC_ID]:[text] <col21>[MED_TYPE]:[number] <col22>[INSURED_STS]:[text] <col23>[INSURED_IDENTITY]:[number] <col24>[TRADE_TYPE]:[number] <col25>[RECIPE_BILL_ID]:[text] <col26>[ACCOUNT_DASH_DATE]:[time] <col27>[ACCOUNT_DASH_FLG]:[number] <col28>[REIMBURS_FLG]:[number] <col29>[SENDER_DEAL_ID]:[text] <col30>[RECEIVER_DEAL_ID]:[text] <col31>[SENDER_REVOKE_ID]:[text] <col32>[RECEIVER_REVOKE_ID]:[text] <col33>[SENDER_OFFSET_ID]:[text] <col34>[RECEIVER_OFFSET_ID]:[text] <col35>[LAS_OVE_PAY]:[number] <col36>[OVE_ADD_PAY]:[number] <col37>[SUP_ADD_PAY]:[number] <col38>[CKC102]:[number] <col39>[CASH_PAY]:[number] <col40>[COM_ACC_PAY]:[number] <col41>[ENT_ACC_PAY]:[number] <col42>[ENT_PAY]:[number] <col43>[COM_PAY]:[number] <col44>[OLDC_FUND_PAY]:[number] <col45>[SPE_FUND_PAY]:[number] } <table1>[t_kc21] { <col0>[MED_CLINIC_ID]:[text] <col1>[OVERALL_CD_ORG]:[text] <col2>[OVERALL_CD_PERSON]:[text] <col3>[COMP_ID]:[text] <col4>[PERSON_ID]:[text] <col5>[PERSON_NM]:[text] <col6>[IDENTITY_CARD]:[text] <col7>[SOC_SRT_CARD]:[text] <col8>[PERSON_SEX]:[number] <col9>[PERSON_AGE]:[number] <col10>[IN_HOSP_DATE]:[time] <col11>[OUT_HOSP_DATE]:[time] <col12>[DIFF_PLACE_FLG]:[number] <col13>[FLX_MED_ORG_ID]:[text] <col14>[MED_SER_ORG_NO]:[text] <col15>[CLINIC_TYPE]:[text] <col16>[MED_TYPE]:[number] <col17>[CLINIC_ID]:[text] <col18>[IN_DIAG_DIS_CD]:[text] <col19>[IN_DIAG_DIS_NM]:[text] <col20>[OUT_DIAG_DIS_CD]:[text] <col21>[OUT_DIAG_DIS_NM]:[text] <col22>[INPT_AREA_BED]:[text] <col23>[MED_ORG_DEPT_CD]:[text] <col24>[MED_ORG_DEPT_NM]:[text] <col25>[OUT_DIAG_DOC_CD]:[text] <col26>[OUT_DIAG_DOC_NM]:[text] <col27>[MAIN_COND_DES]:[text] <col28>[INSU_TYPE]:[text] <col29>[IN_HOSP_DAYS]:[number] <col30>[MED_AMOUT]:[number] <col31>[FERTILITY_STS]:[number] <col32>[DATA_ID]:[text] <col33>[SYNC_TIME]:[time] <col34>[REIMBURSEMENT_FLG]:[number] <col35>[HOSP_LEV]:[number] <col36>[HOSP_STS]:[number] <col37>[INSURED_IDENTITY]:[number] <col38>[SERVANT_FLG]:[text] <col39>[TRADE_TYPE]:[number] <col40>[INSURED_STS]:[text] <col41>[REMOTE_SETTLE_FLG]:[text] } <table2>[t_kc22] { <col0>[MED_EXP_DET_ID]:[text] <col1>[OVERALL_CD_ORG]:[text] <col2>[OVERALL_CD_PERSON]:[text] <col3>[MED_CLINIC_ID]:[text] <col4>[MED_EXP_BILL_ID]:[text] <col5>[SOC_SRT_DIRE_CD]:[text] <col6>[SOC_SRT_DIRE_NM]:[text] <col7>[DIRE_TYPE]:[number] <col8>[CHA_ITEM_LEV]:[number] <col9>[MED_INV_ITEM_TYPE]:[text] <col10>[MED_DIRE_CD]:[text] <col11>[MED_DIRE_NM]:[text] <col12>[VAL_UNIT]:[text] <col13>[DOSE_UNIT]:[text] <col14>[DOSE_FORM]:[text] <col15>[SPEC]:[text] <col16>[USE_FRE]:[text] <col17>[EACH_DOSAGE]:[text] <col18>[QTY]:[number] <col19>[UNIVALENT]:[number] <col20>[number]:[SELF_PAY_PRO] <col21>[number]:[RER_SOL] <col22>[number]:[SELF_PAY_AMO] <col23>[number]:[UP_LIMIT_AMO] <col24>[number]:[OVE_SELF_AMO] <col25>[number]:[EXP_OCC_DATE] <col26>[time]:[RECIPE_BILL_ID] <col27>[text]:[FLX_MED_ORG_ID] <col28>[text]:[MED_ORG_DEPT_CD] <col29>[text]:[MED_ORG_DEPT_NM] <col30>[text]:[HOSP_DOC_CD] <col31>[text]:[HOSP_DOC_NM] <col32>[text]:[REF_STA_FLG] <col33>[number]:[DATA_ID] <col34>[text]:[SYNC_TIME] <col35>[time]:[PRESCRIPTION_CODE] <col36>[text]:[PRESCRIPTION_ID] <col37>[text]:[TRADE_TYPE] <col38>[number]:[STA_FLG] <col39>[number]:[STA_DATE] <col40>[time]:[REIMBURS_TYPE] <col41>[number]:[FXBZ] <col42>[number]:[REMOTE_SETTLE_FLG] }
SELECT SUM( `<col18>` ), SUM( AMOUNT ) FROM `<table2>` WHERE `<col5>` = '086613-f' AND STA_DATE BETWEEN '2001-04-16' AND '2003-12-14'
01年4月16日到03年12月14日这段时间里,一共开出了多少药品086613-f,看看总金额
<table0>[Player] { <col0>[Player_ID]:[INT] <col1>[VARCHAR]:[Date_Joined] <col2>[DATE]:[INSERT] }
INSERT INTO Player ( Player_ID, Name, Date_Joined ) VALUES ( 4, 'Bob Brown', '2020-08-10' );
Insert a new record for a player with Player_ID 4, name 'Bob Brown', and date 2020-08-10 into the 'Player' table