ajayk007/querysmith-spider-bird huggingface dataset:
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
CREATE TABLE offices (
  officeCode text PRIMARY KEY,
  city text,
  phone text,
  addressLine1 text,
  addressLine2 text,
  state text,
  country text,
  postalCode text,
  territory text
);
CREATE TABLE employees (
  employeeNumber integer PRIMARY KEY,
  lastName text,
  firstName text,
  extension text,
  email text,
  officeCode text,
  reportsTo integer,
  jobTitle text
);
CREATE TABLE customers (
  customerNumber integer PRIMARY KEY,
  customerName text,
  contactLastName text,
  contactFirstName text,
  phone text,
  addressLine1 text,
  addressLine2 text,
  city text,
  state text,
  postalCode text,
  country text,
  salesRepEmployeeNumber integer,
  creditLimit real
);
CREATE TABLE orders (
  orderNumber integer PRIMARY KEY,
  orderDate date,
  requiredDate date,
  shippedDate date,
  status text,
  comments text,
  customerNumber integer
);
CREATE TABLE payments (
  customerNumber integer PRIMARY KEY,
  checkNumber text PRIMARY KEY,
  paymentDate date,
  amount real
);
CREATE TABLE productlines (
  productLine text PRIMARY KEY,
  textDescription text,
  htmlDescription text,
  image blob
);
CREATE TABLE products (
  productCode text PRIMARY KEY,
  productName text,
  productLine text,
  productScale text,
  productVendor text,
  productDescription text,
  quantityInStock integer,
  buyPrice real,
  MSRP real
);
CREATE TABLE orderdetails (
  orderNumber integer PRIMARY KEY,
  productCode text PRIMARY KEY,
  quantityOrdered integer,
  priceEach real,
  orderLineNumber integer
);
-- foreign keys: employees.reportsTo -> employees.employeeNumber; employees.officeCode -> offices.officeCode; customers.salesRepEmployeeNumber -> employees.employeeNumber; orders.customerNumber -> customers.customerNumber; payments.customerNumber -> customers.customerNumber; products.productLine -> productlines.productLine

Hint: Address comprises addressLine1 and addressLine2;

Question: Where was the order No. 10383 shipped to? Show me the address.

assistant: SELECT t2.addressLine1, t2.addressLine2 FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t1.orderNumber = '10383'
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
CREATE TABLE ATT_CLASSES (
  ATT_CLASS_ID integer PRIMARY KEY,
  ATT_CLASS text
);
CREATE TABLE OBJ_CLASSES (
  OBJ_CLASS_ID integer PRIMARY KEY,
  OBJ_CLASS text
);
CREATE TABLE IMG_OBJ (
  IMG_ID integer PRIMARY KEY,
  OBJ_SAMPLE_ID integer PRIMARY KEY,
  OBJ_CLASS_ID integer,
  X integer,
  Y integer,
  W integer,
  H integer
);
CREATE TABLE IMG_OBJ_ATT (
  IMG_ID integer PRIMARY KEY,
  ATT_CLASS_ID integer PRIMARY KEY,
  OBJ_SAMPLE_ID integer PRIMARY KEY
);
CREATE TABLE PRED_CLASSES (
  PRED_CLASS_ID integer PRIMARY KEY,
  PRED_CLASS text
);
CREATE TABLE IMG_REL (
  IMG_ID integer PRIMARY KEY,
  PRED_CLASS_ID integer PRIMARY KEY,
  OBJ1_SAMPLE_ID integer PRIMARY KEY,
  OBJ2_SAMPLE_ID integer PRIMARY KEY
);
-- foreign keys: IMG_OBJ.OBJ_CLASS_ID -> OBJ_CLASSES.OBJ_CLASS_ID; IMG_OBJ_ATT.IMG_ID -> IMG_OBJ.IMG_ID; IMG_OBJ_ATT.OBJ_SAMPLE_ID -> IMG_OBJ.OBJ_SAMPLE_ID; IMG_OBJ_ATT.ATT_CLASS_ID -> ATT_CLASSES.ATT_CLASS_ID; IMG_REL.IMG_ID -> IMG_OBJ.IMG_ID; IMG_REL.OBJ2_SAMPLE_ID -> IMG_OBJ.OBJ_SAMPLE_ID; IMG_REL.IMG_ID -> IMG_OBJ.IMG_ID; IMG_REL.OBJ1_SAMPLE_ID -> IMG_OBJ.OBJ_SAMPLE_ID; IMG_REL.PRED_CLASS_ID -> PRED_CLASSES.PRED_CLASS_ID

Hint: bounding boxes of the object samples refers to (x, y, W, H); predicted relation class of "by" refers to PRED_CLASS = 'by'; image no.1 refers to IMG_ID = 1

Question: What are the bounding boxes of the object samples with a predicted relation class of "by" in image no.1?

assistant: SELECT T3.X, T3.Y, T3.W, T3.H FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.OBJ1_SAMPLE_ID = T3.OBJ_CLASS_ID WHERE T2.IMG_ID = 1 AND T1.PRED_CLASS = 'by'
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
CREATE TABLE current (
  ballotpedia_id text,
  bioguide_id text PRIMARY KEY,
  birthday_bio date,
  cspan_id real PRIMARY KEY,
  fec_id text,
  first_name text,
  gender_bio text,
  google_entity_id_id text,
  govtrack_id integer,
  house_history_id real,
  icpsr_id real,
  last_name text,
  lis_id text,
  maplight_id real,
  middle_name text,
  nickname_name text,
  official_full_name text,
  opensecrets_id text,
  religion_bio text,
  suffix_name text,
  thomas_id integer,
  votesmart_id real,
  wikidata_id text,
  wikipedia_id text
);
CREATE TABLE current-terms (
  address text,
  bioguide text PRIMARY KEY,
  caucus text,
  chamber text,
  class real,
  contact_form text,
  district real,
  end text PRIMARY KEY,
  fax text,
  last text,
  name text,
  office text,
  party text,
  party_affiliations text,
  phone text,
  relation text,
  rss_url text,
  start text,
  state text,
  state_rank text,
  title text,
  type text,
  url text
);
CREATE TABLE historical (
  ballotpedia_id text,
  bioguide_id text PRIMARY KEY,
  bioguide_previous_id text,
  birthday_bio text,
  cspan_id text,
  fec_id text,
  first_name text,
  gender_bio text,
  google_entity_id_id text,
  govtrack_id integer,
  house_history_alternate_id text,
  house_history_id real,
  icpsr_id real,
  last_name text,
  lis_id text,
  maplight_id text,
  middle_name text,
  nickname_name text,
  official_full_name text,
  opensecrets_id text,
  religion_bio text,
  suffix_name text,
  thomas_id text,
  votesmart_id text,
  wikidata_id text,
  wikipedia_id text
);
CREATE TABLE historical-terms (
  address text,
  bioguide text PRIMARY KEY,
  chamber text,
  class real,
  contact_form text,
  district real,
  end text,
  fax text,
  last text,
  middle text,
  name text,
  office text,
  party text,
  party_affiliations text,
  phone text,
  relation text,
  rss_url text,
  start text,
  state text,
  state_rank text,
  title text,
  type text,
  url text
);
CREATE TABLE social-media (
  bioguide text PRIMARY KEY,
  facebook text,
  facebook_id real,
  govtrack real,
  instagram text,
  instagram_id real,
  thomas integer,
  twitter text,
  twitter_id real,
  youtube text,
  youtube_id text
);
-- foreign keys: current-terms.bioguide -> current.bioguide_id; historical-terms.bioguide -> historical.bioguide_id; social-media.bioguide -> current.bioguide_id

Hint: female refers to gender_bio = 'F'

Question: State the number of female legislators in the list.

assistant: SELECT COUNT(*) FROM current WHERE gender_bio = 'F'
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
CREATE TABLE customer (
  c_custkey integer PRIMARY KEY,
  c_mktsegment text,
  c_nationkey integer,
  c_name text,
  c_address text,
  c_phone text,
  c_acctbal real,
  c_comment text
);
CREATE TABLE lineitem (
  l_shipdate date,
  l_orderkey integer PRIMARY KEY,
  l_discount real,
  l_extendedprice real,
  l_suppkey integer,
  l_quantity integer,
  l_returnflag text,
  l_partkey integer,
  l_linestatus text,
  l_tax real,
  l_commitdate date,
  l_receiptdate date,
  l_shipmode text,
  l_linenumber integer PRIMARY KEY,
  l_shipinstruct text,
  l_comment text
);
CREATE TABLE nation (
  n_nationkey integer PRIMARY KEY,
  n_name text,
  n_regionkey integer,
  n_comment text
);
CREATE TABLE orders (
  o_orderdate date,
  o_orderkey integer PRIMARY KEY,
  o_custkey integer,
  o_orderpriority text,
  o_shippriority integer,
  o_clerk text,
  o_orderstatus text,
  o_totalprice real,
  o_comment text
);
CREATE TABLE part (
  p_partkey integer PRIMARY KEY,
  p_type text,
  p_size integer,
  p_brand text,
  p_name text,
  p_container text,
  p_mfgr text,
  p_retailprice real,
  p_comment text
);
CREATE TABLE partsupp (
  ps_partkey integer PRIMARY KEY,
  ps_suppkey integer PRIMARY KEY,
  ps_supplycost real,
  ps_availqty integer,
  ps_comment text
);
CREATE TABLE region (
  r_regionkey integer PRIMARY KEY,
  r_name text,
  r_comment text
);
CREATE TABLE supplier (
  s_suppkey integer PRIMARY KEY,
  s_nationkey integer,
  s_comment text,
  s_name text,
  s_address text,
  s_phone text,
  s_acctbal real
);
-- foreign keys: customer.c_nationkey -> nation.n_nationkey; lineitem.l_partkey -> partsupp.ps_partkey; lineitem.l_suppkey -> partsupp.ps_suppkey; lineitem.l_orderkey -> orders.o_orderkey; nation.n_regionkey -> region.r_regionkey; orders.o_custkey -> customer.c_custkey; partsupp.ps_suppkey -> supplier.s_suppkey; partsupp.ps_partkey -> part.p_partkey; supplier.s_nationkey -> nation.n_nationkey

Hint: total price refers to o_totalprice; order priority refers to o_orderpriority; order number 33 refers to o_orderkey = 33

Question: What is the total price and the order priority of order number 33?

assistant: SELECT o_totalprice, o_orderpriority FROM orders WHERE o_orderkey = 33
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
CREATE TABLE Question (
  questiontext text,
  questionid integer PRIMARY KEY
);
CREATE TABLE Survey (
  SurveyID integer PRIMARY KEY,
  Description text
);
CREATE TABLE Answer (
  AnswerText text,
  SurveyID integer,
  UserID integer PRIMARY KEY,
  QuestionID integer PRIMARY KEY
);

Hint: AnswerText = 'Yes' where questiontext = 'Do you have a family history of mental illness?'; AnswerText = 'Female' where questionid = 2; AnswerText = 'Nebraska' where questionid = 4

Question: How many female users were surveyed in the mental health survey for 2017 in the state of Nebraska?

assistant: SELECT COUNT(*) FROM ( SELECT T2.UserID FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID INNER JOIN Survey AS T3 ON T2.SurveyID = T3.SurveyID WHERE T3.Description = 'mental health survey for 2017' AND T1.questionid = 2 AND T2.AnswerText = 'Female' UNION SELECT T2.UserID FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID INNER JOIN Survey AS T3 ON T2.SurveyID = T3.SurveyID WHERE T1.questionid = 4 AND T2.AnswerText = 'Nebraska' AND T3.Description = 'mental health survey for 2017' )
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
CREATE TABLE bool (
  name text PRIMARY KEY
);
CREATE TABLE person (
  name text PRIMARY KEY
);
CREATE TABLE disabled (
  name text PRIMARY KEY
);
CREATE TABLE enlist (
  name text,
  organ text
);
CREATE TABLE filed_for_bankrupcy (
  name text PRIMARY KEY
);
CREATE TABLE longest_absense_from_school (
  name text PRIMARY KEY,
  month integer
);
CREATE TABLE male (
  name text PRIMARY KEY
);
CREATE TABLE no_payment_due (
  name text PRIMARY KEY,
  bool text
);
CREATE TABLE unemployed (
  name text PRIMARY KEY
);
CREATE TABLE enrolled (
  name text PRIMARY KEY,
  school text PRIMARY KEY,
  month integer
);
-- foreign keys: disabled.name -> person.name; enlist.name -> person.name; filed_for_bankrupcy.name -> person.name; longest_absense_from_school.name -> person.name; male.name -> person.name; no_payment_due.bool -> bool.name; no_payment_due.name -> person.name; unemployed.name -> person.name; enrolled.name -> person.name

Hint: have no due payments refers to bool = 'neg';

Question: How many male students have no due payments?

assistant: SELECT COUNT(T1.name) FROM no_payment_due AS T1 INNER JOIN male AS T2 ON T1.name = T2.name WHERE T1.bool = 'neg'
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
CREATE TABLE Community_Area (
  community_area_no integer PRIMARY KEY,
  community_area_name text,
  side text,
  population text
);
CREATE TABLE District (
  district_no integer PRIMARY KEY,
  district_name text,
  address text,
  zip_code integer,
  commander text,
  email text,
  phone text,
  fax text,
  tty text,
  twitter text
);
CREATE TABLE FBI_Code (
  fbi_code_no text PRIMARY KEY,
  title text,
  description text,
  crime_against text
);
CREATE TABLE IUCR (
  iucr_no text PRIMARY KEY,
  primary_description text,
  secondary_description text,
  index_code text
);
CREATE TABLE Neighborhood (
  neighborhood_name text PRIMARY KEY,
  community_area_no integer
);
CREATE TABLE Ward (
  ward_no integer PRIMARY KEY,
  alderman_first_name text,
  alderman_last_name text,
  alderman_name_suffix text,
  ward_office_address text,
  ward_office_zip text,
  ward_email text,
  ward_office_phone text,
  ward_office_fax text,
  city_hall_office_room integer,
  city_hall_office_phone text,
  city_hall_office_fax text,
  Population integer
);
CREATE TABLE Crime (
  report_no integer PRIMARY KEY,
  case_number text,
  date text,
  block text,
  iucr_no text,
  location_description text,
  arrest text,
  domestic text,
  beat integer,
  district_no integer,
  ward_no integer,
  community_area_no integer,
  fbi_code_no text,
  latitude text,
  longitude text
);
-- foreign keys: Neighborhood.community_area_no -> Community_Area.community_area_no; Crime.fbi_code_no -> FBI_Code.fbi_code_no; Crime.community_area_no -> Community_Area.community_area_no; Crime.district_no -> District.district_no; Crime.iucr_no -> IUCR.iucr_no; Crime.ward_no -> Ward.ward_no

Hint: "Drug Abuse" is the title of crime

Question: List crimes that the FBI has classified as Drug Abuse by their report number.

assistant: SELECT T2.report_no FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T2.fbi_code_no = T1.fbi_code_no WHERE T1.title = 'Drug Abuse'
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
CREATE TABLE address_status (
  status_id integer PRIMARY KEY,
  address_status text
);
CREATE TABLE author (
  author_id integer PRIMARY KEY,
  author_name text
);
CREATE TABLE book_language (
  language_id integer PRIMARY KEY,
  language_code text,
  language_name text
);
CREATE TABLE country (
  country_id integer PRIMARY KEY,
  country_name text
);
CREATE TABLE address (
  address_id integer PRIMARY KEY,
  street_number text,
  street_name text,
  city text,
  country_id integer
);
CREATE TABLE customer (
  customer_id integer PRIMARY KEY,
  first_name text,
  last_name text,
  email text
);
CREATE TABLE customer_address (
  customer_id integer PRIMARY KEY,
  address_id integer PRIMARY KEY,
  status_id integer
);
CREATE TABLE order_status (
  status_id integer PRIMARY KEY,
  status_value text
);
CREATE TABLE publisher (
  publisher_id integer PRIMARY KEY,
  publisher_name text
);
CREATE TABLE book (
  book_id integer PRIMARY KEY,
  title text,
  isbn13 text,
  language_id integer,
  num_pages integer,
  publication_date date,
  publisher_id integer
);
CREATE TABLE book_author (
  book_id integer PRIMARY KEY,
  author_id integer PRIMARY KEY
);
CREATE TABLE shipping_method (
  method_id integer PRIMARY KEY,
  method_name text,
  cost real
);
CREATE TABLE cust_order (
  order_id integer PRIMARY KEY,
  order_date datetime,
  customer_id integer,
  shipping_method_id integer,
  dest_address_id integer
);
CREATE TABLE order_history (
  history_id integer PRIMARY KEY,
  order_id integer,
  status_id integer,
  status_date datetime
);
CREATE TABLE order_line (
  line_id integer PRIMARY KEY,
  order_id integer,
  book_id integer,
  price real
);
-- foreign keys: address.country_id -> country.country_id; customer_address.customer_id -> customer.customer_id; customer_address.address_id -> address.address_id; book.publisher_id -> publisher.publisher_id; book.language_id -> book_language.language_id; book_author.book_id -> book.book_id; book_author.author_id -> author.author_id

Hint: "Hirohiko Araki" is the author_name; 'Viz Media' is the publisher_name; percentage = Divide (Count(author_name = 'Hirohiko Araki'), Count(book_id)) * 100

Question: What percentage of books written by Hirohiko make up the number of books published by Viz Media?

assistant: SELECT CAST(SUM(CASE WHEN T1.author_name = 'Hirohiko Araki' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM author AS T1 INNER JOIN book_author AS T2 ON T2.author_id = T1.author_id INNER JOIN book AS T3 ON T3.book_id = T2.book_id INNER JOIN publisher AS T4 ON T4.publisher_id = T3.publisher_id WHERE T4.publisher_name = 'VIZ Media'
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
PRAGMA foreign_keys = ON;
CREATE TABLE Ref_Hotel_Star_Ratings (
star_rating_code CHAR(15) NOT NULL,
star_rating_description VARCHAR(80),
PRIMARY KEY (star_rating_code),
UNIQUE (star_rating_code)
);


CREATE TABLE Locations (
Location_ID INTEGER NOT NULL,
Location_Name VARCHAR(255),
Address VARCHAR(255),
Other_Details VARCHAR(255),
PRIMARY KEY (Location_ID)
);

Question: Show the description and code of the attraction type most tourist attractions belong to.

assistant: SELECT T1.Attraction_Type_Description , T2.Attraction_Type_Code FROM Ref_Attraction_Types AS T1 JOIN Tourist_Attractions AS T2 ON T1.Attraction_Type_Code = T2.Attraction_Type_Code GROUP BY T2.Attraction_Type_Code ORDER BY COUNT(*) DESC LIMIT 1
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
CREATE TABLE sales_in_weather (
  date date PRIMARY KEY,
  store_nbr integer PRIMARY KEY,
  item_nbr integer PRIMARY KEY,
  units integer
);
CREATE TABLE weather (
  station_nbr integer PRIMARY KEY,
  date date PRIMARY KEY,
  tmax integer,
  tmin integer,
  tavg integer,
  depart integer,
  dewpoint integer,
  wetbulb integer,
  heat integer,
  cool integer,
  sunrise text,
  sunset text,
  codesum text,
  snowfall real,
  preciptotal real,
  stnpressure real,
  sealevel real,
  resultspeed real,
  resultdir integer,
  avgspeed real
);
CREATE TABLE relation (
  store_nbr integer PRIMARY KEY,
  station_nbr integer
);
-- foreign keys: relation.station_nbr -> weather.station_nbr; relation.store_nbr -> sales_in_weather.store_nbr

Hint: store 1 refers to store_nbr = 1; highest unit sold refers to Max(units); during rainy day refers to codesum like '%'||'RA'||'%'; item refers to item_nbr

Question: Which items from store 1 have the highest units sold during rainy day?

assistant: SELECT T2.item_nbr FROM weather AS T1 INNER JOIN sales_in_weather AS T2 ON T1.`date` = T2.`date` INNER JOIN relation AS T3 ON T2.store_nbr = T3.store_nbr AND T1.station_nbr = T3.station_nbr WHERE T2.store_nbr = 1 AND T1.codesum LIKE '%' OR 'RA' OR '%' GROUP BY T2.item_nbr ORDER BY T2.units DESC LIMIT 1
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
-- dbext:type=SQLITE:dbname=movie_rating.db

/* Delete the tables if they already exist */
drop table if exists Movie;
drop table if exists Reviewer;
drop table if exists Rating;

/* Create the schema for our tables */
create table Movie(
	mID int primary key, 
	title text, 
	year int, 
	director text
);
create table Reviewer(
	rID int primary key, 
	name text);

create table Rating(
	rID int, 
	mID int, 
	stars int, 
	ratingDate date,
	FOREIGN KEY (mID) references Movie(mID),
	FOREIGN KEY (rID) references Reviewer(rID)
);

/* Populate the tables with our data */

Question: Find the names of reviewers who had given higher than 3 star ratings.

assistant: SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars > 3
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
--data definition

create table genre(
	g_name varchar2(20) not null,
	rating varchar2(10),
	most_popular_in varchar2(50),
	primary key(g_name)
);

create table artist(
	artist_name varchar2(50) not null,
	country varchar2(20),
	gender varchar2(20),
	preferred_genre varchar2(50),
	constraint a_name primary key(artist_name),
	foreign key(preferred_genre) references genre(g_name) ON DELETE CASCADE
);

create table files(
	f_id number(10) not null,
	artist_name varchar2(50),
	file_size varchar2(20),
	duration varchar2(20),
	formats varchar2(20),
	primary key(f_id),
	foreign key(artist_name) references artist(artist_name) ON DELETE CASCADE
);


create table song(
	song_name varchar2(50),
	artist_name varchar2(50),
	country varchar2(20),
	f_id number(10),
    	genre_is varchar2(20),
	rating number(10) check(rating>0 and rating<11),
	languages varchar2(20),
	releasedate Date, 
	resolution number(10) not null,
	constraint s_name primary key(song_name),
	foreign key(artist_name) references artist(artist_name) ON DELETE CASCADE,
	foreign key(f_id) references files(f_id) ON DELETE CASCADE,
	foreign key(genre_is) references genre(g_name) ON DELETE CASCADE
);


--insertion of attributes in the table

Question: List the names of all genres in alphabetical oder, together with its ratings.

assistant: SELECT g_name , rating FROM genre ORDER BY g_name
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
PRAGMA foreign_keys = ON;


CREATE TABLE "company" (
"Company_ID" int,
"Rank" int,
"Company" text,
"Headquarters" text,
"Main_Industry" text,
"Sales_billion" real,
"Profits_billion" real,
"Assets_billion" real,
"Market_Value" real,
PRIMARY KEY ("Company_ID")
);

CREATE TABLE "gas_station" (
"Station_ID" int,
"Open_Year" int,
"Location" text,
"Manager_Name" text,
"Vice_Manager_Name" text,
"Representative_Name" text,
PRIMARY KEY ("Station_ID")
);

Question: What are the headquarters without companies that are in the banking industry?

assistant: SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry = 'Banking'
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
PRAGMA foreign_keys = ON;


CREATE TABLE `pilot` (
  `Pilot_Id` int(11) NOT NULL,
  `Name` varchar(50) NOT NULL,
  `Age` int(11) NOT NULL,
  PRIMARY KEY (`Pilot_Id`)
);

Question: What is the average number of international passengers of all airports?

assistant: SELECT avg(International_Passengers) FROM airport
system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
PRAGMA foreign_keys = ON;

CREATE TABLE `Addresses` (
`address_id` INTEGER PRIMARY KEY,
`line_1_number_building` VARCHAR(80),
`city` VARCHAR(50),
`zip_postcode` VARCHAR(20),
`state_province_county` VARCHAR(50),
`country` VARCHAR(50)
);

Question: How many lessons taken by customer with first name as Rylan and last name as Goodwin were completed?

assistant: SELECT count(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Rylan" AND T2.last_name = "Goodwin" AND T1.lesson_status_code = "Completed";