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 Country (
  CountryCode text PRIMARY KEY,
  ShortName text,
  TableName text,
  LongName text,
  Alpha2Code text,
  CurrencyUnit text,
  SpecialNotes text,
  Region text,
  IncomeGroup text,
  Wb2Code text,
  NationalAccountsBaseYear text,
  NationalAccountsReferenceYear text,
  SnaPriceValuation text,
  LendingCategory text,
  OtherGroups text,
  SystemOfNationalAccounts text,
  AlternativeConversionFactor text,
  PppSurveyYear text,
  BalanceOfPaymentsManualInUse text,
  ExternalDebtReportingStatus text,
  SystemOfTrade text,
  GovernmentAccountingConcept text,
  ImfDataDisseminationStandard text,
  LatestPopulationCensus text,
  LatestHouseholdSurvey text,
  SourceOfMostRecentIncomeAndExpenditureData text,
  VitalRegistrationComplete text,
  LatestAgriculturalCensus text,
  LatestIndustrialData integer,
  LatestTradeData integer,
  LatestWaterWithdrawalData integer
);
CREATE TABLE Series (
  SeriesCode text PRIMARY KEY,
  Topic text,
  IndicatorName text,
  ShortDefinition text,
  LongDefinition text,
  UnitOfMeasure text,
  Periodicity text,
  BasePeriod text,
  OtherNotes integer,
  AggregationMethod text,
  LimitationsAndExceptions text,
  NotesFromOriginalSource text,
  GeneralComments text,
  Source text,
  StatisticalConceptAndMethodology text,
  DevelopmentRelevance text,
  RelatedSourceLinks text,
  OtherWebLinks integer,
  RelatedIndicators integer,
  LicenseType text
);
CREATE TABLE CountryNotes (
  Countrycode text PRIMARY KEY,
  Seriescode text PRIMARY KEY,
  Description text
);
CREATE TABLE Footnotes (
  Countrycode text PRIMARY KEY,
  Seriescode text PRIMARY KEY,
  Year text PRIMARY KEY,
  Description text
);
CREATE TABLE Indicators (
  CountryName text,
  CountryCode text PRIMARY KEY,
  IndicatorName text,
  IndicatorCode text PRIMARY KEY,
  Year integer PRIMARY KEY,
  Value integer
);
CREATE TABLE SeriesNotes (
  Seriescode text PRIMARY KEY,
  Year text PRIMARY KEY,
  Description text
);
-- foreign keys: CountryNotes.Countrycode -> Country.CountryCode; CountryNotes.Seriescode -> Series.SeriesCode; Footnotes.Countrycode -> Country.CountryCode; Footnotes.Seriescode -> Series.SeriesCode; Indicators.CountryCode -> Country.CountryCode; SeriesNotes.Seriescode -> Series.SeriesCode

Hint: European & Central Asian is the name of the region; IndicatorName = 'Arms imports (SIPRI trend indicator values)'; countries refer to CountryCode; DIVIDE(Sum(Value), Count(CountryCode));

Question: Please calculate the average of Arms imports (SIPRI trend indicator values) of the European & Central Asian countries.

assistant: SELECT CAST(SUM(T2.Value) AS REAL) / COUNT(T1.CountryCode) FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Region = 'Europe & Central Asia' AND T2.IndicatorName = 'Arms imports (SIPRI trend indicator values)'
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 businesses (
  business_id integer PRIMARY KEY,
  name text,
  address text,
  city text,
  postal_code text,
  latitude real,
  longitude real,
  phone_number integer,
  tax_code text,
  business_certificate integer,
  application_date date,
  owner_name text,
  owner_address text,
  owner_city text,
  owner_state text,
  owner_zip text
);
CREATE TABLE inspections (
  business_id integer,
  score integer,
  date date,
  type text
);
CREATE TABLE violations (
  business_id integer,
  date date,
  violation_type_id text,
  risk_category text,
  description text
);
-- foreign keys: inspections.business_id -> businesses.business_id; violations.business_id -> businesses.business_id

Hint: businesses with score that ranges from 70 to 80 refer to business_id where score between 80 and 90;

Question: Among the businesses with score that ranges from 70 to 80, list their violation type ID and risk category.

assistant: SELECT DISTINCT T1.violation_type_id, T1.risk_category FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id INNER JOIN inspections AS T3 ON T2.business_id = T3.business_id WHERE T3.score BETWEEN 70 AND 80
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 lists (
  user_id integer,
  list_id integer PRIMARY KEY,
  list_title text,
  list_movie_number integer,
  list_update_timestamp_utc text,
  list_creation_timestamp_utc text,
  list_followers integer,
  list_url text,
  list_comments integer,
  list_description text,
  list_cover_image_url text,
  list_first_image_url text,
  list_second_image_url text,
  list_third_image_url text
);
CREATE TABLE movies (
  movie_id integer PRIMARY KEY,
  movie_title text,
  movie_release_year integer,
  movie_url text,
  movie_title_language text,
  movie_popularity integer,
  movie_image_url text,
  director_id text,
  director_name text,
  director_url text
);
CREATE TABLE ratings_users (
  user_id integer,
  rating_date_utc text,
  user_trialist integer,
  user_subscriber integer,
  user_avatar_image_url text,
  user_cover_image_url text,
  user_eligible_for_trial integer,
  user_has_payment_method integer
);
CREATE TABLE lists_users (
  user_id integer PRIMARY KEY,
  list_id integer PRIMARY KEY,
  list_update_date_utc text,
  list_creation_date_utc text,
  user_trialist integer,
  user_subscriber integer,
  user_avatar_image_url text,
  user_cover_image_url text,
  user_eligible_for_trial text,
  user_has_payment_method text
);
CREATE TABLE ratings (
  movie_id integer,
  rating_id integer,
  rating_url text,
  rating_score integer,
  rating_timestamp_utc text,
  critic text,
  critic_likes integer,
  critic_comments integer,
  user_id integer,
  user_trialist integer,
  user_subscriber integer,
  user_eligible_for_trial integer,
  user_has_payment_method integer
);
-- foreign keys: lists.user_id -> lists_users.user_id; ratings_users.user_id -> lists_users.user_id; lists_users.user_id -> lists.user_id; lists_users.list_id -> lists.list_id; ratings.user_id -> ratings_users.user_id; ratings.user_id -> lists_users.user_id; ratings.movie_id -> movies.movie_id

Hint: average number of number of movies refers to AVG(list_movie_number); user 8516503 refers to user_id = 8516503; rating score of 5 refers to rating_score = 5

Question: What is the average number of number of movies added to the lists of user 8516503? Indicate how many movies did he/she give a rating score of 5.

assistant: SELECT AVG(T3.list_movie_number) , SUM(CASE WHEN T1.rating_score = 5 THEN 1 ELSE 0 END) FROM ratings AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T2.user_id INNER JOIN lists AS T3 ON T2.user_id = T3.user_id WHERE T1.user_id = 8516503
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 is the average number of gold medals for a club?

assistant: SELECT avg(Gold) 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:
CREATE TABLE Author (
  Id integer PRIMARY KEY,
  Name text,
  Affiliation text
);
CREATE TABLE Conference (
  Id integer PRIMARY KEY,
  ShortName text,
  FullName text,
  HomePage text
);
CREATE TABLE Journal (
  Id integer PRIMARY KEY,
  ShortName text,
  FullName text,
  HomePage text
);
CREATE TABLE Paper (
  Id integer PRIMARY KEY,
  Title text,
  Year integer,
  ConferenceId integer,
  JournalId integer,
  Keyword text
);
CREATE TABLE PaperAuthor (
  PaperId integer,
  AuthorId integer,
  Name text,
  Affiliation text
);
-- foreign keys: Paper.JournalId -> Journal.Id; Paper.ConferenceId -> Conference.Id; PaperAuthor.AuthorId -> Author.Id; PaperAuthor.PaperId -> Paper.Id

Hint: Randall Davis refer to Author.Name

Question: What are the different ways the name of the author, Randall Davis, is written on their papers?

assistant: SELECT DISTINCT T1.Name FROM PaperAuthor AS T1 INNER JOIN Author AS T2 ON T1.AuthorId = T2.Id WHERE T2.Name = 'Randall Davis' AND T1.Name != 'Randall Davis'
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 "Rooms" ( 
	"RoomId" TEXT PRIMARY KEY,
	"roomName" TEXT, 
	"beds" INTEGER, 
	"bedType" TEXT, 
	"maxOccupancy" INTEGER, 
	"basePrice" INTEGER, 
	"decor" TEXT

);

CREATE TABLE "Reservations" ( 
	"Code" INTEGER PRIMARY KEY, 
	"Room" TEXT, 
	"CheckIn" TEXT, 
	"CheckOut" TEXT, 
	"Rate" REAL, 
	"LastName" TEXT, 
	"FirstName" TEXT, 
	"Adults" INTEGER, 
	"Kids" INTEGER,
	FOREIGN KEY (Room) REFERENCES Rooms(RoomId)
);

Question: What are the names and decor of rooms with a king bed? Sort them by their price

assistant: SELECT roomName , decor FROM Rooms WHERE bedtype = 'King' ORDER BY basePrice;
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 Method (
  Id integer PRIMARY KEY,
  Name text,
  FullComment text,
  Summary text,
  ApiCalls text,
  CommentIsXml integer,
  SampledAt integer,
  SolutionId integer,
  Lang text,
  NameTokenized text
);
CREATE TABLE MethodParameter (
  Id integer PRIMARY KEY,
  MethodId text,
  Type text,
  Name text
);
CREATE TABLE Repo (
  Id integer PRIMARY KEY,
  Url text,
  Stars integer,
  Forks integer,
  Watchers integer,
  ProcessedTime integer
);
CREATE TABLE Solution (
  Id integer PRIMARY KEY,
  RepoId integer,
  Path text,
  ProcessedTime integer,
  WasCompiled integer
);

Hint: average time = avg(ProcessedTime)；

Question: What is the average time needed for the solutions containing files within the repository whose url is "https://github.com/jeffdik/tachy.git" to be processd?

assistant: SELECT CAST(SUM(T2.ProcessedTime) AS REAL) / COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Url = 'https://github.com/jeffdik/tachy.git'
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 Restaurant (
       ResID       INTEGER PRIMARY KEY,
       ResName     VARCHAR(100),
       Address     VARCHAR(100),
       Rating INTEGER
);

create table Type_Of_Restaurant (
       ResID       INTEGER,
       ResTypeID   INTEGER,
       FOREIGN KEY(ResID) REFERENCES Restaurant(ResID),
       FOREIGN KEY(ResTypeID) REFERENCES Restaurant_Type(ResTypeID)
);

create table Restaurant_Type (
       ResTypeID            INTEGER PRIMARY KEY,
       ResTypeName          VARCHAR(40),
       ResTypeDescription   VARCHAR(100)
);

create table Visits_Restaurant (
       StuID      INTEGER,
       ResID      INTEGER,
       Time       TIMESTAMP,
       Spent      FLOAT,
       FOREIGN KEY(StuID) REFERENCES Student(StuID),
       FOREIGN KEY(ResID) REFERENCES Restaurant(ResID)
);

Question: What is the rating of the restaurant Subway?

assistant: SELECT Rating FROM Restaurant WHERE ResName = "Subway";
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: the most popular refers to max(review); Asian food refers to food_type = 'asian'; San Francisco refers to city = 'san francisco'

Question: What is the name of the most popular restaurant serving Asian foods in San Francisco?

assistant: SELECT label FROM generalinfo WHERE food_type = 'asian' AND city = 'san francisco' AND review = ( SELECT MAX(review) FROM generalinfo WHERE food_type = 'asian' AND city = 'san francisco' )
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 torrents (
  groupName text,
  totalSnatched integer,
  artist text,
  groupYear integer,
  releaseType text,
  groupId integer,
  id integer PRIMARY KEY
);
CREATE TABLE tags (
  index integer PRIMARY KEY,
  id integer,
  tag text
);

Hint: FALSE;

Question: Which artist has id "16"? Provide her or his tag genre.

assistant: SELECT T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.id = 16
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: amount refers to sum(l_quantity); order no.1 refers to l_orderkey = 1; "burnished seashell gainsboro navajo chocolate" or "salmon white grey tan navy" refers to p_name IN ('salmon white grey tan navy', 'burnished seashell gainsboro navajo chocolate')

Question: Which part is ordered in a bigger amount in order no.1, "burnished seashell gainsboro navajo chocolate" or "salmon white grey tan navy"?

assistant: SELECT T.p_name FROM ( SELECT T2.p_name, SUM(T1.l_quantity) AS num FROM lineitem AS T1 INNER JOIN part AS T2 ON T1.l_partkey = T2.p_partkey WHERE T2.p_name IN ('salmon white grey tan navy', 'burnished seashell gainsboro navajo chocolate') GROUP BY T1.l_partkey ) 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 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: game-Fishing refers to category = 'game-Fishing';

Question: Give the number of "game-Fishing" apps.

assistant: SELECT COUNT(T2.app_id) FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T1.category = 'game-Fishing'
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 "architect" (
"id" text,
"name" text,
"nationality" text,
"gender" text,
primary key("id")
);

CREATE TABLE "bridge" (
"architect_id" int,
"id" int,
"name" text,
"location" text,
"length_meters" real,
"length_feet" real,
primary key("id"),
foreign key ("architect_id" ) references `architect`("id")
);

CREATE TABLE "mill" (
"architect_id" int,
"id" int,
"location" text,
"name" text,
"type" text,
"built_year" int,
"notes" text,
primary key ("id"),
foreign key ("architect_id" ) references `architect`("id")
);

Question: What are the ids, names and genders of the architects who built two bridges or one mill?

assistant: SELECT T1.id , T1.name , T1.gender FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING count(*) = 2 UNION SELECT T1.id , T1.name , T1.gender FROM architect AS T1 JOIN mill AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING count(*) = 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 Author (
  Id integer PRIMARY KEY,
  Name text,
  Affiliation text
);
CREATE TABLE Conference (
  Id integer PRIMARY KEY,
  ShortName text,
  FullName text,
  HomePage text
);
CREATE TABLE Journal (
  Id integer PRIMARY KEY,
  ShortName text,
  FullName text,
  HomePage text
);
CREATE TABLE Paper (
  Id integer PRIMARY KEY,
  Title text,
  Year integer,
  ConferenceId integer,
  JournalId integer,
  Keyword text
);
CREATE TABLE PaperAuthor (
  PaperId integer,
  AuthorId integer,
  Name text,
  Affiliation text
);
-- foreign keys: Paper.JournalId -> Journal.Id; Paper.ConferenceId -> Conference.Id; PaperAuthor.AuthorId -> Author.Id; PaperAuthor.PaperId -> Paper.Id

Hint: SSPR is a ShortName; papers refers to Paper.Id

Question: How many papers are published in year 2000 under the conference "SSPR"?

assistant: SELECT COUNT(T1.Id) FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.Year = 2000 AND T2.ShortName = 'SSPR'
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: What campuses are located in Chico?

assistant: SELECT campus FROM campuses WHERE LOCATION = "Chico"
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_Characteristic_Types` (
`characteristic_type_code` VARCHAR(15) PRIMARY KEY,
`characteristic_type_description` VARCHAR(80)
);
CREATE TABLE `Ref_Colors` (
`color_code` VARCHAR(15) PRIMARY KEY,
`color_description` VARCHAR(80)
);
CREATE TABLE `Ref_Product_Categories` (
`product_category_code` VARCHAR(15) PRIMARY KEY,
`product_category_description` VARCHAR(80),
`unit_of_measure` VARCHAR(20)
);

Question: Find the name of the products that have the color description "red" and have the characteristic name "fast".

assistant: SELECT product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = "red" AND t3.characteristic_name = "fast"