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:
-- LINK: https://en.wikibooks.org/wiki/SQL_Exercises/The_computer_store

CREATE TABLE Manufacturers (
  Code INTEGER,
  Name VARCHAR(255) NOT NULL,
  Headquarter VARCHAR(255) NOT NULL,
  Founder VARCHAR(255) NOT NULL,
  Revenue REAL,
  PRIMARY KEY (Code)   
);

CREATE TABLE Products (
  Code INTEGER,
  Name VARCHAR(255) NOT NULL ,
  Price DECIMAL NOT NULL ,
  Manufacturer INTEGER NOT NULL,
  PRIMARY KEY (Code), 
  FOREIGN KEY (Manufacturer) REFERENCES Manufacturers(Code)
);

Question: What are the names of products produced by both Creative Labs and Sony?

assistant: SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Creative Labs' INTERSECT SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony'
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 city (
  city_id integer PRIMARY KEY,
  city_name text,
  state text,
  population integer,
  area real
);
CREATE TABLE customer (
  cust_id integer PRIMARY KEY,
  cust_name text,
  annual_revenue integer,
  cust_type text,
  address text,
  city text,
  state text,
  zip real,
  phone text
);
CREATE TABLE driver (
  driver_id integer PRIMARY KEY,
  first_name text,
  last_name text,
  address text,
  city text,
  state text,
  zip_code integer,
  phone text
);
CREATE TABLE truck (
  truck_id integer PRIMARY KEY,
  make text,
  model_year integer
);
CREATE TABLE shipment (
  ship_id integer PRIMARY KEY,
  cust_id integer,
  weight real,
  truck_id integer,
  driver_id integer,
  city_id integer,
  ship_date text
);
-- foreign keys: shipment.truck_id -> truck.truck_id; shipment.driver_id -> driver.driver_id; shipment.city_id -> city.city_id; shipment.cust_id -> customer.cust_id

Hint: customer with the most number of shipment refers to cust_id where Max(Count(ship_id))

Question: How much is the annual revenue of the customer with the most number of shipments?

assistant: SELECT T2.annual_revenue FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_id ORDER BY COUNT(T1.cust_id) 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 "artist" (
"Artist_ID" int,
"Name" text,
"Country" text,
"Year_Join" int,
"Age" int,
PRIMARY KEY ("Artist_ID")
);

Question: Return the different countries for artists.

assistant: SELECT DISTINCT country FROM artist
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 app_all (
  app_id integer PRIMARY KEY
);
CREATE TABLE app_events (
  event_id integer PRIMARY KEY,
  app_id integer PRIMARY KEY,
  is_installed integer,
  is_active integer
);
CREATE TABLE app_events_relevant (
  event_id integer PRIMARY KEY,
  app_id integer PRIMARY KEY,
  is_installed integer,
  is_active integer
);
CREATE TABLE app_labels (
  app_id integer,
  label_id integer
);
CREATE TABLE events (
  event_id integer PRIMARY KEY,
  device_id integer,
  timestamp datetime,
  longitude real,
  latitude real
);
CREATE TABLE events_relevant (
  event_id integer PRIMARY KEY,
  device_id integer,
  timestamp datetime,
  longitude real,
  latitude real
);
CREATE TABLE gender_age (
  device_id integer PRIMARY KEY,
  gender text,
  age integer,
  group text
);
CREATE TABLE gender_age_test (
  device_id integer PRIMARY KEY
);
CREATE TABLE gender_age_train (
  device_id integer PRIMARY KEY,
  gender text,
  age integer,
  group text
);
CREATE TABLE label_categories (
  label_id integer PRIMARY KEY,
  category text
);
CREATE TABLE phone_brand_device_model2 (
  device_id integer PRIMARY KEY,
  phone_brand text PRIMARY KEY,
  device_model text PRIMARY KEY
);
CREATE TABLE sample_submission (
  device_id integer PRIMARY KEY,
  F23- real,
  F24-26 real,
  F27-28 real,
  F29-32 real,
  F33-42 real,
  F43+ real,
  M22- real,
  M23-26 real,
  M27-28 real,
  M29-31 real,
  M32-38 real,
  M39+ real
);
-- foreign keys: app_events.event_id -> events.event_id; app_events_relevant.app_id -> app_all.app_id; app_events_relevant.event_id -> events_relevant.event_id; app_labels.app_id -> app_all.app_id; app_labels.label_id -> label_categories.label_id; events_relevant.device_id -> gender_age.device_id; gender_age.device_id -> phone_brand_device_model2.device_id

Hint: brand of the device refers to phone_brand; youngest refers to MIN(age); female refers to gender = 'F';

Question: What is the brand of the device used by the youngest female user?

assistant: SELECT phone_brand FROM phone_brand_device_model2 WHERE device_id IN ( SELECT * FROM ( SELECT device_id FROM gender_age WHERE gender = 'F' ORDER BY age LIMIT 1 ) AS T )
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 divisions (
  division text PRIMARY KEY,
  name text,
  country text
);
CREATE TABLE matchs (
  Div text,
  Date date,
  HomeTeam text,
  AwayTeam text,
  FTHG integer,
  FTAG integer,
  FTR text,
  season integer
);
-- foreign keys: matchs.Div -> divisions.division

Hint: the most goals refer to MAX(FTAG), which is a short name for Final-time Away-team Goals;

Question: Which country had the game that Away team made the most goals?

assistant: SELECT T2.country FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division GROUP BY T2.country ORDER BY SUM(T1.FTAG) 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 Apartment_Buildings (
building_id INTEGER NOT NULL,
building_short_name CHAR(15),
building_full_name VARCHAR(80),
building_description VARCHAR(255),
building_address VARCHAR(255),
building_manager VARCHAR(50),
building_phone VARCHAR(80),
PRIMARY KEY (building_id),
UNIQUE (building_id)
);

Question: Show the facility codes of apartments with more than 4 bedrooms.

assistant: SELECT T1.facility_code FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4
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,
  locationcity text,
  address text,
  state text,
  zipcode integer,
  officephone text
);
CREATE TABLE position (
  positionID integer PRIMARY KEY,
  positiontitle text,
  educationrequired text,
  minsalary text,
  maxsalary text
);
CREATE TABLE employee (
  ssn text PRIMARY KEY,
  lastname text,
  firstname text,
  hiredate text,
  salary text,
  gender text,
  performance text,
  positionID integer,
  locationID integer
);
-- foreign keys: employee.positionID -> position.positionID; employee.locationID -> location.locationID

Hint: maximum salary refers to maxsalary; Trainee is a positiontitle

Question: What is the maximum salary of position "Trainer"?

assistant: SELECT maxsalary FROM position WHERE positiontitle = 'Trainee'
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 "Campuses" (
	"Id" INTEGER PRIMARY KEY, 
	"Campus" TEXT, 
	"Location" TEXT, 
	"County" TEXT, 
	"Year" INTEGER 
);

CREATE TABLE "csu_fees" ( 
	"Campus" INTEGER PRIMARY KEY, 
	"Year" INTEGER, 
	"CampusFee" INTEGER,
	FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);

CREATE TABLE "degrees" ( 
	"Year" INTEGER,
	"Campus" INTEGER, 
	"Degrees" INTEGER,
	PRIMARY KEY (Year, Campus),
	FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);



CREATE TABLE "discipline_enrollments" ( 
	"Campus" INTEGER, 
	"Discipline" INTEGER, 
	"Year" INTEGER, 
	"Undergraduate" INTEGER, 
	"Graduate" INTEGER,
	PRIMARY KEY (Campus, Discipline),
	FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);



CREATE TABLE "enrollments" ( 
	"Campus" INTEGER, 
	"Year" INTEGER, 
	"TotalEnrollment_AY" INTEGER, 
	"FTE_AY" INTEGER,
	PRIMARY KEY(Campus, Year),
	FOREIGN KEY (Campus) REFERENCES Campuses(Id)
);

CREATE TABLE "faculty" ( 
	"Campus" INTEGER, 
	"Year" INTEGER, 
	"Faculty" REAL,
	FOREIGN KEY (Campus) REFERENCES Campuses(Id) 
);

Question: report the total number of degrees granted between 1998 and 2002.

assistant: SELECT T1.campus , sum(T2.degrees) FROM campuses AS T1 JOIN degrees AS T2 ON T1.id = T2.campus WHERE T2.year >= 1998 AND T2.year <= 2002 GROUP BY T1.campus
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 are the names of the pilots that have not won any matches in Australia?

assistant: SELECT name FROM pilot WHERE pilot_id NOT IN (SELECT Winning_Pilot FROM MATCH WHERE country = 'Australia')
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: customers refer to c_custkey; India is the name of the nation which refers to n_name = 'INDIA';

Question: How many customers are there in India?

assistant: SELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'INDIA'
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 `Roles` (
`role_code` VARCHAR(15) PRIMARY KEY,
`role_description` VARCHAR(80)
);

CREATE TABLE `Users` (
`user_id` INTEGER PRIMARY KEY,
`role_code` VARCHAR(15) NOT NULL,
`user_name` VARCHAR(40),
`user_login` VARCHAR(40),
`password` VARCHAR(40),
FOREIGN KEY (`role_code` ) REFERENCES `Roles`(`role_code` )
);

Question: Find the average access counts of documents with functional area "Acknowledgement".

assistant: SELECT avg(t1.access_count) FROM documents AS t1 JOIN document_functional_areas AS t2 ON t1.document_code = t2.document_code JOIN functional_areas AS t3 ON t2.functional_area_code = t3.functional_area_code WHERE t3.functional_area_description = "Acknowledgement"
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 "list" ( 
	"LastName" TEXT, 
	"FirstName" TEXT, 
	"Grade" INTEGER, 
	"Classroom" INTEGER,
	PRIMARY KEY(LastName, FirstName)
);
CREATE TABLE "teachers" ( 
	"LastName" TEXT, 
	"FirstName" TEXT, 
	"Classroom" INTEGER,
	PRIMARY KEY(LastName, FirstName)
);

Question: How many teachers does the student named CHRISSY NABOZNY have?

assistant: SELECT count(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "CHRISSY" AND T1.lastname = "NABOZNY"
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 actor (
  ActorID integer PRIMARY KEY,
  Name text,
  Date of Birth date,
  Birth City text,
  Birth Country text,
  Height (Inches) integer,
  Biography text,
  Gender text,
  Ethnicity text,
  NetWorth text
);
CREATE TABLE movie (
  MovieID integer PRIMARY KEY,
  Title text,
  MPAA Rating text,
  Budget integer,
  Gross integer,
  Release Date text,
  Genre text,
  Runtime integer,
  Rating real,
  Rating Count integer,
  Summary text
);
CREATE TABLE characters (
  MovieID integer PRIMARY KEY,
  ActorID integer PRIMARY KEY,
  Character Name text,
  creditOrder integer,
  pay text,
  screentime text
);
-- foreign keys: characters.MovieID -> movie.MovieID; characters.ActorID -> actor.ActorID

Hint: comedy movie refers to Genre = 'Comedy'; rating lower than 7 refers to Rating < 7; net worth greater than $375,000,000.00 refers to NetWorth > '$375,000,000.00'

Question: What is the gross of a comedy movie with a rating lower than 7 and starred by an actor with a net worth greater than $375,000,000.00?

assistant: SELECT SUM(T1.Gross) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE CAST(REPLACE(REPLACE(T3.NetWorth, ',', ''), '$', '') AS REAL) > 375000000 AND T1.Rating < 7 AND T1.Genre = 'Comedy'
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 Dorm (
       dormid		INTEGER,
       dorm_name	VARCHAR(20),
       student_capacity	INTEGER,
       gender			VARCHAR(1)
) ;

create table Dorm_amenity (
       amenid			INTEGER,
       amenity_name		VARCHAR(25)
) ;

create table Has_amenity (
       dormid			INTEGER,
       amenid				INTEGER,
	FOREIGN KEY (dormid) REFERENCES `Dorm`(dormid),
	FOREIGN KEY (amenid) REFERENCES `Dorm_amenity`(amenid)
);

create table Lives_in (
       stuid 	      INTEGER,
       dormid		INTEGER,
       room_number	INTEGER,
	FOREIGN KEY (stuid) REFERENCES `Student`(StuID),
        FOREIGN KEY (dormid) REFERENCES `Dorm`(dormid)
);

Question: How many different genders are there in the dorms?

assistant: SELECT count(DISTINCT gender) FROM dorm
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 Apartment_Buildings (
building_id INTEGER NOT NULL,
building_short_name CHAR(15),
building_full_name VARCHAR(80),
building_description VARCHAR(255),
building_address VARCHAR(255),
building_manager VARCHAR(50),
building_phone VARCHAR(80),
PRIMARY KEY (building_id),
UNIQUE (building_id)
);

Question: Return the apartment numbers of the apartments with type code "Flat".

assistant: SELECT apt_number FROM Apartments WHERE apt_type_code = "Flat"
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: percentage = divide(count(QuestionID = 15& AnswerText = 'Yes'), count(QuestionID = 15))*100%

Question: What was the percentage for the answer of "Yes" was given to the question "Has your employer ever formally discussed mental health (for example, as part of a wellness campaign or other official communication)?"?

assistant: SELECT CAST(SUM(CASE WHEN T1.AnswerText LIKE 'Yes' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.UserID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questiontext LIKE 'Has your employer ever formally discussed mental health (for example, as part of a wellness campaign or other official communication)?'
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 chapters (
  id integer PRIMARY KEY,
  Act integer,
  Scene integer,
  Description text,
  work_id integer
);
CREATE TABLE characters (
  id integer PRIMARY KEY,
  CharName text,
  Abbrev text,
  Description text
);
CREATE TABLE paragraphs (
  id integer PRIMARY KEY,
  ParagraphNum integer,
  PlainText text,
  character_id integer,
  chapter_id integer
);
CREATE TABLE works (
  id integer PRIMARY KEY,
  Title text,
  LongTitle text,
  Date integer,
  GenreType text
);

Hint: Lord Abergavenny refers to CharName = 'Lord Abergavenny'

Question: How many paragraphs contain the character Lord Abergavenny?

assistant: SELECT SUM(T1.ParagraphNum) FROM paragraphs AS T1 INNER JOIN characters AS T2 ON T1.character_id = T2.id WHERE T2.CharName = 'Lord Abergavenny'
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 Dish (
  id integer PRIMARY KEY,
  name text,
  description text,
  menus_appeared integer,
  times_appeared integer,
  first_appeared integer,
  last_appeared integer,
  lowest_price real,
  highest_price real
);
CREATE TABLE Menu (
  id integer PRIMARY KEY,
  name text,
  sponsor text,
  event text,
  venue text,
  place text,
  physical_description text,
  occasion text,
  notes text,
  call_number text,
  keywords text,
  language text,
  date date,
  location text,
  location_type text,
  currency text,
  currency_symbol text,
  status text,
  page_count integer,
  dish_count integer
);
CREATE TABLE MenuPage (
  id integer PRIMARY KEY,
  menu_id integer,
  page_number integer,
  image_id real,
  full_height integer,
  full_width integer,
  uuid text
);
CREATE TABLE MenuItem (
  id integer PRIMARY KEY,
  menu_page_id integer,
  price real,
  high_price real,
  dish_id integer,
  created_at text,
  updated_at text,
  xpos real,
  ypos real
);
-- foreign keys: MenuPage.menu_id -> Menu.id; MenuItem.menu_page_id -> MenuPage.id; MenuItem.dish_id -> Dish.id

Hint: did not support taking out or booking in advance refers to call_number is null; created before 1950 refers to strftime('%Y', date) < '1950';

Question: Among the menus that did not support taking out or booking in advance, how many of them were created before 1950?

assistant: SELECT COUNT(*) FROM Menu WHERE call_number IS NULL AND strftime('%Y', date) < '1950'
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 "device" (
"Device_ID" int,
"Device" text,
"Carrier" text,
"Package_Version" text,
"Applications" text,
"Software_Platform" text,
PRIMARY KEY ("Device_ID")
);

CREATE TABLE "shop" (
"Shop_ID" int,
"Shop_Name" text,
"Location" text,
"Open_Date" text,
"Open_Year" int,
PRIMARY KEY ("Shop_ID")
);

Question: Please show different software platforms and the corresponding number of devices using each.

assistant: SELECT Software_Platform , COUNT(*) FROM device GROUP BY Software_Platform
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 "college" (
"College_ID" int,
"Name" text,
"Leader_Name" text,
"College_Location" text,
PRIMARY KEY ("College_ID")
);

Question: Show the names of members and the locations of colleges they go to in ascending alphabetical order of member names.

assistant: SELECT T2.Name , T1.College_Location FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID ORDER BY T2.Name ASC
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 "festival_detail" (
"Festival_ID" int,
"Festival_Name" text,
"Chair_Name" text,
"Location" text,
"Year" int,
"Num_of_Audience" int,
PRIMARY KEY ("Festival_ID")
);

Question: How many artworks are there?

assistant: SELECT count(*) FROM artwork