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 Student (
        StuID        INTEGER PRIMARY KEY,
        LName        VARCHAR(12),
        Fname        VARCHAR(12),
        Age      INTEGER,
        Sex      VARCHAR(1),
        Major        INTEGER,
        Advisor      INTEGER,
        city_code    VARCHAR(3)
 );

create table Video_Games (
       GameID           INTEGER PRIMARY KEY,
       GName            VARCHAR(40),
       GType            VARCHAR(40)
);

create table Plays_Games (
       StuID                INTEGER,
       GameID            INTEGER,
       Hours_Played      INTEGER,
       FOREIGN KEY(GameID) REFERENCES Video_Games(GameID),
       FOREIGN KEY(StuID) REFERENCES Student(StuID)
);

create table SportsInfo (
  StuID INTEGER,
  SportName VARCHAR(32),
  HoursPerWeek INTEGER,
  GamesPlayed INTEGER,
  OnScholarship VARCHAR(1),
  FOREIGN KEY(StuID) REFERENCES Student(StuID)
);

Question: Show ids for all students who live in CHI.

assistant: SELECT StuID FROM Student WHERE city_code = "CHI"
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 Customers (
Customer_ID INTEGER NOT NULL,
Customer_name VARCHAR(40),
PRIMARY KEY (Customer_ID)
);

Question: What is the effective date of the claim that has the largest amount of total settlement?

assistant: SELECT t1.Effective_Date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id = t2.claim_id GROUP BY t1.claim_id ORDER BY sum(t2.settlement_amount) 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:
PRAGMA foreign_keys = ON;
CREATE TABLE `Addresses` (
`address_id` INTEGER PRIMARY KEY,
`address_details` VARCHAR(255)
);

Question: What are id and name of the products whose price is lower than 600 or higher than 900?

assistant: SELECT product_id , product_name FROM products WHERE product_price < 600 OR product_price > 900
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 geographic (
  city text PRIMARY KEY,
  county text,
  region text
);
CREATE TABLE generalinfo (
  id_restaurant integer PRIMARY KEY,
  label text,
  food_type text,
  city text,
  review real
);
CREATE TABLE location (
  id_restaurant integer PRIMARY KEY,
  street_num integer,
  street_name text,
  city text
);
-- foreign keys: generalinfo.city -> geographic.city; location.id_restaurant -> generalinfo.id_restaurant; location.city -> geographic.city

Hint: unknown county refers to county = 'unknown'

Question: How many labels of the restaurant have an unknown country?

assistant: SELECT COUNT(T1.label) FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'unknown'
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 "basketball_match" (
"Team_ID" int,
"School_ID" int,
"Team_Name" text,
"ACC_Regular_Season" text,
"ACC_Percent" text,
"ACC_Home" text,
"ACC_Road" text,
"All_Games" text,
"All_Games_Percent" int,
"All_Home" text,
"All_Road" text,
"All_Neutral" text,
PRIMARY KEY ("Team_ID"),
FOREIGN KEY (`School_ID`) REFERENCES `university`(`School_ID`)
);

CREATE TABLE "university" (
"School_ID" int,
"School" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Nickname" text,
"Primary_conference" text,
PRIMARY KEY ("School_ID")
);

Question: What is the team name and acc regular season score of the school that was founded for the longest time?

assistant: SELECT t2.team_name , t2.ACC_Regular_Season FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t1.founded 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:
PRAGMA foreign_keys = ON;

CREATE TABLE "club" (
"Club_ID" int,
"name" text,
"Region" text,
"Start_year" text,
PRIMARY KEY ("Club_ID")
);

Question: What are the maximum and minimum number of silver medals for clubs.

assistant: SELECT max(Silver) , min(Silver) FROM club_rank
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 "workshop" (
"Workshop_ID" int,
"Date" text,
"Venue" text,
"Name" text,
PRIMARY KEY ("Workshop_ID")
);

CREATE TABLE "submission" (
"Submission_ID" int,
"Scores" real,
"Author" text,
"College" text,
PRIMARY KEY ("Submission_ID")
);

Question: What is the author of the submission with the highest score?

assistant: SELECT Author FROM submission ORDER BY Scores 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 Customers (
  CustomerID integer PRIMARY KEY,
  Customer Names text
);
CREATE TABLE Products (
  ProductID integer PRIMARY KEY,
  Product Name text
);
CREATE TABLE Regions (
  StateCode text PRIMARY KEY,
  State text,
  Region text
);
CREATE TABLE Sales Team (
  SalesTeamID integer PRIMARY KEY,
  Sales Team text,
  Region text
);
CREATE TABLE Store Locations (
  StoreID integer PRIMARY KEY,
  City Name text,
  County text,
  StateCode text,
  State text,
  Type text,
  Latitude real,
  Longitude real,
  AreaCode integer,
  Population integer,
  Household Income integer,
  Median Income integer,
  Land Area integer,
  Water Area integer,
  Time Zone text
);
CREATE TABLE Sales Orders (
  OrderNumber text PRIMARY KEY,
  Sales Channel text,
  WarehouseCode text,
  ProcuredDate text,
  OrderDate text,
  ShipDate text,
  DeliveryDate text,
  CurrencyCode text,
  _SalesTeamID integer,
  _CustomerID integer,
  _StoreID integer,
  _ProductID integer,
  Order Quantity integer,
  Discount Applied real,
  Unit Price text,
  Unit Cost text
);
-- foreign keys: Store Locations.StateCode -> Regions.StateCode; Sales Orders._ProductID -> Products.ProductID; Sales Orders._StoreID -> Store Locations.StoreID; Sales Orders._CustomerID -> Customers.CustomerID; Sales Orders._SalesTeamID -> Sales Team.SalesTeamID

Hint: total order quantity refers to Sum (Order Quantity); 'Candles' is the Products Name; percentage = Divide (Sum(Order Quantity where Product Name = 'Candles'), Sum(Order Quantity)) * 100

Question: Please indicate total order quantity of product Candles and calculate the percentage of such product among all the orders.

assistant: SELECT SUM(CASE WHEN T1.`Product Name` = 'Candles' THEN T2.`Order Quantity` ELSE 0 END), CAST(SUM(CASE WHEN T1.`Product Name` = 'Candles' THEN T2.`Order Quantity` ELSE 0 END) AS REAL) * 100 / SUM(T2.`Order Quantity`) FROM Products AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._ProductID = T1.ProductID INNER JOIN `Store Locations` AS T3 ON T3.StoreID = T2._StoreID
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: region refers to r_name; the most customers refers to max(count(c_custkey))

Question: What is the region with the most customers?

assistant: SELECT T.r_name FROM ( SELECT T3.r_name, COUNT(T2.c_custkey) AS num FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN region AS T3 ON T1.n_regionkey = T3.r_regionkey GROUP BY T3.r_name ) AS T ORDER BY T.num 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 Air Carriers (
  Code integer PRIMARY KEY,
  Description text
);
CREATE TABLE Airports (
  Code text PRIMARY KEY,
  Description text
);
CREATE TABLE Airlines (
  FL_DATE text,
  OP_CARRIER_AIRLINE_ID integer,
  TAIL_NUM text,
  OP_CARRIER_FL_NUM integer,
  ORIGIN_AIRPORT_ID integer,
  ORIGIN_AIRPORT_SEQ_ID integer,
  ORIGIN_CITY_MARKET_ID integer,
  ORIGIN text,
  DEST_AIRPORT_ID integer,
  DEST_AIRPORT_SEQ_ID integer,
  DEST_CITY_MARKET_ID integer,
  DEST text,
  CRS_DEP_TIME integer,
  DEP_TIME integer,
  DEP_DELAY integer,
  DEP_DELAY_NEW integer,
  ARR_TIME integer,
  ARR_DELAY integer,
  ARR_DELAY_NEW integer,
  CANCELLED integer,
  CANCELLATION_CODE text,
  CRS_ELAPSED_TIME integer,
  ACTUAL_ELAPSED_TIME integer,
  CARRIER_DELAY integer,
  WEATHER_DELAY integer,
  NAS_DELAY integer,
  SECURITY_DELAY integer,
  LATE_AIRCRAFT_DELAY integer
);
-- foreign keys: Airlines.OP_CARRIER_AIRLINE_ID -> Air Carriers.Code; Airlines.DEST -> Airports.Code; Airlines.ORIGIN -> Airports.Code

Hint: planes refers to TAIL_NUM; Southwest Airlines Co. refers to Description = 'Southwest Airlines Co.: WN';

Question: How many planes does Southwest Airlines Co. have?

assistant: SELECT COUNT(T3.TAIL_NUM) FROM ( SELECT T1.TAIL_NUM FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T2.Description = 'Southwest Airlines Co.: WN' GROUP BY T1.TAIL_NUM ) T3
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 location (
  LocationID integer PRIMARY KEY,
  Country text,
  State text,
  StateCode text,
  City text
);
CREATE TABLE user (
  UserID text PRIMARY KEY,
  Gender text
);
CREATE TABLE twitter (
  TweetID text PRIMARY KEY,
  Weekday text,
  Hour integer,
  Day integer,
  Lang text,
  IsReshare text,
  Reach integer,
  RetweetCount integer,
  Likes integer,
  Klout integer,
  Sentiment real,
  text text,
  LocationID integer,
  UserID text
);
-- foreign keys: twitter.UserID -> user.UserID; twitter.LocationID -> location.LocationID

Hint: "Michigan" is the State; 'Thursday' is the Weekday; number of tweets refers to Count(TweetID)

Question: State the number of tweets from Michigan on Thursdays.

assistant: SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T1.Weekday = 'Thursday' AND T2.State = 'Michigan'
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 `Customers` (
`customer_id` INTEGER PRIMARY KEY,
`customer_first_name` VARCHAR(50),
`customer_middle_initial` VARCHAR(1),
`customer_last_name` VARCHAR(50),
`gender` VARCHAR(1),
`email_address` VARCHAR(255),
`login_name` VARCHAR(80),
`login_password` VARCHAR(20),
`phone_number` VARCHAR(255),
`town_city` VARCHAR(50),
`state_county_province` VARCHAR(50),
`country` VARCHAR(50)
);

Question: Show all product names and the total quantity ordered for each product name.

assistant: SELECT T2.product_name , sum(T1.product_quantity) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_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:
CREATE TABLE Categories (
  CategoryID integer PRIMARY KEY,
  CategoryName text,
  Description text
);
CREATE TABLE Customers (
  CustomerID integer PRIMARY KEY,
  CustomerName text,
  ContactName text,
  Address text,
  City text,
  PostalCode text,
  Country text
);
CREATE TABLE Employees (
  EmployeeID integer PRIMARY KEY,
  LastName text,
  FirstName text,
  BirthDate date,
  Photo text,
  Notes text
);
CREATE TABLE Shippers (
  ShipperID integer PRIMARY KEY,
  ShipperName text,
  Phone text
);
CREATE TABLE Suppliers (
  SupplierID integer PRIMARY KEY,
  SupplierName text,
  ContactName text,
  Address text,
  City text,
  PostalCode text,
  Country text,
  Phone text
);
CREATE TABLE Products (
  ProductID integer PRIMARY KEY,
  ProductName text,
  SupplierID integer,
  CategoryID integer,
  Unit text,
  Price real
);
CREATE TABLE Orders (
  OrderID integer PRIMARY KEY,
  CustomerID integer,
  EmployeeID integer,
  OrderDate datetime,
  ShipperID integer
);
CREATE TABLE OrderDetails (
  OrderDetailID integer PRIMARY KEY,
  OrderID integer,
  ProductID integer,
  Quantity integer
);
-- foreign keys: Products.SupplierID -> Suppliers.SupplierID; Products.CategoryID -> Categories.CategoryID; Orders.ShipperID -> Shippers.ShipperID; Orders.CustomerID -> Customers.CustomerID; Orders.EmployeeID -> Employees.EmployeeID; OrderDetails.ProductID -> Products.ProductID; OrderDetails.OrderID -> Orders.OrderID

Hint: product refers to ProductID; highest unit price refers to Max(UnitPrice)

Question: What product have the highest unit price and how many quantity have been being sold?

assistant: SELECT T1.ProductName, T2.Quantity FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID ORDER BY T1.UnitPrice 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 essays (
  projectid text,
  teacher_acctid text,
  title text,
  short_description text,
  need_statement text,
  essay text
);
CREATE TABLE projects (
  projectid text PRIMARY KEY,
  teacher_acctid text,
  schoolid text,
  school_ncesid text,
  school_latitude real,
  school_longitude real,
  school_city text,
  school_state text,
  school_zip integer,
  school_metro text,
  school_district text,
  school_county text,
  school_charter text,
  school_magnet text,
  school_year_round text,
  school_nlns text,
  school_kipp text,
  school_charter_ready_promise text,
  teacher_prefix text,
  teacher_teach_for_america text,
  teacher_ny_teaching_fellow text,
  primary_focus_subject text,
  primary_focus_area text,
  secondary_focus_subject text,
  secondary_focus_area text,
  resource_type text,
  poverty_level text,
  grade_level text,
  fulfillment_labor_materials real,
  total_price_excluding_optional_support real,
  total_price_including_optional_support real,
  students_reached integer,
  eligible_double_your_impact_match text,
  eligible_almost_home_match text,
  date_posted date
);
CREATE TABLE donations (
  donationid text PRIMARY KEY,
  projectid text,
  donor_acctid text,
  donor_city text,
  donor_state text,
  donor_zip text,
  is_teacher_acct text,
  donation_timestamp datetime,
  donation_to_project real,
  donation_optional_support real,
  donation_total real,
  dollar_amount text,
  donation_included_optional_support text,
  payment_method text,
  payment_included_acct_credit text,
  payment_included_campaign_gift_card text,
  payment_included_web_purchased_gift_card text,
  payment_was_promo_matched text,
  via_giving_page text,
  for_honoree text,
  donation_message text
);
CREATE TABLE resources (
  resourceid text PRIMARY KEY,
  projectid text,
  vendorid integer,
  vendor_name text,
  project_resource_type text,
  item_name text,
  item_number text,
  item_unit_price real,
  item_quantity integer
);
-- foreign keys: donations.projectid -> projects.projectid; resources.projectid -> projects.projectid

Hint: Needed Resource Materials For My Students refer to title

Question: What payment method was used for Needed Resource Materials For My Students?

assistant: SELECT T3.payment_method FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid WHERE T1.title = 'Needed Resource Materials For My Students'
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 essays (
  projectid text,
  teacher_acctid text,
  title text,
  short_description text,
  need_statement text,
  essay text
);
CREATE TABLE projects (
  projectid text PRIMARY KEY,
  teacher_acctid text,
  schoolid text,
  school_ncesid text,
  school_latitude real,
  school_longitude real,
  school_city text,
  school_state text,
  school_zip integer,
  school_metro text,
  school_district text,
  school_county text,
  school_charter text,
  school_magnet text,
  school_year_round text,
  school_nlns text,
  school_kipp text,
  school_charter_ready_promise text,
  teacher_prefix text,
  teacher_teach_for_america text,
  teacher_ny_teaching_fellow text,
  primary_focus_subject text,
  primary_focus_area text,
  secondary_focus_subject text,
  secondary_focus_area text,
  resource_type text,
  poverty_level text,
  grade_level text,
  fulfillment_labor_materials real,
  total_price_excluding_optional_support real,
  total_price_including_optional_support real,
  students_reached integer,
  eligible_double_your_impact_match text,
  eligible_almost_home_match text,
  date_posted date
);
CREATE TABLE donations (
  donationid text PRIMARY KEY,
  projectid text,
  donor_acctid text,
  donor_city text,
  donor_state text,
  donor_zip text,
  is_teacher_acct text,
  donation_timestamp datetime,
  donation_to_project real,
  donation_optional_support real,
  donation_total real,
  dollar_amount text,
  donation_included_optional_support text,
  payment_method text,
  payment_included_acct_credit text,
  payment_included_campaign_gift_card text,
  payment_included_web_purchased_gift_card text,
  payment_was_promo_matched text,
  via_giving_page text,
  for_honoree text,
  donation_message text
);
CREATE TABLE resources (
  resourceid text PRIMARY KEY,
  projectid text,
  vendorid integer,
  vendor_name text,
  project_resource_type text,
  item_name text,
  item_number text,
  item_unit_price real,
  item_quantity integer
);
-- foreign keys: donations.projectid -> projects.projectid; resources.projectid -> projects.projectid

Hint: paid through Amazon refers to payment_method = 'Amazon'; sum of the total donated amounts refers to SUM(donation_to_project,donation_optional_support)

Question: What is the sum of the total donated amounts paid through Amazon?

assistant: SELECT SUM(donation_to_project) + SUM(donation_optional_support) FROM donations WHERE payment_method = 'amazon'
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 "storm" (
"Storm_ID" int,
"Name" text,
"Dates_active" text,
"Max_speed" int,
"Damage_millions_USD" real,
"Number_Deaths" int,
PRIMARY KEY ("Storm_ID")
);

Question: Return the name and max speed of the storm that affected the most regions.

assistant: SELECT T1.name , T1.max_speed FROM storm AS T1 JOIN affected_region AS T2 ON T1.storm_id = T2.storm_id GROUP BY T1.storm_id 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:
PRAGMA foreign_keys = ON;
CREATE TABLE `Customers` (
`customer_id` INTEGER PRIMARY KEY,
`customer_first_name` VARCHAR(50),
`customer_middle_initial` VARCHAR(1),
`customer_last_name` VARCHAR(50),
`gender` VARCHAR(1),
`email_address` VARCHAR(255),
`login_name` VARCHAR(80),
`login_password` VARCHAR(20),
`phone_number` VARCHAR(255),
`town_city` VARCHAR(50),
`state_county_province` VARCHAR(50),
`country` VARCHAR(50)
);

Question: Count the number of financial transactions that correspond to each account id.

assistant: SELECT count(*) , account_id FROM Financial_transactions
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:
-- phpMyAdmin SQL Dump
-- version 4.0.10.7
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 20, 2015 at 01:43 AM
-- Server version: 5.5.34-cll-lve
-- PHP Version: 5.4.23



/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
CREATE TABLE IF NOT EXISTS `regions` (
  `REGION_ID` decimal(5,0) NOT NULL,
  `REGION_NAME` varchar(25) DEFAULT NULL,
  PRIMARY KEY (`REGION_ID`)
);

--
-- Dumping data for table `regions`
--

Question: Return the full names and salaries for employees with first names that end with the letter m.

assistant: SELECT first_name , last_name , salary FROM employees WHERE first_name LIKE '%m'
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 "buildings" (
"id" int,
"name" text,
"City" text,
"Height" int,
"Stories" int,
"Status" text,
PRIMARY KEY("id")
);

Question: List the name of a building along with the name of a company whose office is in the building.

assistant: SELECT T3.name , T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id