instruction stringlengths 1.07k 3.45k | output stringlengths 19 508 | system stringclasses 1 value |
|---|---|---|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: user_profiles. Primary Key: (uid)
uid, INT(11)
name, VARCHAR(255), Value Examples: ['Iron Man', 'Natalie Portman', 'Tyler Swift']
email, VARCHAR(255), Value Examples: ['cd@superstar.com', 'susan@gmail.com\n', 'Mary@yale.edu']
partitionid, INT(11)
followers, INT(11)
[Foreign keys]
[Question]
Find the maximum and total number of followers of all users.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT max(followers), sum(followers) FROM user_profiles; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Fenta Orange', 'Sprite Lemo', 'Cream Soda']
product_stock_number, VARCHAR(50), Value Examples: ['37 hq', '52 ee', '24 ec']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['1', '8', '5']
length, VARCHAR(20), Value Examples: ['3', '6', '9']
height, VARCHAR(20), Value Examples: ['9', '5', '7']
width, VARCHAR(20), Value Examples: ['5', '6', '8']
[Foreign keys]
[Question]
Find the names of all the catalog entries.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT distinct(catalog_entry_name) FROM catalog_contents; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Ramune', 'Fenta Orange', 'Carbonated Water']
product_stock_number, VARCHAR(50), Value Examples: ['89 cp', '37 hq', '52 ee']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['1', '8', '5']
length, VARCHAR(20), Value Examples: ['3', '6', '9']
height, VARCHAR(20), Value Examples: ['9', '5', '7']
width, VARCHAR(20), Value Examples: ['5', '6', '8']
[Foreign keys]
[Question]
What are all the catalog entry names?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT distinct(catalog_entry_name) FROM catalog_contents; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: attribute_definitions. Primary Key: (attribute_id)
attribute_id, INTEGER
attribute_name, VARCHAR(30), Value Examples: ['Sweet', 'Green', 'Black']
attribute_data_type, VARCHAR(10), Value Examples: ['Bool']
[Foreign keys]
[Question]
Find the list of attribute data types possessed by more than 3 attribute definitions.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT attribute_data_type FROM attribute_definitions GROUP BY attribute_data_type HAVING count(*) > 3; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: attribute_definitions. Primary Key: (attribute_id)
attribute_id, INTEGER
attribute_name, VARCHAR(30), Value Examples: ['Sweet', 'Yellow', 'Green']
attribute_data_type, VARCHAR(10), Value Examples: ['Bool']
[Foreign keys]
[Question]
What are the attribute data types with more than 3 attribute definitions?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT attribute_data_type FROM attribute_definitions GROUP BY attribute_data_type HAVING count(*) > 3; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: attribute_definitions. Primary Key: (attribute_id)
attribute_id, INTEGER
attribute_name, VARCHAR(30), Value Examples: ['Green', 'Yellow', 'Sweet']
attribute_data_type, VARCHAR(10), Value Examples: ['Bool']
[Foreign keys]
[Question]
What is the attribute data type of the attribute with name "Green"?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT attribute_data_type FROM attribute_definitions WHERE attribute_name = "Green"; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: attribute_definitions. Primary Key: (attribute_id)
attribute_id, INTEGER
attribute_name, VARCHAR(30), Value Examples: ['Green', 'Yellow', 'Sweet']
attribute_data_type, VARCHAR(10), Value Examples: ['Bool']
[Foreign keys]
[Question]
Find the attribute data type for the attribute named "Green".
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT attribute_data_type FROM attribute_definitions WHERE attribute_name = "Green"; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_structure. Primary Key: (catalog_level_number)
catalog_level_number, INTEGER
catalog_id, INTEGER
catalog_level_name, VARCHAR(50), Value Examples: ['Sub-Category', 'Product', 'Category']
[Foreign keys]
[Question]
Find the name and level of catalog structure with level between 5 and 10.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT catalog_level_name, catalog_level_number FROM catalog_structure WHERE catalog_level_number BETWEEN 5 AND 10; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_structure. Primary Key: (catalog_level_number)
catalog_level_number, INTEGER
catalog_id, INTEGER
catalog_level_name, VARCHAR(50), Value Examples: ['Sub-Category', 'Product', 'Category']
[Foreign keys]
[Question]
What are the name and level of catalog structure with level number between 5 and 10
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT catalog_level_name, catalog_level_number FROM catalog_structure WHERE catalog_level_number BETWEEN 5 AND 10; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalogs. Primary Key: (catalog_id)
catalog_id, INTEGER
catalog_name, VARCHAR(50), Value Examples: ['Lemonade', 'Chocolate', 'Sparkling Water']
catalog_publisher, VARCHAR(80), Value Examples: ['Murray Coffee shop', 'Koepp-Rutherford handmade chocolate store', 'Grady & Kautzer']
date_of_publication, DATETIME
date_of_latest_revision, DATETIME
[Foreign keys]
[Question]
Find all the catalog publishers whose name contains "Murray"
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT distinct(catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE "%Murray%"; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalogs. Primary Key: (catalog_id)
catalog_id, INTEGER
catalog_name, VARCHAR(50), Value Examples: ['Sparkling Water', 'Chocolate', 'Lemonade']
catalog_publisher, VARCHAR(80), Value Examples: ['Murray Coffee shop', 'Grady & Kautzer', 'Koepp-Rutherford handmade chocolate store']
date_of_publication, DATETIME
date_of_latest_revision, DATETIME
[Foreign keys]
[Question]
Which catalog publishers have substring "Murray" in their names?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT distinct(catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE "%Murray%"; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalogs. Primary Key: (catalog_id)
catalog_id, INTEGER
catalog_name, VARCHAR(50), Value Examples: ['Chocolate', 'Sparkling Water', 'Breakfast Tea']
catalog_publisher, VARCHAR(80), Value Examples: ['Russel-Gislason Lemon shop', 'Koepp-Rutherford handmade chocolate store', 'Grady & Kautzer']
date_of_publication, DATETIME
date_of_latest_revision, DATETIME
[Foreign keys]
[Question]
Which catalog publisher has published the most catalogs?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT catalog_publisher FROM catalogs GROUP BY catalog_publisher ORDER BY count(*) DESC LIMIT 1; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalogs. Primary Key: (catalog_id)
catalog_id, INTEGER
catalog_name, VARCHAR(50), Value Examples: ['Breakfast Tea', 'Chocolate', 'Sparkling Water']
catalog_publisher, VARCHAR(80), Value Examples: ['Koepp-Rutherford handmade chocolate store', 'Russel-Gislason Lemon shop', 'Grady & Kautzer']
date_of_publication, DATETIME
date_of_latest_revision, DATETIME
[Foreign keys]
[Question]
Find the catalog publisher that has the most catalogs.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT catalog_publisher FROM catalogs GROUP BY catalog_publisher ORDER BY count(*) DESC LIMIT 1; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalogs. Primary Key: (catalog_id)
catalog_id, INTEGER
catalog_name, VARCHAR(50), Value Examples: ['Breakfast Tea', 'Sparkling Water', 'Jam']
catalog_publisher, VARCHAR(80), Value Examples: ['Grady & Kautzer', 'Koepp-Rutherford handmade chocolate store', 'Russel-Gislason Lemon shop']
date_of_publication, DATETIME
date_of_latest_revision, DATETIME
- Table: catalog_structure. Primary Key: (catalog_level_number)
catalog_level_number, INTEGER
catalog_id, INTEGER
catalog_level_name, VARCHAR(50), Value Examples: ['Category', 'Sub-Category', 'Product']
[Foreign keys]
catalog_structure(catalog_id) references catalogs(catalog_id)
[Question]
Find the names and publication dates of all catalogs that have catalog level number greater than 5.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT t1.catalog_name, t1.date_of_publication FROM catalogs AS t1 JOIN catalog_structure AS t2 ON t1.catalog_id = t2.catalog_id WHERE catalog_level_number > 5; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalogs. Primary Key: (catalog_id)
catalog_id, INTEGER
catalog_name, VARCHAR(50), Value Examples: ['Sparkling Water', 'Breakfast Tea', 'Jam']
catalog_publisher, VARCHAR(80), Value Examples: ['Koepp-Rutherford handmade chocolate store', 'Russel-Gislason Lemon shop', 'Murray Coffee shop']
date_of_publication, DATETIME
date_of_latest_revision, DATETIME
- Table: catalog_structure. Primary Key: (catalog_level_number)
catalog_level_number, INTEGER
catalog_id, INTEGER
catalog_level_name, VARCHAR(50), Value Examples: ['Sub-Category', 'Category', 'Product']
[Foreign keys]
catalog_structure(catalog_id) references catalogs(catalog_id)
[Question]
What are the name and publication date of the catalogs with catalog level number above 5?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT t1.catalog_name, t1.date_of_publication FROM catalogs AS t1 JOIN catalog_structure AS t2 ON t1.catalog_id = t2.catalog_id WHERE catalog_level_number > 5; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Carbonated Water', 'Sprite Lemo', 'Fenta Orange']
product_stock_number, VARCHAR(50), Value Examples: ['26 op', '89 cp', '37 hq']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['1', '8', '5']
length, VARCHAR(20), Value Examples: ['3', '6', '9']
height, VARCHAR(20), Value Examples: ['9', '5', '7']
width, VARCHAR(20), Value Examples: ['5', '6', '8']
- Table: catalog_contents_additional_attributes. Primary Key: ()
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
attribute_id, INTEGER
attribute_value, VARCHAR(255), Value Examples: ['1', '0']
[Foreign keys]
catalog_contents_additional_attributes(catalog_entry_id) references catalog_contents(catalog_entry_id)
[Question]
What are the entry names of catalog with the attribute possessed by most entries.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT t1.catalog_entry_name FROM catalog_contents AS t1 JOIN catalog_contents_additional_attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.attribute_value = (SELECT attribute_value FROM catalog_contents_additional_attributes GROUP BY attribute_value ORDER BY count(*) DESC LIMIT 1); | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Diet Mountain Dew', 'Fenta Orange', 'Carbonated Water']
product_stock_number, VARCHAR(50), Value Examples: ['89 cp', '37 hq', '52 ee']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['1', '8', '5']
length, VARCHAR(20), Value Examples: ['3', '6', '9']
height, VARCHAR(20), Value Examples: ['9', '5', '7']
width, VARCHAR(20), Value Examples: ['5', '6', '8']
- Table: catalog_contents_additional_attributes. Primary Key: ()
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
attribute_id, INTEGER
attribute_value, VARCHAR(255), Value Examples: ['1', '0']
[Foreign keys]
catalog_contents_additional_attributes(catalog_entry_id) references catalog_contents(catalog_entry_id)
[Question]
Find the entry names of the catalog with the attribute that have the most entries.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT t1.catalog_entry_name FROM catalog_contents AS t1 JOIN catalog_contents_additional_attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.attribute_value = (SELECT attribute_value FROM catalog_contents_additional_attributes GROUP BY attribute_value ORDER BY count(*) DESC LIMIT 1); | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Diet Pepsi', 'Root beer', 'Sprite Lemo']
product_stock_number, VARCHAR(50), Value Examples: ['52 ee', '89 cp', '37 hq']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['1', '8', '5']
length, VARCHAR(20), Value Examples: ['3', '6', '9']
height, VARCHAR(20), Value Examples: ['9', '5', '7']
width, VARCHAR(20), Value Examples: ['5', '6', '8']
[Foreign keys]
[Question]
What is the entry name of the most expensive catalog (in USD)?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT catalog_entry_name FROM catalog_contents ORDER BY price_in_dollars DESC LIMIT 1; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Sprite Lemo', 'Diet Pepsi', 'Cream Soda']
product_stock_number, VARCHAR(50), Value Examples: ['26 op', '89 cp', '37 hq']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['1', '8', '5']
length, VARCHAR(20), Value Examples: ['3', '6', '9']
height, VARCHAR(20), Value Examples: ['9', '5', '7']
width, VARCHAR(20), Value Examples: ['5', '6', '8']
[Foreign keys]
[Question]
Find the entry name of the catalog with the highest price (in USD).
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT catalog_entry_name FROM catalog_contents ORDER BY price_in_dollars DESC LIMIT 1; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Sprite Lemo', 'Cream Soda', 'Diet Pepsi']
product_stock_number, VARCHAR(50), Value Examples: ['52 ee', '89 cp', '37 hq']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['1', '8', '5']
length, VARCHAR(20), Value Examples: ['3', '6', '9']
height, VARCHAR(20), Value Examples: ['9', '5', '7']
width, VARCHAR(20), Value Examples: ['5', '6', '8']
- Table: catalog_structure. Primary Key: (catalog_level_number)
catalog_level_number, INTEGER
catalog_id, INTEGER
catalog_level_name, VARCHAR(50), Value Examples: ['Category', 'Sub-Category', 'Product']
[Foreign keys]
catalog_contents(catalog_level_number) references catalog_structure(catalog_level_number)
[Question]
What is the level name of the cheapest catalog (in USD)?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT t2.catalog_level_name FROM catalog_contents AS t1 JOIN catalog_structure AS t2 ON t1.catalog_level_number = t2.catalog_level_number ORDER BY t1.price_in_dollars LIMIT 1; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Sprite Lemo', 'Cream Soda', 'Diet Pepsi']
product_stock_number, VARCHAR(50), Value Examples: ['52 ee', '26 op', '89 cp']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['1', '8', '5']
length, VARCHAR(20), Value Examples: ['3', '6', '9']
height, VARCHAR(20), Value Examples: ['9', '5', '7']
width, VARCHAR(20), Value Examples: ['5', '6', '8']
- Table: catalog_structure. Primary Key: (catalog_level_number)
catalog_level_number, INTEGER
catalog_id, INTEGER
catalog_level_name, VARCHAR(50), Value Examples: ['Sub-Category', 'Category', 'Product']
[Foreign keys]
catalog_contents(catalog_level_number) references catalog_structure(catalog_level_number)
[Question]
Find the level name of the catalog with the lowest price (in USD).
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT t2.catalog_level_name FROM catalog_contents AS t1 JOIN catalog_structure AS t2 ON t1.catalog_level_number = t2.catalog_level_number ORDER BY t1.price_in_dollars LIMIT 1; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Sprite Lemo', 'Root beer', 'Dr Pepper']
product_stock_number, VARCHAR(50), Value Examples: ['26 op', '89 cp', '37 hq']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['1', '8', '5']
length, VARCHAR(20), Value Examples: ['3', '6', '9']
height, VARCHAR(20), Value Examples: ['9', '5', '7']
width, VARCHAR(20), Value Examples: ['5', '6', '8']
[Foreign keys]
[Question]
What are the average and minimum price (in Euro) of all products?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT avg(price_in_euros), min(price_in_euros) FROM catalog_contents; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Ginger Beer', 'Sprite Lemo', 'Carbonated Water']
product_stock_number, VARCHAR(50), Value Examples: ['26 op', '37 hq', '52 ee']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['1', '8', '5']
length, VARCHAR(20), Value Examples: ['3', '6', '9']
height, VARCHAR(20), Value Examples: ['9', '5', '7']
width, VARCHAR(20), Value Examples: ['5', '6', '8']
[Foreign keys]
[Question]
Give me the average and minimum price (in Euro) of the products.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT avg(price_in_euros), min(price_in_euros) FROM catalog_contents; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Diet Pepsi', 'Ginger Beer', 'Fenta Orange']
product_stock_number, VARCHAR(50), Value Examples: ['89 cp', '37 hq', '52 ee']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['1', '8', '5']
length, VARCHAR(20), Value Examples: ['3', '6', '9']
height, VARCHAR(20), Value Examples: ['9', '5', '7']
width, VARCHAR(20), Value Examples: ['5', '6', '8']
[Foreign keys]
[Question]
What is the product with the highest height? Give me the catalog entry name.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT catalog_entry_name FROM catalog_contents ORDER BY height DESC LIMIT 1; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Diet Pepsi', 'Carbonated Water', 'Ginger Beer']
product_stock_number, VARCHAR(50), Value Examples: ['65 wc', '89 cp', '37 hq']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['1', '8', '5']
length, VARCHAR(20), Value Examples: ['3', '6', '9']
height, VARCHAR(20), Value Examples: ['9', '5', '7']
width, VARCHAR(20), Value Examples: ['5', '6', '8']
[Foreign keys]
[Question]
Which catalog content has the highest height? Give me the catalog entry name.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT catalog_entry_name FROM catalog_contents ORDER BY height DESC LIMIT 1; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Cream Soda', 'Diet Pepsi', 'Sprite Lemo']
product_stock_number, VARCHAR(50), Value Examples: ['89 cp', '42 cp', '01 ap']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['1', '8', '5']
length, VARCHAR(20), Value Examples: ['3', '6', '9']
height, VARCHAR(20), Value Examples: ['9', '5', '7']
width, VARCHAR(20), Value Examples: ['5', '6', '8']
[Foreign keys]
[Question]
Find the name of the product that has the smallest capacity.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT catalog_entry_name FROM catalog_contents ORDER BY capacity ASC LIMIT 1; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Carbonated Water', 'Fenta Orange', 'Diet Pepsi']
product_stock_number, VARCHAR(50), Value Examples: ['89 cp', '42 cp', '01 ap']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['1', '8', '5']
length, VARCHAR(20), Value Examples: ['3', '6', '9']
height, VARCHAR(20), Value Examples: ['9', '5', '7']
width, VARCHAR(20), Value Examples: ['5', '6', '8']
[Foreign keys]
[Question]
Which catalog content has the smallest capacity? Return the catalog entry name.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT catalog_entry_name FROM catalog_contents ORDER BY capacity ASC LIMIT 1; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Root beer', 'Cream Soda', 'Fenta Orange']
product_stock_number, VARCHAR(50), Value Examples: ['26 op', '52 ee', '42 cp']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['1', '8', '5']
length, VARCHAR(20), Value Examples: ['3', '6', '9']
height, VARCHAR(20), Value Examples: ['2', '9', '5']
width, VARCHAR(20), Value Examples: ['5', '6', '8']
[Foreign keys]
[Question]
Find the names of all the products whose stock number starts with "2".
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT catalog_entry_name FROM catalog_contents WHERE product_stock_number LIKE "2%"; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Carbonated Water', 'Diet Mountain Dew', 'Root beer']
product_stock_number, VARCHAR(50), Value Examples: ['01 ap', '42 cp', '24 ec']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['1', '8', '5']
length, VARCHAR(20), Value Examples: ['3', '6', '9']
height, VARCHAR(20), Value Examples: ['2', '9', '5']
width, VARCHAR(20), Value Examples: ['5', '6', '8']
[Foreign keys]
[Question]
Which catalog contents have a product stock number that starts from "2"? Show the catalog entry names.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT catalog_entry_name FROM catalog_contents WHERE product_stock_number LIKE "2%"; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Root beer', 'Sprite Lemo', 'Cream Soda']
product_stock_number, VARCHAR(50), Value Examples: ['89 cp', '52 ee', '42 cp']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['8', '1', '5']
length, VARCHAR(20), Value Examples: ['8', '3', '6']
height, VARCHAR(20), Value Examples: ['8', '9', '5']
width, VARCHAR(20), Value Examples: ['8', '5', '6']
- Table: catalog_contents_additional_attributes. Primary Key: ()
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
attribute_id, INTEGER
attribute_value, VARCHAR(255), Value Examples: ['1', '0']
[Foreign keys]
catalog_contents_additional_attributes(catalog_entry_id) references catalog_contents(catalog_entry_id)
[Question]
Find the names of catalog entries with level number 8.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT t1.catalog_entry_name FROM catalog_contents AS t1 JOIN catalog_contents_additional_attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = "8"; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Root beer', 'Sprite Lemo', 'Cream Soda']
product_stock_number, VARCHAR(50), Value Examples: ['52 ee', '89 cp', '01 ap']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['8', '1', '5']
length, VARCHAR(20), Value Examples: ['8', '3', '6']
height, VARCHAR(20), Value Examples: ['8', '9', '5']
width, VARCHAR(20), Value Examples: ['8', '5', '6']
- Table: catalog_contents_additional_attributes. Primary Key: ()
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
attribute_id, INTEGER
attribute_value, VARCHAR(255), Value Examples: ['1', '0']
[Foreign keys]
catalog_contents_additional_attributes(catalog_entry_id) references catalog_contents(catalog_entry_id)
[Question]
What are the names of catalog entries with level number 8?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT t1.catalog_entry_name FROM catalog_contents AS t1 JOIN catalog_contents_additional_attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = "8"; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Ginger Beer', 'Sprite Lemo', 'Fenta Orange']
product_stock_number, VARCHAR(50), Value Examples: ['26 op', '37 hq', '53 bg']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['5', '1', '8']
length, VARCHAR(20), Value Examples: ['3', '5', '6']
height, VARCHAR(20), Value Examples: ['5', '3', '9']
width, VARCHAR(20), Value Examples: ['5', '3', '6']
[Foreign keys]
[Question]
Find the names of the products with length smaller than 3 or height greater than 5.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT catalog_entry_name FROM catalog_contents WHERE LENGTH < 3 OR width > 5; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Fenta Orange', 'Carbonated Water', 'Mountain Dew']
product_stock_number, VARCHAR(50), Value Examples: ['53 bg', '65 wc', '37 hq']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['5', '1', '8']
length, VARCHAR(20), Value Examples: ['3', '5', '6']
height, VARCHAR(20), Value Examples: ['5', '3', '9']
width, VARCHAR(20), Value Examples: ['5', '3', '6']
[Foreign keys]
[Question]
Which catalog contents have length below 3 or above 5? Find the catalog entry names.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT catalog_entry_name FROM catalog_contents WHERE LENGTH < 3 OR width > 5; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: attribute_definitions. Primary Key: (attribute_id)
attribute_id, INTEGER
attribute_name, VARCHAR(30), Value Examples: ['Sweet', 'Green', 'Yellow']
attribute_data_type, VARCHAR(10), Value Examples: ['Bool']
- Table: catalog_contents_additional_attributes. Primary Key: ()
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
attribute_id, INTEGER
attribute_value, VARCHAR(255), Value Examples: ['0', '1']
[Foreign keys]
[Question]
Find the name and attribute ID of the attribute definitions with attribute value 0.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT t1.attribute_name, t1.attribute_id FROM attribute_definitions AS t1 JOIN catalog_contents_additional_attributes AS t2 ON t1.attribute_id = t2.attribute_id WHERE t2.attribute_value = 0; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: attribute_definitions. Primary Key: (attribute_id)
attribute_id, INTEGER
attribute_name, VARCHAR(30), Value Examples: ['Green', 'Sweet', 'Yellow']
attribute_data_type, VARCHAR(10), Value Examples: ['Bool']
- Table: catalog_contents_additional_attributes. Primary Key: ()
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
attribute_id, INTEGER
attribute_value, VARCHAR(255), Value Examples: ['0', '1']
[Foreign keys]
[Question]
Which attribute definitions have attribute value 0? Give me the attribute name and attribute ID.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT t1.attribute_name, t1.attribute_id FROM attribute_definitions AS t1 JOIN catalog_contents_additional_attributes AS t2 ON t1.attribute_id = t2.attribute_id WHERE t2.attribute_value = 0; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Sprite Lemo', 'Ginger Beer', 'Cream Soda']
product_stock_number, VARCHAR(50), Value Examples: ['89 cp', '42 cp', '01 ap']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['7', '1', '8']
length, VARCHAR(20), Value Examples: ['7', '3', '6']
height, VARCHAR(20), Value Examples: ['7', '9', '5']
width, VARCHAR(20), Value Examples: ['7', '5', '6']
[Foreign keys]
[Question]
Find the name and capacity of products with price greater than 700 (in USD).
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT catalog_entry_name, capacity FROM catalog_contents WHERE price_in_dollars > 700; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Cola', 'Carbonated Water', 'Diet Mountain Dew']
product_stock_number, VARCHAR(50), Value Examples: ['89 cp', '42 cp', '01 ap']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['7', '1', '8']
length, VARCHAR(20), Value Examples: ['7', '3', '6']
height, VARCHAR(20), Value Examples: ['7', '9', '5']
width, VARCHAR(20), Value Examples: ['7', '5', '6']
[Foreign keys]
[Question]
Which catalog contents has price above 700 dollars? Show their catalog entry names and capacities.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT catalog_entry_name, capacity FROM catalog_contents WHERE price_in_dollars > 700; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalogs. Primary Key: (catalog_id)
catalog_id, INTEGER
catalog_name, VARCHAR(50), Value Examples: ['Lemonade', 'Coffee Bean', 'Sparkling Water']
catalog_publisher, VARCHAR(80), Value Examples: ['Koepp-Rutherford handmade chocolate store', 'Grady & Kautzer', 'Russel-Gislason Lemon shop']
date_of_publication, DATETIME
date_of_latest_revision, DATETIME
[Foreign keys]
[Question]
Find the dates on which more than one revisions were made.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT date_of_latest_revision FROM catalogs GROUP BY date_of_latest_revision HAVING count(*) > 1; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalogs. Primary Key: (catalog_id)
catalog_id, INTEGER
catalog_name, VARCHAR(50), Value Examples: ['Lemonade', 'Coffee Bean', 'Coco powder']
catalog_publisher, VARCHAR(80), Value Examples: ['Grady & Kautzer', 'Russel-Gislason Lemon shop', 'Koepp-Rutherford handmade chocolate store']
date_of_publication, DATETIME
date_of_latest_revision, DATETIME
[Foreign keys]
[Question]
On which days more than one revisions were made on catalogs.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT date_of_latest_revision FROM catalogs GROUP BY date_of_latest_revision HAVING count(*) > 1; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Sprite Lemo', 'Carbonated Water', 'Fenta Orange']
product_stock_number, VARCHAR(50), Value Examples: ['24 ec', '52 ee', '89 cp']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['1', '8', '5']
length, VARCHAR(20), Value Examples: ['3', '6', '9']
height, VARCHAR(20), Value Examples: ['9', '5', '7']
width, VARCHAR(20), Value Examples: ['5', '6', '8']
[Foreign keys]
[Question]
How many products are there in the records?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT count(*) FROM catalog_contents; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Root beer', 'Mountain Dew', 'Carbonated Water']
product_stock_number, VARCHAR(50), Value Examples: ['89 cp', '37 hq', '52 ee']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['1', '8', '5']
length, VARCHAR(20), Value Examples: ['3', '6', '9']
height, VARCHAR(20), Value Examples: ['9', '5', '7']
width, VARCHAR(20), Value Examples: ['5', '6', '8']
[Foreign keys]
[Question]
Find the total number of catalog contents.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT count(*) FROM catalog_contents; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Dr Pepper', 'Fenta Orange', 'Ginger Beer']
product_stock_number, VARCHAR(50), Value Examples: ['89 cp', '01 ap', '37 hq']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['8', '1', '5']
length, VARCHAR(20), Value Examples: ['8', '3', '6']
height, VARCHAR(20), Value Examples: ['8', '9', '5']
width, VARCHAR(20), Value Examples: ['8', '5', '6']
[Foreign keys]
[Question]
Name all the products with next entry ID greater than 8.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT catalog_entry_name FROM catalog_contents WHERE next_entry_id > 8; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: catalog_contents. Primary Key: (catalog_entry_id)
catalog_entry_id, INTEGER
catalog_level_number, INTEGER
parent_entry_id, INTEGER
previous_entry_id, INTEGER
next_entry_id, INTEGER
catalog_entry_name, VARCHAR(80), Value Examples: ['Carbonated Water', 'Cream Soda', 'Diet Pepsi']
product_stock_number, VARCHAR(50), Value Examples: ['26 op', '89 cp', '01 ap']
price_in_dollars, DOUBLE
price_in_euros, DOUBLE
price_in_pounds, DOUBLE
capacity, VARCHAR(20), Value Examples: ['8', '1', '5']
length, VARCHAR(20), Value Examples: ['8', '3', '6']
height, VARCHAR(20), Value Examples: ['8', '9', '5']
width, VARCHAR(20), Value Examples: ['8', '5', '6']
[Foreign keys]
[Question]
What are the catalog entry names of the products with next entry ID above 8?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT catalog_entry_name FROM catalog_contents WHERE next_entry_id > 8; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: aircraft. Primary Key: (aid)
aid, NUMBER(9,0), Comment: 'airline id'
name, VARCHAR2(30), Value Examples: ['Airbus A320', 'Airbus A319', 'Embraer ERJ-145']
distance, NUMBER(6,0)
[Foreign keys]
[Question]
How many aircrafts do we have?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT count(*) FROM aircraft; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: aircraft. Primary Key: (aid)
aid, NUMBER(9,0), Comment: 'airline id'
name, VARCHAR2(30), Value Examples: ['SAAB 340', 'Airbus A320', 'Airbus A319']
distance, NUMBER(6,0)
[Foreign keys]
[Question]
How many aircrafts exist in the database?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT count(*) FROM aircraft; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: aircraft. Primary Key: (aid)
aid, NUMBER(9,0), Comment: 'airline id'
name, VARCHAR2(30), Value Examples: ['Piper Archer III', 'Airbus A320', 'Airbus A319']
distance, NUMBER(6,0)
[Foreign keys]
[Question]
Show name and distance for all aircrafts.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT name, distance FROM aircraft; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: aircraft. Primary Key: (aid)
aid, NUMBER(9,0), Comment: 'airline id'
name, VARCHAR2(30), Value Examples: ['British Aerospace Jetstream 41', 'Airbus A320', 'Airbus A319']
distance, NUMBER(6,0)
[Foreign keys]
[Question]
What are the names and distances for all airplanes?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT name, distance FROM aircraft; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: aircraft. Primary Key: (aid)
aid, NUMBER(9,0), Comment: 'airline id'
name, VARCHAR2(30), Value Examples: ['Airbus A340-300', 'Airbus A320', 'Airbus A319']
distance, NUMBER(6,0)
[Foreign keys]
[Question]
Show ids for all aircrafts with more than 1000 distance.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT aid FROM aircraft WHERE distance > 1000; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: aircraft. Primary Key: (aid)
aid, NUMBER(9,0), Comment: 'airline id'
name, VARCHAR2(30), Value Examples: ['Airbus A340-300', 'Airbus A320', 'Airbus A319']
distance, NUMBER(6,0)
[Foreign keys]
[Question]
What are the ids of all aircrafts that can cover a distance of more than 1000?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT aid FROM aircraft WHERE distance > 1000; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: aircraft. Primary Key: (aid)
aid, NUMBER(9,0), Comment: 'airline id'
name, VARCHAR2(30), Value Examples: ['Airbus A340-300', 'British Aerospace Jetstream 41', 'Airbus A320']
distance, NUMBER(6,0)
[Foreign keys]
[Question]
How many aircrafts have distance between 1000 and 5000?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT count(*) FROM aircraft WHERE distance BETWEEN 1000 AND 5000; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: aircraft. Primary Key: (aid)
aid, NUMBER(9,0), Comment: 'airline id'
name, VARCHAR2(30), Value Examples: ['Airbus A340-300', 'Airbus A320', 'Airbus A319']
distance, NUMBER(6,0)
[Foreign keys]
[Question]
What is the count of aircrafts that have a distance between 1000 and 5000?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT count(*) FROM aircraft WHERE distance BETWEEN 1000 AND 5000; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: aircraft. Primary Key: (aid)
aid, NUMBER(9,0), Comment: 'airline id'
name, VARCHAR2(30), Value Examples: ['Airbus A320', 'Airbus A319', 'Piper Archer III']
distance, NUMBER(6,0)
[Foreign keys]
[Question]
What is the name and distance for aircraft with id 12?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT name, distance FROM aircraft WHERE aid = 12; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: aircraft. Primary Key: (aid)
aid, NUMBER(9,0), Comment: 'airline id'
name, VARCHAR2(30), Value Examples: ['Airbus A320', 'Airbus A319', 'Piper Archer III']
distance, NUMBER(6,0)
[Foreign keys]
[Question]
What is the name and distance for the aircraft that has an id of 12?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT name, distance FROM aircraft WHERE aid = 12; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: aircraft. Primary Key: (aid)
aid, NUMBER(9,0), Comment: 'airline id'
name, VARCHAR2(30), Value Examples: ['British Aerospace Jetstream 41', 'Piper Archer III', 'Boeing 767-400ER']
distance, NUMBER(6,0)
[Foreign keys]
[Question]
What is the minimum, average, and maximum distance of all aircrafts.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT min(distance), avg(distance), max(distance) FROM aircraft; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: aircraft. Primary Key: (aid)
aid, NUMBER(9,0), Comment: 'airline id'
name, VARCHAR2(30), Value Examples: ['Piper Archer III', 'Embraer ERJ-145', 'Airbus A320']
distance, NUMBER(6,0)
[Foreign keys]
[Question]
Return the minimum, average and maximum distances traveled across all aircrafts.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT min(distance), avg(distance), max(distance) FROM aircraft; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: aircraft. Primary Key: (aid)
aid, NUMBER(9,0), Comment: 'airline id'
name, VARCHAR2(30), Value Examples: ['Schwitzer 2-33', 'Piper Archer III', 'British Aerospace Jetstream 41']
distance, NUMBER(6,0)
[Foreign keys]
[Question]
Show the id and name of the aircraft with the maximum distance.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT aid, name FROM aircraft ORDER BY distance DESC LIMIT 1; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: aircraft. Primary Key: (aid)
aid, NUMBER(9,0), Comment: 'airline id'
name, VARCHAR2(30), Value Examples: ['Piper Archer III', 'British Aerospace Jetstream 41', 'Schwitzer 2-33']
distance, NUMBER(6,0)
[Foreign keys]
[Question]
What is the id and name of the aircraft that can cover the maximum distance?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT aid, name FROM aircraft ORDER BY distance DESC LIMIT 1; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: aircraft. Primary Key: (aid)
aid, NUMBER(9,0), Comment: 'airline id'
name, VARCHAR2(30), Value Examples: ['Schwitzer 2-33', 'Airbus A320', 'Airbus A319']
distance, NUMBER(6,0)
[Foreign keys]
[Question]
Show the name of aircrafts with top three lowest distances.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT name FROM aircraft ORDER BY distance LIMIT 3; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: aircraft. Primary Key: (aid)
aid, NUMBER(9,0), Comment: 'airline id'
name, VARCHAR2(30), Value Examples: ['Airbus A320', 'Airbus A319', 'Piper Archer III']
distance, NUMBER(6,0)
[Foreign keys]
[Question]
What are the aircrafts with top 3 shortest lengthes? List their names.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT name FROM aircraft ORDER BY distance LIMIT 3; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: aircraft. Primary Key: (aid)
aid, NUMBER(9,0), Comment: 'airline id'
name, VARCHAR2(30), Value Examples: ['British Aerospace Jetstream 41', 'Airbus A320', 'Airbus A319']
distance, NUMBER(6,0)
[Foreign keys]
[Question]
Show names for all aircrafts with distances more than the average.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT name FROM aircraft WHERE distance > (SELECT avg(distance) FROM aircraft); | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: aircraft. Primary Key: (aid)
aid, NUMBER(9,0), Comment: 'airline id'
name, VARCHAR2(30), Value Examples: ['Airbus A340-300', 'Airbus A320', 'Airbus A319']
distance, NUMBER(6,0)
[Foreign keys]
[Question]
What are the names of all aircrafts that can cover more distances than average?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT name FROM aircraft WHERE distance > (SELECT avg(distance) FROM aircraft); | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: employee. Primary Key: (eid)
eid, NUMBER(9,0), Comment: 'employee id'
name, VARCHAR2(30), Value Examples: ['Larry West', 'Milo Brooks', 'Mary Johnson']
salary, NUMBER(10,2)
[Foreign keys]
[Question]
How many employees do we have?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT count(*) FROM employee; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: employee. Primary Key: (eid)
eid, NUMBER(9,0), Comment: 'employee id'
name, VARCHAR2(30), Value Examples: ['Chad Stewart', 'George Wright', 'Larry West']
salary, NUMBER(10,2)
[Foreign keys]
[Question]
What is the number of employees?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT count(*) FROM employee; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: employee. Primary Key: (eid)
eid, NUMBER(9,0), Comment: 'employee id'
name, VARCHAR2(30), Value Examples: ['Larry West', 'Robert Brown', 'Lisa Walker']
salary, NUMBER(10,2)
[Foreign keys]
[Question]
Show name and salary for all employees sorted by salary.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT name, salary FROM employee ORDER BY salary; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: employee. Primary Key: (eid)
eid, NUMBER(9,0), Comment: 'employee id'
name, VARCHAR2(30), Value Examples: ['Larry West', 'Chad Stewart', 'Eric Cooper']
salary, NUMBER(10,2)
[Foreign keys]
[Question]
What is the name and salary of all employees in order of salary?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT name, salary FROM employee ORDER BY salary; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: employee. Primary Key: (eid)
eid, NUMBER(9,0), Comment: 'employee id'
name, VARCHAR2(30), Value Examples: ['Larry West', 'James Smith', 'George Wright']
salary, NUMBER(10,2)
[Foreign keys]
[Question]
Show ids for all employees with at least 100000 salary.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT eid FROM employee WHERE salary > 100000; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: employee. Primary Key: (eid)
eid, NUMBER(9,0), Comment: 'employee id'
name, VARCHAR2(30), Value Examples: ['Chad Stewart', 'Larry West', 'Lisa Walker']
salary, NUMBER(10,2)
[Foreign keys]
[Question]
What is the id of every employee who has at least a salary of 100000?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT eid FROM employee WHERE salary > 100000; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: employee. Primary Key: (eid)
eid, NUMBER(9,0), Comment: 'employee id'
name, VARCHAR2(30), Value Examples: ['Larry West', 'Betty Adams', 'Robert Brown']
salary, NUMBER(10,2)
[Foreign keys]
[Question]
How many employees have salary between 100000 and 200000?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT count(*) FROM employee WHERE salary BETWEEN 100000 AND 200000; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: employee. Primary Key: (eid)
eid, NUMBER(9,0), Comment: 'employee id'
name, VARCHAR2(30), Value Examples: ['Larry West', 'Chad Stewart', 'James Smith']
salary, NUMBER(10,2)
[Foreign keys]
[Question]
What is the number of employees that have a salary between 100000 and 200000?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT count(*) FROM employee WHERE salary BETWEEN 100000 AND 200000; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: employee. Primary Key: (eid)
eid, NUMBER(9,0), Comment: 'employee id'
name, VARCHAR2(30), Value Examples: ['Larry West', 'Chad Stewart', 'George Wright']
salary, NUMBER(10,2)
[Foreign keys]
[Question]
What is the name and salary for employee with id 242518965?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT name, salary FROM employee WHERE eid = 242518965; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: employee. Primary Key: (eid)
eid, NUMBER(9,0), Comment: 'employee id'
name, VARCHAR2(30), Value Examples: ['Larry West', 'Chad Stewart', 'George Wright']
salary, NUMBER(10,2)
[Foreign keys]
[Question]
What is the name and salary of the employee with the id 242518965?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT name, salary FROM employee WHERE eid = 242518965; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: employee. Primary Key: (eid)
eid, NUMBER(9,0), Comment: 'employee id'
name, VARCHAR2(30), Value Examples: ['Larry West', 'Lisa Walker', 'Betty Adams']
salary, NUMBER(10,2)
[Foreign keys]
[Question]
What is average and maximum salary of all employees.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT avg(salary), max(salary) FROM employee; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: employee. Primary Key: (eid)
eid, NUMBER(9,0), Comment: 'employee id'
name, VARCHAR2(30), Value Examples: ['Larry West', 'Chad Stewart', 'Lisa Walker']
salary, NUMBER(10,2)
[Foreign keys]
[Question]
What is the average and largest salary of all employees?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT avg(salary), max(salary) FROM employee; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: employee. Primary Key: (eid)
eid, NUMBER(9,0), Comment: 'employee id'
name, VARCHAR2(30), Value Examples: ['Larry West', 'David Anderson', 'James Smith']
salary, NUMBER(10,2)
[Foreign keys]
[Question]
Show the id and name of the employee with maximum salary.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT eid, name FROM employee ORDER BY salary DESC LIMIT 1; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: employee. Primary Key: (eid)
eid, NUMBER(9,0), Comment: 'employee id'
name, VARCHAR2(30), Value Examples: ['Larry West', 'David Anderson', 'Chad Stewart']
salary, NUMBER(10,2)
[Foreign keys]
[Question]
What is the id and name of the employee with the highest salary?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT eid, name FROM employee ORDER BY salary DESC LIMIT 1; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: employee. Primary Key: (eid)
eid, NUMBER(9,0), Comment: 'employee id'
name, VARCHAR2(30), Value Examples: ['Larry West', 'George Wright', 'James Smith']
salary, NUMBER(10,2)
[Foreign keys]
[Question]
Show the name of employees with three lowest salaries.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT name FROM employee ORDER BY salary ASC LIMIT 3; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: employee. Primary Key: (eid)
eid, NUMBER(9,0), Comment: 'employee id'
name, VARCHAR2(30), Value Examples: ['Chad Stewart', 'Dorthy Lewis', 'James Smith']
salary, NUMBER(10,2)
[Foreign keys]
[Question]
What is the name of the 3 employees who get paid the least?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT name FROM employee ORDER BY salary ASC LIMIT 3; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: employee. Primary Key: (eid)
eid, NUMBER(9,0), Comment: 'employee id'
name, VARCHAR2(30), Value Examples: ['Larry West', 'Chad Stewart', 'James Smith']
salary, NUMBER(10,2)
[Foreign keys]
[Question]
Show names for all employees with salary more than the average.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT name FROM employee WHERE salary > (SELECT avg(salary) FROM employee); | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: employee. Primary Key: (eid)
eid, NUMBER(9,0), Comment: 'employee id'
name, VARCHAR2(30), Value Examples: ['Chad Stewart', 'Larry West', 'Betty Adams']
salary, NUMBER(10,2)
[Foreign keys]
[Question]
What are the names of all employees who have a salary higher than average?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT name FROM employee WHERE salary > (SELECT avg(salary) FROM employee); | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: employee. Primary Key: (eid)
eid, NUMBER(9,0), Comment: 'employee id'
name, VARCHAR2(30), Value Examples: ['Mark Young', 'Larry West', 'David Anderson']
salary, NUMBER(10,2)
[Foreign keys]
[Question]
Show the id and salary of Mark Young.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT eid, salary FROM employee WHERE name = 'Mark Young'; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: employee. Primary Key: (eid)
eid, NUMBER(9,0), Comment: 'employee id'
name, VARCHAR2(30), Value Examples: ['Mark Young', 'Larry West', 'Chad Stewart']
salary, NUMBER(10,2)
[Foreign keys]
[Question]
What is the id and salary of the employee named Mark Young?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT eid, salary FROM employee WHERE name = 'Mark Young'; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: flight. Primary Key: (flno)
flno, NUMBER(4,0), Comment: 'flight number'
origin, VARCHAR2(20), Value Examples: ['Los Angeles', 'Chicago']
destination, VARCHAR2(20), Value Examples: ['Los Angeles', 'Chicago', 'Washington D.C.']
distance, NUMBER(6,0)
departure_date, DATE
arrival_date, DATE
price, NUMBER(7,2)
aid, NUMBER(9,0), Comment: 'airline id'
[Foreign keys]
[Question]
How many flights do we have?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT count(*) FROM flight; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: flight. Primary Key: (flno)
flno, NUMBER(4,0), Comment: 'flight number'
origin, VARCHAR2(20), Value Examples: ['Chicago', 'Los Angeles']
destination, VARCHAR2(20), Value Examples: ['New York', 'Washington D.C.', 'Chicago']
distance, NUMBER(6,0)
departure_date, DATE
arrival_date, DATE
price, NUMBER(7,2)
aid, NUMBER(9,0), Comment: 'airline id'
[Foreign keys]
[Question]
What is the number of flights?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT count(*) FROM flight; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: flight. Primary Key: (flno)
flno, NUMBER(4,0), Comment: 'flight number'
origin, VARCHAR2(20), Value Examples: ['Chicago', 'Los Angeles']
destination, VARCHAR2(20), Value Examples: ['Washington D.C.', 'Dallas', 'Chicago']
distance, NUMBER(6,0)
departure_date, DATE
arrival_date, DATE
price, NUMBER(7,2)
aid, NUMBER(9,0), Comment: 'airline id'
[Foreign keys]
[Question]
Show flight number, origin, destination of all flights in the alphabetical order of the departure cities.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT flno, origin, destination FROM flight ORDER BY origin; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: flight. Primary Key: (flno)
flno, NUMBER(4,0), Comment: 'flight number'
origin, VARCHAR2(20), Value Examples: ['Chicago', 'Los Angeles']
destination, VARCHAR2(20), Value Examples: ['Washington D.C.', 'Dallas', 'Chicago']
distance, NUMBER(6,0)
departure_date, DATE
arrival_date, DATE
price, NUMBER(7,2)
aid, NUMBER(9,0), Comment: 'airline id'
[Foreign keys]
[Question]
What is the flight number, origin, and destination for all flights in alphabetical order by departure cities?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT flno, origin, destination FROM flight ORDER BY origin; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: flight. Primary Key: (flno)
flno, NUMBER(4,0), Comment: 'flight number'
origin, VARCHAR2(20), Value Examples: ['Los Angeles', 'Chicago']
destination, VARCHAR2(20), Value Examples: ['Los Angeles', 'Dallas', 'Boston']
distance, NUMBER(6,0)
departure_date, DATE
arrival_date, DATE
price, NUMBER(7,2)
aid, NUMBER(9,0), Comment: 'airline id'
[Foreign keys]
[Question]
Show all flight number from Los Angeles.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT flno FROM flight WHERE origin = "Los Angeles"; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: flight. Primary Key: (flno)
flno, NUMBER(4,0), Comment: 'flight number'
origin, VARCHAR2(20), Value Examples: ['Los Angeles', 'Chicago']
destination, VARCHAR2(20), Value Examples: ['Los Angeles', 'Dallas', 'Washington D.C.']
distance, NUMBER(6,0)
departure_date, DATE
arrival_date, DATE
price, NUMBER(7,2)
aid, NUMBER(9,0), Comment: 'airline id'
[Foreign keys]
[Question]
What are the numbers of all flights coming from Los Angeles?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT flno FROM flight WHERE origin = "Los Angeles"; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: flight. Primary Key: (flno)
flno, NUMBER(4,0), Comment: 'flight number'
origin, VARCHAR2(20), Value Examples: ['Chicago', 'Los Angeles']
destination, VARCHAR2(20), Value Examples: ['Honolulu', 'Washington D.C.', 'New York']
distance, NUMBER(6,0)
departure_date, DATE
arrival_date, DATE
price, NUMBER(7,2)
aid, NUMBER(9,0), Comment: 'airline id'
[Foreign keys]
[Question]
Show origins of all flights with destination Honolulu.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT origin FROM flight WHERE destination = "Honolulu"; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: flight. Primary Key: (flno)
flno, NUMBER(4,0), Comment: 'flight number'
origin, VARCHAR2(20), Value Examples: ['Los Angeles', 'Chicago']
destination, VARCHAR2(20), Value Examples: ['Honolulu', 'New York', 'Dallas']
distance, NUMBER(6,0)
departure_date, DATE
arrival_date, DATE
price, NUMBER(7,2)
aid, NUMBER(9,0), Comment: 'airline id'
[Foreign keys]
[Question]
What are the origins of all flights that are headed to Honolulu?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT origin FROM flight WHERE destination = "Honolulu"; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: flight. Primary Key: (flno)
flno, NUMBER(4,0), Comment: 'flight number'
origin, VARCHAR2(20), Value Examples: ['Los Angeles', 'Chicago']
destination, VARCHAR2(20), Value Examples: ['Honolulu', 'Los Angeles', 'Dallas']
distance, NUMBER(6,0)
departure_date, DATE
arrival_date, DATE
price, NUMBER(7,2)
aid, NUMBER(9,0), Comment: 'airline id'
[Foreign keys]
[Question]
Show me the departure date and arrival date for all flights from Los Angeles to Honolulu.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT departure_date, arrival_date FROM flight WHERE origin = "Los Angeles" AND destination = "Honolulu"; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: flight. Primary Key: (flno)
flno, NUMBER(4,0), Comment: 'flight number'
origin, VARCHAR2(20), Value Examples: ['Los Angeles', 'Chicago']
destination, VARCHAR2(20), Value Examples: ['Honolulu', 'Dallas', 'Los Angeles']
distance, NUMBER(6,0)
departure_date, DATE
arrival_date, DATE
price, NUMBER(7,2)
aid, NUMBER(9,0), Comment: 'airline id'
[Foreign keys]
[Question]
What are the departure and arrival dates of all flights from LA to Honolulu?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT departure_date, arrival_date FROM flight WHERE origin = "Los Angeles" AND destination = "Honolulu"; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: flight. Primary Key: (flno)
flno, NUMBER(4,0), Comment: 'flight number'
origin, VARCHAR2(20), Value Examples: ['Los Angeles', 'Chicago']
destination, VARCHAR2(20), Value Examples: ['New York', 'Los Angeles', 'Washington D.C.']
distance, NUMBER(6,0)
departure_date, DATE
arrival_date, DATE
price, NUMBER(7,2)
aid, NUMBER(9,0), Comment: 'airline id'
[Foreign keys]
[Question]
Show flight number for all flights with more than 2000 distance.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT flno FROM flight WHERE distance > 2000; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: flight. Primary Key: (flno)
flno, NUMBER(4,0), Comment: 'flight number'
origin, VARCHAR2(20), Value Examples: ['Los Angeles', 'Chicago']
destination, VARCHAR2(20), Value Examples: ['Washington D.C.', 'Los Angeles', 'Dallas']
distance, NUMBER(6,0)
departure_date, DATE
arrival_date, DATE
price, NUMBER(7,2)
aid, NUMBER(9,0), Comment: 'airline id'
[Foreign keys]
[Question]
What are the numbers of all flights that can cover a distance of more than 2000?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT flno FROM flight WHERE distance > 2000; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: flight. Primary Key: (flno)
flno, NUMBER(4,0), Comment: 'flight number'
origin, VARCHAR2(20), Value Examples: ['Los Angeles', 'Chicago']
destination, VARCHAR2(20), Value Examples: ['Los Angeles', 'Honolulu', 'Washington D.C.']
distance, NUMBER(6,0)
departure_date, DATE
arrival_date, DATE
price, NUMBER(7,2)
aid, NUMBER(9,0), Comment: 'airline id'
[Foreign keys]
[Question]
What is the average price for flights from Los Angeles to Honolulu.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT avg(price) FROM flight WHERE origin = "Los Angeles" AND destination = "Honolulu"; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: flight. Primary Key: (flno)
flno, NUMBER(4,0), Comment: 'flight number'
origin, VARCHAR2(20), Value Examples: ['Los Angeles', 'Chicago']
destination, VARCHAR2(20), Value Examples: ['Honolulu', 'Los Angeles', 'New York']
distance, NUMBER(6,0)
departure_date, DATE
arrival_date, DATE
price, NUMBER(7,2)
aid, NUMBER(9,0), Comment: 'airline id'
[Foreign keys]
[Question]
What is the average price for flights from LA to Honolulu?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT avg(price) FROM flight WHERE origin = "Los Angeles" AND destination = "Honolulu"; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: flight. Primary Key: (flno)
flno, NUMBER(4,0), Comment: 'flight number'
origin, VARCHAR2(20), Value Examples: ['Los Angeles', 'Chicago']
destination, VARCHAR2(20), Value Examples: ['Washington D.C.', 'Los Angeles', 'Chicago']
distance, NUMBER(6,0)
departure_date, DATE
arrival_date, DATE
price, NUMBER(7,2)
aid, NUMBER(9,0), Comment: 'airline id'
[Foreign keys]
[Question]
Show origin and destination for flights with price higher than 300.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT origin, destination FROM flight WHERE price > 300; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: flight. Primary Key: (flno)
flno, NUMBER(4,0), Comment: 'flight number'
origin, VARCHAR2(20), Value Examples: ['Los Angeles', 'Chicago']
destination, VARCHAR2(20), Value Examples: ['Washington D.C.', 'Los Angeles', 'Dallas']
distance, NUMBER(6,0)
departure_date, DATE
arrival_date, DATE
price, NUMBER(7,2)
aid, NUMBER(9,0), Comment: 'airline id'
[Foreign keys]
[Question]
What is the origin and destination for all flights whose price is higher than 300?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT origin, destination FROM flight WHERE price > 300; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: flight. Primary Key: (flno)
flno, NUMBER(4,0), Comment: 'flight number'
origin, VARCHAR2(20), Value Examples: ['Los Angeles', 'Chicago']
destination, VARCHAR2(20), Value Examples: ['Washington D.C.', 'Los Angeles', 'Boston']
distance, NUMBER(6,0)
departure_date, DATE
arrival_date, DATE
price, NUMBER(7,2)
aid, NUMBER(9,0), Comment: 'airline id'
[Foreign keys]
[Question]
Show the flight number and distance of the flight with maximum price.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT flno, distance FROM flight ORDER BY price DESC LIMIT 1; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: flight. Primary Key: (flno)
flno, NUMBER(4,0), Comment: 'flight number'
origin, VARCHAR2(20), Value Examples: ['Los Angeles', 'Chicago']
destination, VARCHAR2(20), Value Examples: ['Washington D.C.', 'Los Angeles', 'New York']
distance, NUMBER(6,0)
departure_date, DATE
arrival_date, DATE
price, NUMBER(7,2)
aid, NUMBER(9,0), Comment: 'airline id'
[Foreign keys]
[Question]
What is the flight number and its distance for the one with the maximum price?
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT flno, distance FROM flight ORDER BY price DESC LIMIT 1; | You are an experienced and professional database administrator.
|
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question].
[Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided to assist in understanding.
- Table: flight. Primary Key: (flno)
flno, NUMBER(4,0), Comment: 'flight number'
origin, VARCHAR2(20), Value Examples: ['Los Angeles', 'Chicago']
destination, VARCHAR2(20), Value Examples: ['Los Angeles', 'New York', 'Washington D.C.']
distance, NUMBER(6,0)
departure_date, DATE
arrival_date, DATE
price, NUMBER(7,2)
aid, NUMBER(9,0), Comment: 'airline id'
[Foreign keys]
[Question]
Show the flight number of flights with three lowest distances.
[Constraints] Your [SQL Query] should satisfy the following constraints:
- In `SELECT <column>`, must only use the column given in the [Database Schema].
- In `FROM <table>` or `JOIN <table>`, must only use the table given in the [Database Schema].
- In `JOIN`, must only use the tables and columns in the [Foreign keys].
- Without any specific instructions, Use `ASC` for `ORDER BY` by default,
- Consider use `DISTINCT` when you need to eliminate duplicates.
- The content in quotes is case sensitive.
- Prioritize column whose value are more relevant to the [Question].
[SQL Query] | SELECT flno FROM flight ORDER BY distance ASC LIMIT 3; | You are an experienced and professional database administrator.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.