db_id
stringclasses
146 values
question_en
stringlengths
3
224
hardness
stringclasses
4 values
schema_llm
stringclasses
146 values
query_llm
stringlengths
18
631
schema_llm_min
stringclasses
147 values
schema_dict
stringclasses
146 values
tables_and_columns
stringlengths
18
266
schema_reduzido
stringlengths
25
718
schema_reduzido_only_tables
stringlengths
80
2.27k
twitter_1
Find the maximum and total number of followers of all users.
medium
Table follows ( follows.f1 (int(11)), follows.f2 (int(11)), ) Table tweets ( tweets.id (bigint(20)), tweets.uid (int(11)), tweets.text (char(140)), tweets.createdate (datetime), ) Table user_profiles ( user_profiles.uid (int(11)), user_profiles.name (varchar(255)), user_profiles.email (varchar(255)), user_profiles.partitionid (int(11)), user_profiles.followers (int(11)), ) Possible JOINs: follows.f1 = user_profiles.uid follows.f2 = user_profiles.uid tweets.uid = user_profiles.uid
SELECT max(followers) , sum(followers) FROM user_profiles
Table follows ( follows.f1 (int(11)), follows.f2 (int(11)), ) Table tweets ( tweets.id (bigint(20)), tweets.uid (int(11)), tweets.text (char(140)), tweets.createdate (datetime), ) Table user_profiles ( user_profiles.uid (int(11)), user_profiles.name (varchar(255)), user_profiles.email (varchar(255)), user_profiles.partitionid (int(11)), user_profiles.followers (int(11)), ) Possible JOINs: follows.f1 = user_profiles.uid follows.f2 = user_profiles.uid tweets.uid = user_profiles.uid
{ 'follows': ['f1', 'f2'], 'tweets': ['id', 'uid', 'text', 'createdate'], 'user_profiles': ['uid', 'name', 'email', 'partitionid', 'followers'] }
{ 'user_profiles': ['uid', 'followers'] }
TABLE user_profiles ( user_profiles.uid (int(11)), user_profiles.followers (int(11)), ) Possible JOINs:
TABLE user_profiles ( user_profiles.uid (int(11)), user_profiles.name (varchar(255)), user_profiles.email (varchar(255)), user_profiles.partitionid (int(11)), user_profiles.followers (int(11)), ) Possible JOINs:
product_catalog
Find the names of all the catalog entries.
easy
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT distinct(catalog_entry_name) FROM catalog_contents
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id', 'catalog_entry_name'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), )
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
product_catalog
What are all the catalog entry names?
easy
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT distinct(catalog_entry_name) FROM catalog_contents
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id', 'catalog_entry_name'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), )
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
product_catalog
Find the list of attribute data types possessed by more than 3 attribute definitions.
easy
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT attribute_data_type FROM Attribute_Definitions GROUP BY attribute_data_type HAVING count(*) > 3
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'attribute_definitions': ['attribute_id', 'attribute_data_type'] }
TABLE Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Possible JOINs:
TABLE Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Possible JOINs:
product_catalog
What are the attribute data types with more than 3 attribute definitions?
easy
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT attribute_data_type FROM Attribute_Definitions GROUP BY attribute_data_type HAVING count(*) > 3
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'attribute_definitions': ['attribute_id', 'attribute_data_type'] }
TABLE Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Possible JOINs:
TABLE Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Possible JOINs:
product_catalog
What is the attribute data type of the attribute with name "Green"?
easy
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT attribute_data_type FROM Attribute_Definitions WHERE attribute_name = "Green"
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'] }
TABLE Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Possible JOINs:
TABLE Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Possible JOINs:
product_catalog
Find the attribute data type for the attribute named "Green".
easy
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT attribute_data_type FROM Attribute_Definitions WHERE attribute_name = "Green"
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'] }
TABLE Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Possible JOINs:
TABLE Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Possible JOINs:
product_catalog
Find the name and level of catalog structure with level between 5 and 10.
medium
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT catalog_level_name , catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_structure': ['catalog_level_number', 'catalog_level_name'] }
TABLE Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), )
TABLE Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Possible JOINs: Catalog_Structure.catalog_id = Catalogs.catalog_id
product_catalog
What are the name and level of catalog structure with level number between 5 and 10
medium
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT catalog_level_name , catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_structure': ['catalog_level_number', 'catalog_level_name'] }
TABLE Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), )
TABLE Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Possible JOINs: Catalog_Structure.catalog_id = Catalogs.catalog_id
product_catalog
Find all the catalog publishers whose name contains "Murray"
medium
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT distinct(catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE "%Murray%"
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalogs': ['catalog_id', 'catalog_publisher'] }
TABLE Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_publisher (VARCHAR(80)), ) Possible JOINs:
TABLE Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs:
product_catalog
Which catalog publishers have substring "Murray" in their names?
medium
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT distinct(catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE "%Murray%"
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalogs': ['catalog_id', 'catalog_publisher'] }
TABLE Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_publisher (VARCHAR(80)), ) Possible JOINs:
TABLE Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs:
product_catalog
Which catalog publisher has published the most catalogs?
hard
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT catalog_publisher FROM catalogs GROUP BY catalog_publisher ORDER BY count(*) DESC LIMIT 1
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalogs': ['catalog_id', 'catalog_publisher'] }
TABLE Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_publisher (VARCHAR(80)), ) Possible JOINs:
TABLE Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs:
product_catalog
Find the catalog publisher that has the most catalogs.
hard
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT catalog_publisher FROM catalogs GROUP BY catalog_publisher ORDER BY count(*) DESC LIMIT 1
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalogs': ['catalog_id', 'catalog_publisher'] }
TABLE Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_publisher (VARCHAR(80)), ) Possible JOINs:
TABLE Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs:
product_catalog
Find the names and publication dates of all catalogs that have catalog level number greater than 5.
medium
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT catalogs.catalog_name , catalogs.date_of_publication FROM catalogs JOIN catalog_structure ON catalogs.catalog_id = catalog_structure.catalog_id WHERE catalog_level_number > 5
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalogs': ['catalog_id', 'catalog_name', 'date_of_publication'], 'catalog_structure': ['catalog_level_number', 'catalog_id'] }
TABLE Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), ) TABLE Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.date_of_publication (DATETIME), ) Possible JOINs: Catalog_Structure.catalog_id = Catalogs.catalog_id
TABLE Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) TABLE Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Structure.catalog_id = Catalogs.catalog_id
product_catalog
What are the name and publication date of the catalogs with catalog level number above 5?
medium
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT catalogs.catalog_name , catalogs.date_of_publication FROM catalogs JOIN catalog_structure ON catalogs.catalog_id = catalog_structure.catalog_id WHERE catalog_level_number > 5
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalogs': ['catalog_id', 'catalog_name', 'date_of_publication'], 'catalog_structure': ['catalog_level_number', 'catalog_id'] }
TABLE Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), ) TABLE Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.date_of_publication (DATETIME), ) Possible JOINs: Catalog_Structure.catalog_id = Catalogs.catalog_id
TABLE Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) TABLE Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Structure.catalog_id = Catalogs.catalog_id
product_catalog
What are the entry names of catalog with the attribute possessed by most entries.
extra
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT Catalog_Contents.catalog_entry_name FROM Catalog_Contents JOIN Catalog_Contents_Additional_Attributes ON Catalog_Contents.catalog_entry_id = Catalog_Contents_Additional_Attributes.catalog_entry_id WHERE Catalog_Contents_Additional_Attributes.attribute_value = (SELECT attribute_value FROM Catalog_Contents_Additional_Attributes GROUP BY attribute_value ORDER BY count(*) DESC LIMIT 1)
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id', 'catalog_entry_name'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'attribute_value'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), ) TABLE Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Possible JOINs: Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) TABLE Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number
product_catalog
Find the entry names of the catalog with the attribute that have the most entries.
extra
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT Catalog_Contents.catalog_entry_name FROM Catalog_Contents JOIN Catalog_Contents_Additional_Attributes ON Catalog_Contents.catalog_entry_id = Catalog_Contents_Additional_Attributes.catalog_entry_id WHERE Catalog_Contents_Additional_Attributes.attribute_value = (SELECT attribute_value FROM Catalog_Contents_Additional_Attributes GROUP BY attribute_value ORDER BY count(*) DESC LIMIT 1)
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id', 'catalog_entry_name'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'attribute_value'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), ) TABLE Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Possible JOINs: Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) TABLE Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number
product_catalog
What is the entry name of the most expensive catalog (in USD)?
medium
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT catalog_entry_name FROM catalog_contents ORDER BY price_in_dollars DESC LIMIT 1
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id', 'catalog_entry_name', 'price_in_dollars'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.price_in_dollars (DOUBLE), )
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
product_catalog
Find the entry name of the catalog with the highest price (in USD).
medium
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT catalog_entry_name FROM catalog_contents ORDER BY price_in_dollars DESC LIMIT 1
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id', 'catalog_entry_name', 'price_in_dollars'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.price_in_dollars (DOUBLE), )
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
product_catalog
What is the level name of the cheapest catalog (in USD)?
hard
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT catalog_structure.catalog_level_name FROM catalog_contents JOIN catalog_structure ON catalog_contents.catalog_level_number = catalog_structure.catalog_level_number ORDER BY catalog_contents.price_in_dollars LIMIT 1
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'price_in_dollars'], 'catalog_structure': ['catalog_level_number', 'catalog_level_name'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.price_in_dollars (DOUBLE), ) TABLE Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) TABLE Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
product_catalog
Find the level name of the catalog with the lowest price (in USD).
hard
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT catalog_structure.catalog_level_name FROM catalog_contents JOIN catalog_structure ON catalog_contents.catalog_level_number = catalog_structure.catalog_level_number ORDER BY catalog_contents.price_in_dollars LIMIT 1
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'price_in_dollars'], 'catalog_structure': ['catalog_level_number', 'catalog_level_name'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.price_in_dollars (DOUBLE), ) TABLE Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) TABLE Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
product_catalog
What are the average and minimum price (in Euro) of all products?
medium
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT avg(price_in_euros) , min(price_in_euros) FROM catalog_contents
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id', 'price_in_euros'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.price_in_euros (DOUBLE), )
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
product_catalog
Give me the average and minimum price (in Euro) of the products.
medium
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT avg(price_in_euros) , min(price_in_euros) FROM catalog_contents
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id', 'price_in_euros'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.price_in_euros (DOUBLE), )
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
product_catalog
What is the product with the highest height? Give me the catalog entry name.
medium
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT catalog_entry_name FROM catalog_contents ORDER BY height DESC LIMIT 1
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id', 'catalog_entry_name', 'height'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.height (VARCHAR(20)), )
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
product_catalog
Which catalog content has the highest height? Give me the catalog entry name.
medium
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT catalog_entry_name FROM catalog_contents ORDER BY height DESC LIMIT 1
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id', 'catalog_entry_name', 'height'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.height (VARCHAR(20)), )
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
product_catalog
Find the name of the product that has the smallest capacity.
medium
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT catalog_entry_name FROM catalog_contents ORDER BY capacity ASC LIMIT 1
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id', 'catalog_entry_name', 'capacity'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.capacity (VARCHAR(20)), )
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
product_catalog
Which catalog content has the smallest capacity? Return the catalog entry name.
medium
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT catalog_entry_name FROM catalog_contents ORDER BY capacity ASC LIMIT 1
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id', 'catalog_entry_name', 'capacity'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.capacity (VARCHAR(20)), )
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
product_catalog
Find the names of all the products whose stock number starts with "2".
medium
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT catalog_entry_name FROM catalog_contents WHERE product_stock_number LIKE "2%"
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id', 'catalog_entry_name', 'product_stock_number'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), )
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
product_catalog
Which catalog contents have a product stock number that starts from "2"? Show the catalog entry names.
medium
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT catalog_entry_name FROM catalog_contents WHERE product_stock_number LIKE "2%"
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id', 'catalog_entry_name', 'product_stock_number'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), )
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
product_catalog
Find the names of catalog entries with level number 8.
medium
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT Catalog_Contents.catalog_entry_name FROM Catalog_Contents JOIN Catalog_Contents_Additional_Attributes ON Catalog_Contents.catalog_entry_id = Catalog_Contents_Additional_Attributes.catalog_entry_id WHERE Catalog_Contents_Additional_Attributes.catalog_level_number = "8"
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id', 'catalog_entry_name'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), ) TABLE Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), ) Possible JOINs: Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) TABLE Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number
product_catalog
What are the names of catalog entries with level number 8?
medium
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT Catalog_Contents.catalog_entry_name FROM Catalog_Contents JOIN Catalog_Contents_Additional_Attributes ON Catalog_Contents.catalog_entry_id = Catalog_Contents_Additional_Attributes.catalog_entry_id WHERE Catalog_Contents_Additional_Attributes.catalog_level_number = "8"
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id', 'catalog_entry_name'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), ) TABLE Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), ) Possible JOINs: Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) TABLE Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number
product_catalog
Find the names of the products with length smaller than 3 or height greater than 5.
medium
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT catalog_entry_name FROM catalog_contents WHERE LENGTH < 3 OR width > 5
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id', 'catalog_entry_name', 'length', 'width'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), )
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
product_catalog
Which catalog contents have length below 3 or above 5? Find the catalog entry names.
medium
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT catalog_entry_name FROM catalog_contents WHERE LENGTH < 3 OR width > 5
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id', 'catalog_entry_name', 'length', 'width'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), )
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
product_catalog
Find the name and attribute ID of the attribute definitions with attribute value 0.
medium
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT Attribute_Definitions.attribute_name , Attribute_Definitions.attribute_id FROM Attribute_Definitions JOIN Catalog_Contents_Additional_Attributes ON Attribute_Definitions.attribute_id = Catalog_Contents_Additional_Attributes.attribute_id WHERE Catalog_Contents_Additional_Attributes.attribute_value = 0
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'attribute_definitions': ['attribute_id', 'attribute_name'], 'catalog_contents_additional_attributes': ['attribute_id', 'attribute_value'] }
TABLE Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), ) TABLE Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), )
TABLE Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) TABLE Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Possible JOINs: Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number
product_catalog
Which attribute definitions have attribute value 0? Give me the attribute name and attribute ID.
medium
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT Attribute_Definitions.attribute_name , Attribute_Definitions.attribute_id FROM Attribute_Definitions JOIN Catalog_Contents_Additional_Attributes ON Attribute_Definitions.attribute_id = Catalog_Contents_Additional_Attributes.attribute_id WHERE Catalog_Contents_Additional_Attributes.attribute_value = 0
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'attribute_definitions': ['attribute_id', 'attribute_name'], 'catalog_contents_additional_attributes': ['attribute_id', 'attribute_value'] }
TABLE Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), ) TABLE Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), )
TABLE Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) TABLE Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Possible JOINs: Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number
product_catalog
Find the name and capacity of products with price greater than 700 (in USD).
medium
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT catalog_entry_name , capacity FROM Catalog_Contents WHERE price_in_dollars > 700
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id', 'catalog_entry_name', 'price_in_dollars', 'capacity'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), )
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
product_catalog
Which catalog contents has price above 700 dollars? Show their catalog entry names and capacities.
medium
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT catalog_entry_name , capacity FROM Catalog_Contents WHERE price_in_dollars > 700
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id', 'catalog_entry_name', 'price_in_dollars', 'capacity'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), )
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
product_catalog
Find the dates on which more than one revisions were made.
easy
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT date_of_latest_revision FROM Catalogs GROUP BY date_of_latest_revision HAVING count(*) > 1
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalogs': ['catalog_id', 'date_of_latest_revision'] }
TABLE Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs:
TABLE Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs:
product_catalog
On which days more than one revisions were made on catalogs.
easy
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT date_of_latest_revision FROM Catalogs GROUP BY date_of_latest_revision HAVING count(*) > 1
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalogs': ['catalog_id', 'date_of_latest_revision'] }
TABLE Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs:
TABLE Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs:
product_catalog
How many products are there in the records?
easy
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT count(*) FROM catalog_contents
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), )
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
product_catalog
Find the total number of catalog contents.
easy
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT count(*) FROM catalog_contents
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), )
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
product_catalog
Name all the products with next entry ID greater than 8.
easy
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT catalog_entry_name FROM catalog_contents WHERE next_entry_id > 8
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id', 'next_entry_id', 'catalog_entry_name'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), )
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
product_catalog
What are the catalog entry names of the products with next entry ID above 8?
easy
Table Attribute_Definitions ( Attribute_Definitions.attribute_id (INTEGER), Attribute_Definitions.attribute_name (VARCHAR(30)), Attribute_Definitions.attribute_data_type (VARCHAR(10)), ) Table Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Table Catalog_Contents_Additional_Attributes ( Catalog_Contents_Additional_Attributes.catalog_entry_id (INTEGER), Catalog_Contents_Additional_Attributes.catalog_level_number (INTEGER), Catalog_Contents_Additional_Attributes.attribute_id (INTEGER), Catalog_Contents_Additional_Attributes.attribute_value (VARCHAR(255)), ) Table Catalog_Structure ( Catalog_Structure.catalog_level_number (INTEGER), Catalog_Structure.catalog_id (INTEGER), Catalog_Structure.catalog_level_name (VARCHAR(50)), ) Table Catalogs ( Catalogs.catalog_id (INTEGER), Catalogs.catalog_name (VARCHAR(50)), Catalogs.catalog_publisher (VARCHAR(80)), Catalogs.date_of_publication (DATETIME), Catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Contents_Additional_Attributes.catalog_entry_id = Catalog_Contents.catalog_entry_id Catalog_Contents_Additional_Attributes.catalog_level_number = Catalog_Structure.catalog_level_number Catalog_Structure.catalog_id = Catalogs.catalog_id
SELECT catalog_entry_name FROM catalog_contents WHERE next_entry_id > 8
Table attribute_definitions ( attribute_definitions.attribute_id (INTEGER), attribute_definitions.attribute_name (VARCHAR(30)), attribute_definitions.attribute_data_type (VARCHAR(10)), ) Table catalog_contents ( catalog_contents.catalog_entry_id (INTEGER), catalog_contents.catalog_level_number (INTEGER), catalog_contents.parent_entry_id (INTEGER), catalog_contents.previous_entry_id (INTEGER), catalog_contents.next_entry_id (INTEGER), catalog_contents.catalog_entry_name (VARCHAR(80)), catalog_contents.product_stock_number (VARCHAR(50)), catalog_contents.price_in_dollars (DOUBLE), catalog_contents.price_in_euros (DOUBLE), catalog_contents.price_in_pounds (DOUBLE), catalog_contents.capacity (VARCHAR(20)), catalog_contents.length (VARCHAR(20)), catalog_contents.height (VARCHAR(20)), catalog_contents.width (VARCHAR(20)), ) Table catalog_contents_additional_attributes ( catalog_contents_additional_attributes.catalog_entry_id (INTEGER), catalog_contents_additional_attributes.catalog_level_number (INTEGER), catalog_contents_additional_attributes.attribute_id (INTEGER), catalog_contents_additional_attributes.attribute_value (VARCHAR(255)), ) Table catalog_structure ( catalog_structure.catalog_level_number (INTEGER), catalog_structure.catalog_id (INTEGER), catalog_structure.catalog_level_name (VARCHAR(50)), ) Table catalogs ( catalogs.catalog_id (INTEGER), catalogs.catalog_name (VARCHAR(50)), catalogs.catalog_publisher (VARCHAR(80)), catalogs.date_of_publication (DATETIME), catalogs.date_of_latest_revision (DATETIME), ) Possible JOINs: catalog_contents.catalog_level_number = catalog_structure.catalog_level_number catalog_contents_additional_attributes.catalog_entry_id = catalog_contents.catalog_entry_id catalog_contents_additional_attributes.catalog_level_number = catalog_structure.catalog_level_number catalog_structure.catalog_id = catalogs.catalog_id
{ 'attribute_definitions': ['attribute_id', 'attribute_name', 'attribute_data_type'], 'catalogs': ['catalog_id', 'catalog_name', 'catalog_publisher', 'date_of_publication', 'date_of_latest_revision'], 'catalog_structure': ['catalog_level_number', 'catalog_id', 'catalog_level_name'], 'catalog_contents': ['catalog_entry_id', 'catalog_level_number', 'parent_entry_id', 'previous_entry_id', 'next_entry_id', 'catalog_entry_name', 'product_stock_number', 'price_in_dollars', 'price_in_euros', 'price_in_pounds', 'capacity', 'length', 'height', 'width'], 'catalog_contents_additional_attributes': ['catalog_entry_id', 'catalog_level_number', 'attribute_id', 'attribute_value'] }
{ 'catalog_contents': ['catalog_entry_id', 'next_entry_id', 'catalog_entry_name'] }
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), )
TABLE Catalog_Contents ( Catalog_Contents.catalog_entry_id (INTEGER), Catalog_Contents.catalog_level_number (INTEGER), Catalog_Contents.parent_entry_id (INTEGER), Catalog_Contents.previous_entry_id (INTEGER), Catalog_Contents.next_entry_id (INTEGER), Catalog_Contents.catalog_entry_name (VARCHAR(80)), Catalog_Contents.product_stock_number (VARCHAR(50)), Catalog_Contents.price_in_dollars (DOUBLE), Catalog_Contents.price_in_euros (DOUBLE), Catalog_Contents.price_in_pounds (DOUBLE), Catalog_Contents.capacity (VARCHAR(20)), Catalog_Contents.length (VARCHAR(20)), Catalog_Contents.height (VARCHAR(20)), Catalog_Contents.width (VARCHAR(20)), ) Possible JOINs: Catalog_Contents.catalog_level_number = Catalog_Structure.catalog_level_number
flight_1
How many aircrafts do we have?
easy
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT count(*) FROM Aircraft
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'aircraft': ['aid'] }
TABLE aircraft ( aircraft.aid (number(9,0)), ) Possible JOINs:
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
flight_1
How many aircrafts exist in the database?
easy
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT count(*) FROM Aircraft
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'aircraft': ['aid'] }
TABLE aircraft ( aircraft.aid (number(9,0)), ) Possible JOINs:
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
flight_1
Show name and distance for all aircrafts.
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT name , distance FROM Aircraft
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'aircraft': ['aid', 'name', 'distance'] }
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
flight_1
What are the names and distances for all airplanes?
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT name , distance FROM Aircraft
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'aircraft': ['aid', 'name', 'distance'] }
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
flight_1
Show ids for all aircrafts with more than 1000 distance.
easy
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT aid FROM Aircraft WHERE distance > 1000
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'aircraft': ['aid', 'distance'] }
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.distance (number(6,0)), ) Possible JOINs:
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
flight_1
What are the ids of all aircrafts that can cover a distance of more than 1000?
easy
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT aid FROM Aircraft WHERE distance > 1000
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'aircraft': ['aid', 'distance'] }
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.distance (number(6,0)), ) Possible JOINs:
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
flight_1
How many aircrafts have distance between 1000 and 5000?
easy
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT count(*) FROM Aircraft WHERE distance BETWEEN 1000 AND 5000
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'aircraft': ['aid', 'distance'] }
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.distance (number(6,0)), ) Possible JOINs:
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
flight_1
What is the count of aircrafts that have a distance between 1000 and 5000?
easy
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT count(*) FROM Aircraft WHERE distance BETWEEN 1000 AND 5000
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'aircraft': ['aid', 'distance'] }
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.distance (number(6,0)), ) Possible JOINs:
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
flight_1
What is the name and distance for aircraft with id 12?
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT name , distance FROM Aircraft WHERE aid = 12
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'aircraft': ['aid', 'name', 'distance'] }
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
flight_1
What is the name and distance for the aircraft that has an id of 12?
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT name , distance FROM Aircraft WHERE aid = 12
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'aircraft': ['aid', 'name', 'distance'] }
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
flight_1
What is the minimum, average, and maximum distance of all aircrafts.
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT min(distance) , avg(distance) , max(distance) FROM Aircraft
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'aircraft': ['aid', 'distance'] }
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.distance (number(6,0)), ) Possible JOINs:
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
flight_1
Return the minimum, average and maximum distances traveled across all aircrafts.
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT min(distance) , avg(distance) , max(distance) FROM Aircraft
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'aircraft': ['aid', 'distance'] }
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.distance (number(6,0)), ) Possible JOINs:
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
flight_1
Show the id and name of the aircraft with the maximum distance.
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT aid , name FROM Aircraft ORDER BY distance DESC LIMIT 1
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'aircraft': ['aid', 'name', 'distance'] }
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
flight_1
What is the id and name of the aircraft that can cover the maximum distance?
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT aid , name FROM Aircraft ORDER BY distance DESC LIMIT 1
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'aircraft': ['aid', 'name', 'distance'] }
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
flight_1
Show the name of aircrafts with top three lowest distances.
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT name FROM Aircraft ORDER BY distance LIMIT 3
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'aircraft': ['aid', 'name', 'distance'] }
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
flight_1
What are the aircrafts with top 3 shortest lengthes? List their names.
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT name FROM Aircraft ORDER BY distance LIMIT 3
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'aircraft': ['aid', 'name', 'distance'] }
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
flight_1
Show names for all aircrafts with distances more than the average.
hard
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT name FROM Aircraft WHERE distance > (SELECT avg(distance) FROM Aircraft)
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'aircraft': ['aid', 'name', 'distance'] }
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
flight_1
What are the names of all aircrafts that can cover more distances than average?
hard
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT name FROM Aircraft WHERE distance > (SELECT avg(distance) FROM Aircraft)
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'aircraft': ['aid', 'name', 'distance'] }
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
TABLE aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Possible JOINs:
flight_1
How many employees do we have?
easy
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT count(*) FROM Employee
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'employee': ['eid'] }
TABLE employee ( employee.eid (number(9,0)), ) Possible JOINs:
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
flight_1
What is the number of employees?
easy
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT count(*) FROM Employee
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'employee': ['eid'] }
TABLE employee ( employee.eid (number(9,0)), ) Possible JOINs:
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
flight_1
Show name and salary for all employees sorted by salary.
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT name , salary FROM Employee ORDER BY salary
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'employee': ['eid', 'name', 'salary'] }
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
flight_1
What is the name and salary of all employees in order of salary?
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT name , salary FROM Employee ORDER BY salary
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'employee': ['eid', 'name', 'salary'] }
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
flight_1
Show ids for all employees with at least 100000 salary.
easy
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT eid FROM Employee WHERE salary > 100000
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'employee': ['eid', 'salary'] }
TABLE employee ( employee.eid (number(9,0)), employee.salary (number(10,2)), ) Possible JOINs:
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
flight_1
What is the id of every employee who has at least a salary of 100000?
easy
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT eid FROM Employee WHERE salary > 100000
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'employee': ['eid', 'salary'] }
TABLE employee ( employee.eid (number(9,0)), employee.salary (number(10,2)), ) Possible JOINs:
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
flight_1
How many employees have salary between 100000 and 200000?
easy
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT count(*) FROM Employee WHERE salary BETWEEN 100000 AND 200000
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'employee': ['eid', 'salary'] }
TABLE employee ( employee.eid (number(9,0)), employee.salary (number(10,2)), ) Possible JOINs:
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
flight_1
What is the number of employees that have a salary between 100000 and 200000?
easy
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT count(*) FROM Employee WHERE salary BETWEEN 100000 AND 200000
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'employee': ['eid', 'salary'] }
TABLE employee ( employee.eid (number(9,0)), employee.salary (number(10,2)), ) Possible JOINs:
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
flight_1
What is the name and salary for employee with id 242518965?
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT name , salary FROM Employee WHERE eid = 242518965
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'employee': ['eid', 'name', 'salary'] }
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
flight_1
What is the name and salary of the employee with the id 242518965?
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT name , salary FROM Employee WHERE eid = 242518965
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'employee': ['eid', 'name', 'salary'] }
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
flight_1
What is average and maximum salary of all employees.
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT avg(salary) , max(salary) FROM Employee
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'employee': ['eid', 'salary'] }
TABLE employee ( employee.eid (number(9,0)), employee.salary (number(10,2)), ) Possible JOINs:
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
flight_1
What is the average and largest salary of all employees?
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT avg(salary) , max(salary) FROM Employee
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'employee': ['eid', 'salary'] }
TABLE employee ( employee.eid (number(9,0)), employee.salary (number(10,2)), ) Possible JOINs:
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
flight_1
Show the id and name of the employee with maximum salary.
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT eid , name FROM Employee ORDER BY salary DESC LIMIT 1
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'employee': ['eid', 'name', 'salary'] }
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
flight_1
What is the id and name of the employee with the highest salary?
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT eid , name FROM Employee ORDER BY salary DESC LIMIT 1
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'employee': ['eid', 'name', 'salary'] }
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
flight_1
Show the name of employees with three lowest salaries.
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT name FROM Employee ORDER BY salary ASC LIMIT 3
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'employee': ['eid', 'name', 'salary'] }
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
flight_1
What is the name of the 3 employees who get paid the least?
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT name FROM Employee ORDER BY salary ASC LIMIT 3
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'employee': ['eid', 'name', 'salary'] }
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
flight_1
Show names for all employees with salary more than the average.
hard
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT name FROM Employee WHERE salary > (SELECT avg(salary) FROM Employee)
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'employee': ['eid', 'name', 'salary'] }
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
flight_1
What are the names of all employees who have a salary higher than average?
hard
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT name FROM Employee WHERE salary > (SELECT avg(salary) FROM Employee)
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'employee': ['eid', 'name', 'salary'] }
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
flight_1
Show the id and salary of Mark Young.
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT eid , salary FROM Employee WHERE name = 'Mark Young'
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'employee': ['eid', 'name', 'salary'] }
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
flight_1
What is the id and salary of the employee named Mark Young?
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT eid , salary FROM Employee WHERE name = 'Mark Young'
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'employee': ['eid', 'name', 'salary'] }
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
TABLE employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Possible JOINs:
flight_1
How many flights do we have?
easy
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT count(*) FROM Flight
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'flight': ['flno'] }
TABLE flight ( flight.flno (number(4,0)), )
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: flight.aid = aircraft.aid
flight_1
What is the number of flights?
easy
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT count(*) FROM Flight
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'flight': ['flno'] }
TABLE flight ( flight.flno (number(4,0)), )
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: flight.aid = aircraft.aid
flight_1
Show flight number, origin, destination of all flights in the alphabetical order of the departure cities.
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT flno , origin , destination FROM Flight ORDER BY origin
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'flight': ['flno', 'origin', 'destination'] }
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), )
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: flight.aid = aircraft.aid
flight_1
What is the flight number, origin, and destination for all flights in alphabetical order by departure cities?
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT flno , origin , destination FROM Flight ORDER BY origin
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'flight': ['flno', 'origin', 'destination'] }
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), )
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: flight.aid = aircraft.aid
flight_1
Show all flight number from Los Angeles.
easy
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT flno FROM Flight WHERE origin = "Los Angeles"
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'flight': ['flno', 'origin'] }
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), )
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: flight.aid = aircraft.aid
flight_1
What are the numbers of all flights coming from Los Angeles?
easy
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT flno FROM Flight WHERE origin = "Los Angeles"
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'flight': ['flno', 'origin'] }
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), )
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: flight.aid = aircraft.aid
flight_1
Show origins of all flights with destination Honolulu.
easy
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT origin FROM Flight WHERE destination = "Honolulu"
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'flight': ['flno', 'origin', 'destination'] }
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), )
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: flight.aid = aircraft.aid
flight_1
What are the origins of all flights that are headed to Honolulu?
easy
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT origin FROM Flight WHERE destination = "Honolulu"
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'flight': ['flno', 'origin', 'destination'] }
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), )
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: flight.aid = aircraft.aid
flight_1
Show me the departure date and arrival date for all flights from Los Angeles to Honolulu.
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT departure_date , arrival_date FROM Flight WHERE origin = "Los Angeles" AND destination = "Honolulu"
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'flight': ['flno', 'origin', 'destination', 'departure_date', 'arrival_date'] }
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.departure_date (date), flight.arrival_date (date), )
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: flight.aid = aircraft.aid
flight_1
What are the departure and arrival dates of all flights from LA to Honolulu?
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT departure_date , arrival_date FROM Flight WHERE origin = "Los Angeles" AND destination = "Honolulu"
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'flight': ['flno', 'origin', 'destination', 'departure_date', 'arrival_date'] }
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.departure_date (date), flight.arrival_date (date), )
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: flight.aid = aircraft.aid
flight_1
Show flight number for all flights with more than 2000 distance.
easy
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT flno FROM Flight WHERE distance > 2000
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'flight': ['flno', 'distance'] }
TABLE flight ( flight.flno (number(4,0)), flight.distance (number(6,0)), )
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: flight.aid = aircraft.aid
flight_1
What are the numbers of all flights that can cover a distance of more than 2000?
easy
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT flno FROM Flight WHERE distance > 2000
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'flight': ['flno', 'distance'] }
TABLE flight ( flight.flno (number(4,0)), flight.distance (number(6,0)), )
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: flight.aid = aircraft.aid
flight_1
What is the average price for flights from Los Angeles to Honolulu.
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT avg(price) FROM Flight WHERE origin = "Los Angeles" AND destination = "Honolulu"
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'flight': ['flno', 'origin', 'destination', 'price'] }
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.price (number(7,2)), )
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: flight.aid = aircraft.aid
flight_1
What is the average price for flights from LA to Honolulu?
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT avg(price) FROM Flight WHERE origin = "Los Angeles" AND destination = "Honolulu"
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'flight': ['flno', 'origin', 'destination', 'price'] }
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.price (number(7,2)), )
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: flight.aid = aircraft.aid
flight_1
Show origin and destination for flights with price higher than 300.
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT origin , destination FROM Flight WHERE price > 300
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'flight': ['flno', 'origin', 'destination', 'price'] }
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.price (number(7,2)), )
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: flight.aid = aircraft.aid
flight_1
What is the origin and destination for all flights whose price is higher than 300?
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT origin , destination FROM Flight WHERE price > 300
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'flight': ['flno', 'origin', 'destination', 'price'] }
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.price (number(7,2)), )
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: flight.aid = aircraft.aid
flight_1
Show the flight number and distance of the flight with maximum price.
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT flno , distance FROM Flight ORDER BY price DESC LIMIT 1
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'flight': ['flno', 'distance', 'price'] }
TABLE flight ( flight.flno (number(4,0)), flight.distance (number(6,0)), flight.price (number(7,2)), )
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: flight.aid = aircraft.aid
flight_1
What is the flight number and its distance for the one with the maximum price?
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT flno , distance FROM Flight ORDER BY price DESC LIMIT 1
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'flight': ['flno', 'distance', 'price'] }
TABLE flight ( flight.flno (number(4,0)), flight.distance (number(6,0)), flight.price (number(7,2)), )
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: flight.aid = aircraft.aid
flight_1
Show the flight number of flights with three lowest distances.
medium
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
SELECT flno FROM Flight ORDER BY distance ASC LIMIT 3
Table aircraft ( aircraft.aid (number(9,0)), aircraft.name (varchar2(30)), aircraft.distance (number(6,0)), ) Table certificate ( certificate.eid (number(9,0)), certificate.aid (number(9,0)), ) Table employee ( employee.eid (number(9,0)), employee.name (varchar2(30)), employee.salary (number(10,2)), ) Table flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: certificate.eid = employee.eid certificate.aid = aircraft.aid flight.aid = aircraft.aid
{ 'flight': ['flno', 'origin', 'destination', 'distance', 'departure_date', 'arrival_date', 'price', 'aid'], 'aircraft': ['aid', 'name', 'distance'], 'employee': ['eid', 'name', 'salary'], 'certificate': ['eid', 'aid'] }
{ 'flight': ['flno', 'distance'] }
TABLE flight ( flight.flno (number(4,0)), flight.distance (number(6,0)), )
TABLE flight ( flight.flno (number(4,0)), flight.origin (varchar2(20)), flight.destination (varchar2(20)), flight.distance (number(6,0)), flight.departure_date (date), flight.arrival_date (date), flight.price (number(7,2)), flight.aid (number(9,0)), ) Possible JOINs: flight.aid = aircraft.aid