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 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: solution No. refers to Solution.Id; percentage = DIVIDE(MULTIPLY(SUBTRACT(SUM(Solution.Id = 51424), SUM(Solution.Id = 167053)), 100)), SUM(Solution.Id = 167053);

Question: How many percent more of the stars for the repository of solution No.51424 than No.167053?

assistant: SELECT CAST(SUM(CASE WHEN T2.Id = 51424 THEN T1.Stars ELSE 0 END) - SUM(CASE WHEN T2.Id = 167053 THEN T1.Stars ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN T2.Id = 167053 THEN T1.Stars ELSE 0 END) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId
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 "medicine" (
"id" int,
"name" text,
"Trade_Name" text,
"FDA_approved" text,
primary key ("id")
);

CREATE TABLE "enzyme" (
"id" int,
"name" text,
"Location" text,
"Product" text,
"Chromosome" text,
"OMIM" int,
"Porphyria" text,
primary key ("id")
);


CREATE TABLE "medicine_enzyme_interaction" (
"enzyme_id" int,
"medicine_id" int,
"interaction_type" text,
primary key ("enzyme_id", "medicine_id"),
foreign key ("enzyme_id") references `enzyme`("id"),
foreign key ("medicine_id") references `medicine`("id")
);

Question: What are the medicine and trade names that cannot interact with the enzyme with the product 'Heme'?

assistant: SELECT name , trade_name FROM medicine EXCEPT SELECT T1.name , T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id JOIN enzyme AS T3 ON T3.id = T2.enzyme_id WHERE T3.product = 'Protoporphyrinogen IX'
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: respondents' and 'users' are synonyms; younger than 25 years old refers to AnswerText(SurveyID = 2016& QuestionID = 1)< 25

Question: How many respondents younger than 25 years old did participate in the survey in 2016?

assistant: SELECT COUNT(DISTINCT T1.UserID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T1.QuestionID = 1 AND T1.SurveyID = 2016 AND T1.AnswerText <= 25
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 duration, file size and format of songs whose genre is pop, ordered by title?

assistant: SELECT T1.duration , T1.file_size , T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id WHERE T2.genre_is = "pop" ORDER BY T2.song_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 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: device no. refers to device_id; device_id = 29182687948017100; in 2016 refers to `timestamp` LIKE '2016%';

Question: How many events have happened on device no.29182687948017100 in 2016?

assistant: SELECT COUNT(event_id) FROM `events` WHERE SUBSTR(`timestamp`, 1, 4) = '2016' AND device_id = 29182687948017100
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: highest paying customer refers to MAX(amount); entire address = addressLine1+addressLine2;

Question: Which countries do the top 5 highest paying customers in a single payment come from? Indicate their entire address.

assistant: SELECT DISTINCT T2.country, T2.addressLine1, T2.addressLine2 FROM payments AS T1 INNER JOIN customers AS T2 ON T1.customerNumber = T2.customerNumber ORDER BY T1.amount DESC LIMIT 5
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: 'Chef Anton's Gumbo Mix' is a ProductName; 'New Orleans Cajun Delights' is a CompanyName;

Question: Provide the category name of the Chef Anton's Gumbo Mix product that New Orleans Cajun Delights company has.

assistant: SELECT T3.CategoryName FROM Suppliers AS T1 INNER JOIN Products AS T2 ON T1.SupplierID = T2.SupplierID INNER JOIN Categories AS T3 ON T2.CategoryID = T3.CategoryID WHERE T1.CompanyName = 'New Orleans Cajun Delights' AND T2.ProductName LIKE 'Chef Anton%s Gumbo Mix'
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,
  First text,
  Last text,
  StreetAddress text,
  City text,
  State text,
  ZipCode integer,
  Email text,
  PhoneNumber text,
  FirstPurchaseDate date,
  SubscribedToEmailList text,
  Gender text
);
CREATE TABLE geolocation (
  LocationID integer PRIMARY KEY,
  Latitude real,
  Longitude real
);
CREATE TABLE location (
  LocationID integer PRIMARY KEY,
  LocationName text,
  StreetAddress text,
  City text,
  State text,
  ZipCode integer
);
CREATE TABLE rootbeerbrand (
  BrandID integer PRIMARY KEY,
  BrandName text,
  FirstBrewedYear integer,
  BreweryName text,
  City text,
  State text,
  Country text,
  Description text,
  CaneSugar text,
  CornSyrup text,
  Honey text,
  ArtificialSweetener text,
  Caffeinated text,
  Alcoholic text,
  AvailableInCans text,
  AvailableInBottles text,
  AvailableInKegs text,
  Website text,
  FacebookPage text,
  Twitter text,
  WholesaleCost real,
  CurrentRetailPrice real
);
CREATE TABLE rootbeer (
  RootBeerID integer PRIMARY KEY,
  BrandID integer,
  ContainerType text,
  LocationID integer,
  PurchaseDate date
);
CREATE TABLE rootbeerreview (
  CustomerID integer PRIMARY KEY,
  BrandID integer PRIMARY KEY,
  StarRating integer,
  ReviewDate date,
  Review text
);
CREATE TABLE transaction (
  TransactionID integer PRIMARY KEY,
  CreditCardNumber integer,
  CustomerID integer,
  TransactionDate date,
  CreditCardType text,
  LocationID integer,
  RootBeerID integer,
  PurchasePrice real
);
-- foreign keys: geolocation.LocationID -> location.LocationID; location.LocationID -> geolocation.LocationID; rootbeer.BrandID -> rootbeerbrand.BrandID; rootbeer.LocationID -> location.LocationID; rootbeer.LocationID -> geolocation.LocationID; rootbeerreview.BrandID -> rootbeerbrand.BrandID; rootbeerreview.CustomerID -> customers.CustomerID; transaction.RootBeerID -> rootbeer.RootBeerID; transaction.LocationID -> location.LocationID; transaction.CustomerID -> customers.CustomerID

Hint: Thomas Kemper refers to BrandName = 'Thomas Kemper';  latitude the beer is consumed the most refers to MAX(COUNT(Latitude));

Question: At what latitude is the Thomas Kemper brand beer consumed the most?

assistant: SELECT T3.Latitude FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID INNER JOIN geolocation AS T3 ON T1.LocationID = T3.LocationID WHERE T2.BrandName = 'Thomas Kemper' GROUP BY T3.Latitude ORDER BY COUNT(T1.BrandID) 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 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: full office location address = address, locationcity, state, zipcode; location where most employees work at refers to MAX(locationID)

Question: What is the full office location address where most of the employees work at?

assistant: SELECT T2.address, T2.locationcity, T2.state, T2.zipcode FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID GROUP BY T2.address, T2.locationcity, T2.state, T2.zipcode 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:
-- 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: Select the name and price of the cheapest product.

assistant: SELECT name , price FROM Products ORDER BY price ASC 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 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: Monterey refers to region = 'monterey'

Question: How many cities are there in Monterey?

assistant: SELECT COUNT(DISTINCT city) FROM geographic WHERE region = 'monterey'
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: the highest unit price refers to MAX(UnitPrice);

Question: What is the company name of the supplier who supplies the product with the highest unit price?

assistant: SELECT T2.CompanyName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.UnitPrice = ( SELECT MAX(UnitPrice) FROM Products )
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_content` VARCHAR(80),
`city` VARCHAR(50),
`zip_postcode` VARCHAR(20),
`state_province_county` VARCHAR(50),
`country` VARCHAR(50),
`other_address_details` VARCHAR(255)
);

Question: What is the total number of products that are in orders with status "Cancelled"?

assistant: SELECT sum(t2.order_quantity) FROM customer_orders AS t1 JOIN order_items AS t2 ON t1.order_id = t2.order_id WHERE t1.order_status = "Cancelled"
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: Motorcycles refer to productLine = 'motorcycles'; ordered in 2004 refers to year(orderDate) = 2004;

Question: How many motorcycles have been ordered in 2004?

assistant: SELECT SUM(t2.quantityOrdered) FROM orders AS t1 INNER JOIN orderdetails AS t2 ON t1.orderNumber = t2.orderNumber INNER JOIN products AS t3 ON t2.productCode = t3.productCode WHERE t3.productLine = 'motorcycles' AND STRFTIME('%Y', t1.orderDate) = '2004'