db_id
stringclasses
20 values
query
stringlengths
25
323
question
stringlengths
22
144
create_w_keys
stringclasses
20 values
create_wo_keys
stringclasses
20 values
difficulty
stringclasses
4 values
zero_shot_request
stringlengths
527
3.29k
singer
SELECT Name FROM singer WHERE Birth_Year = 1948 OR Birth_Year = 1949
Show the name of singers whose birth year is either 1948 or 1949?
CREATE TABLE "singer" ( "Singer_ID" int, "Name" text, "Birth_Year" real, "Net_Worth_Millions" real, "Citizenship" text, PRIMARY KEY ("Singer_ID") ); CREATE TABLE "song" ( "Song_ID" int, "Title" text, "Singer_ID" int, "Sales" real, "Highest_Position" real, PRIMARY KEY ("Song_ID"), FOREIGN KEY ("Singer_ID") REFERENCES `singer`("Singer_ID") );
CREATE TABLE singer (Singer_ID INT, Name TEXT, Birth_Year REAL, Net_Worth_Millions REAL, Citizenship TEXT); CREATE TABLE song (Song_ID INT, Title TEXT, Singer_ID INT, Sales REAL, Highest_Position REAL);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "singer" ( "Singer_ID" int, "Name" text, "Birth_Year" real, "Net_Worth_Millions" real, "Citizenship" text, PRIMARY KEY ("Singer_ID") ); CREATE TABLE "song" ( "Song_ID" int, "Title" text, "Singer_ID" int, "Sales" real, "Highest_Position" real, PRIMARY KEY ("Song_ID"), FOREIGN KEY ("Singer_ID") REFERENCES `singer`("Singer_ID") ); QUESTION: Show the name of singers whose birth year is either 1948 or 1949?
singer
SELECT Name FROM singer ORDER BY Net_Worth_Millions DESC LIMIT 1
What is the name of the singer with the largest net worth?
CREATE TABLE "singer" ( "Singer_ID" int, "Name" text, "Birth_Year" real, "Net_Worth_Millions" real, "Citizenship" text, PRIMARY KEY ("Singer_ID") ); CREATE TABLE "song" ( "Song_ID" int, "Title" text, "Singer_ID" int, "Sales" real, "Highest_Position" real, PRIMARY KEY ("Song_ID"), FOREIGN KEY ("Singer_ID") REFERENCES `singer`("Singer_ID") );
CREATE TABLE singer (Singer_ID INT, Name TEXT, Birth_Year REAL, Net_Worth_Millions REAL, Citizenship TEXT); CREATE TABLE song (Song_ID INT, Title TEXT, Singer_ID INT, Sales REAL, Highest_Position REAL);
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "singer" ( "Singer_ID" int, "Name" text, "Birth_Year" real, "Net_Worth_Millions" real, "Citizenship" text, PRIMARY KEY ("Singer_ID") ); CREATE TABLE "song" ( "Song_ID" int, "Title" text, "Singer_ID" int, "Sales" real, "Highest_Position" real, PRIMARY KEY ("Song_ID"), FOREIGN KEY ("Singer_ID") REFERENCES `singer`("Singer_ID") ); QUESTION: What is the name of the singer with the largest net worth?
singer
SELECT Citizenship FROM singer GROUP BY Citizenship ORDER BY COUNT(*) DESC LIMIT 1
Please show the most common citizenship of singers.
CREATE TABLE "singer" ( "Singer_ID" int, "Name" text, "Birth_Year" real, "Net_Worth_Millions" real, "Citizenship" text, PRIMARY KEY ("Singer_ID") ); CREATE TABLE "song" ( "Song_ID" int, "Title" text, "Singer_ID" int, "Sales" real, "Highest_Position" real, PRIMARY KEY ("Song_ID"), FOREIGN KEY ("Singer_ID") REFERENCES `singer`("Singer_ID") );
CREATE TABLE singer (Singer_ID INT, Name TEXT, Birth_Year REAL, Net_Worth_Millions REAL, Citizenship TEXT); CREATE TABLE song (Song_ID INT, Title TEXT, Singer_ID INT, Sales REAL, Highest_Position REAL);
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "singer" ( "Singer_ID" int, "Name" text, "Birth_Year" real, "Net_Worth_Millions" real, "Citizenship" text, PRIMARY KEY ("Singer_ID") ); CREATE TABLE "song" ( "Song_ID" int, "Title" text, "Singer_ID" int, "Sales" real, "Highest_Position" real, PRIMARY KEY ("Song_ID"), FOREIGN KEY ("Singer_ID") REFERENCES `singer`("Singer_ID") ); QUESTION: Please show the most common citizenship of singers.
singer
select citizenship from singer group by citizenship order by count(*) desc limit 1
What is the most common singer citizenship ?
CREATE TABLE "singer" ( "Singer_ID" int, "Name" text, "Birth_Year" real, "Net_Worth_Millions" real, "Citizenship" text, PRIMARY KEY ("Singer_ID") ); CREATE TABLE "song" ( "Song_ID" int, "Title" text, "Singer_ID" int, "Sales" real, "Highest_Position" real, PRIMARY KEY ("Song_ID"), FOREIGN KEY ("Singer_ID") REFERENCES `singer`("Singer_ID") );
CREATE TABLE singer (Singer_ID INT, Name TEXT, Birth_Year REAL, Net_Worth_Millions REAL, Citizenship TEXT); CREATE TABLE song (Song_ID INT, Title TEXT, Singer_ID INT, Sales REAL, Highest_Position REAL);
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "singer" ( "Singer_ID" int, "Name" text, "Birth_Year" real, "Net_Worth_Millions" real, "Citizenship" text, PRIMARY KEY ("Singer_ID") ); CREATE TABLE "song" ( "Song_ID" int, "Title" text, "Singer_ID" int, "Sales" real, "Highest_Position" real, PRIMARY KEY ("Song_ID"), FOREIGN KEY ("Singer_ID") REFERENCES `singer`("Singer_ID") ); QUESTION: What is the most common singer citizenship ?
singer
SELECT Name FROM singer WHERE Singer_ID NOT IN (SELECT Singer_ID FROM song)
List the name of singers that do not have any song.
CREATE TABLE "singer" ( "Singer_ID" int, "Name" text, "Birth_Year" real, "Net_Worth_Millions" real, "Citizenship" text, PRIMARY KEY ("Singer_ID") ); CREATE TABLE "song" ( "Song_ID" int, "Title" text, "Singer_ID" int, "Sales" real, "Highest_Position" real, PRIMARY KEY ("Song_ID"), FOREIGN KEY ("Singer_ID") REFERENCES `singer`("Singer_ID") );
CREATE TABLE singer (Singer_ID INT, Name TEXT, Birth_Year REAL, Net_Worth_Millions REAL, Citizenship TEXT); CREATE TABLE song (Song_ID INT, Title TEXT, Singer_ID INT, Sales REAL, Highest_Position REAL);
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "singer" ( "Singer_ID" int, "Name" text, "Birth_Year" real, "Net_Worth_Millions" real, "Citizenship" text, PRIMARY KEY ("Singer_ID") ); CREATE TABLE "song" ( "Song_ID" int, "Title" text, "Singer_ID" int, "Sales" real, "Highest_Position" real, PRIMARY KEY ("Song_ID"), FOREIGN KEY ("Singer_ID") REFERENCES `singer`("Singer_ID") ); QUESTION: List the name of singers that do not have any song.
real_estate_properties
SELECT count(*) FROM Other_Available_Features
How many available features are there in total?
CREATE TABLE `Ref_Feature_Types` ( `feature_type_code` VARCHAR(20) PRIMARY KEY, `feature_type_name` VARCHAR(80) ); CREATE TABLE `Ref_Property_Types` ( `property_type_code` VARCHAR(20) PRIMARY KEY, `property_type_description` VARCHAR(80) ); CREATE TABLE `Other_Available_Features` ( `feature_id` INTEGER PRIMARY KEY, `feature_type_code` VARCHAR(20) NOT NULL, `feature_name` VARCHAR(80), `feature_description` VARCHAR(80), FOREIGN KEY (`feature_type_code` ) REFERENCES `Ref_Feature_Types`(`feature_type_code` ) ); CREATE TABLE `Properties` ( `property_id` INTEGER PRIMARY KEY, `property_type_code` VARCHAR(20) NOT NULL, `date_on_market` DATETIME, `date_sold` DATETIME, `property_name` VARCHAR(80), `property_address` VARCHAR(255), `room_count` INTEGER, `vendor_requested_price` DECIMAL(19,4), `buyer_offered_price` DECIMAL(19,4), `agreed_selling_price` DECIMAL(19,4), `apt_feature_1` VARCHAR(255), `apt_feature_2` VARCHAR(255), `apt_feature_3` VARCHAR(255), `fld_feature_1` VARCHAR(255), `fld_feature_2` VARCHAR(255), `fld_feature_3` VARCHAR(255), `hse_feature_1` VARCHAR(255), `hse_feature_2` VARCHAR(255), `hse_feature_3` VARCHAR(255), `oth_feature_1` VARCHAR(255), `oth_feature_2` VARCHAR(255), `oth_feature_3` VARCHAR(255), `shp_feature_1` VARCHAR(255), `shp_feature_2` VARCHAR(255), `shp_feature_3` VARCHAR(255), `other_property_details` VARCHAR(255), FOREIGN KEY (`property_type_code` ) REFERENCES `Ref_Property_Types`(`property_type_code` ) ); CREATE TABLE `Other_Property_Features` ( `property_id` INTEGER NOT NULL, `feature_id` INTEGER NOT NULL, `property_feature_description` VARCHAR(80), FOREIGN KEY (`feature_id` ) REFERENCES `Other_Available_Features`(`feature_id` ), FOREIGN KEY (`property_id` ) REFERENCES `Properties`(`property_id` ) );
CREATE TABLE Ref_Feature_Types (feature_type_code VARCHAR(20), feature_type_name VARCHAR(80)); CREATE TABLE Ref_Property_Types (property_type_code VARCHAR(20), property_type_description VARCHAR(80)); CREATE TABLE Other_Available_Features (feature_id INTEGER, feature_type_code VARCHAR(20), feature_name VARCHAR(80), feature_description VARCHAR(80)); CREATE TABLE Properties (property_id INTEGER, property_type_code VARCHAR(20), date_on_market DATETIME, date_sold DATETIME, property_name VARCHAR(80), property_address VARCHAR(255), room_count INTEGER, vendor_requested_price DECIMAL(19,4), buyer_offered_price DECIMAL(19,4), agreed_selling_price DECIMAL(19,4), apt_feature_1 VARCHAR(255), apt_feature_2 VARCHAR(255), apt_feature_3 VARCHAR(255), fld_feature_1 VARCHAR(255), fld_feature_2 VARCHAR(255), fld_feature_3 VARCHAR(255), hse_feature_1 VARCHAR(255), hse_feature_2 VARCHAR(255), hse_feature_3 VARCHAR(255), oth_feature_1 VARCHAR(255), oth_feature_2 VARCHAR(255), oth_feature_3 VARCHAR(255), shp_feature_1 VARCHAR(255), shp_feature_2 VARCHAR(255), shp_feature_3 VARCHAR(255), other_property_details VARCHAR(255)); CREATE TABLE Other_Property_Features (property_id INTEGER, feature_id INTEGER, property_feature_description VARCHAR(80));
easy
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE `Ref_Feature_Types` ( `feature_type_code` VARCHAR(20) PRIMARY KEY, `feature_type_name` VARCHAR(80) ); CREATE TABLE `Ref_Property_Types` ( `property_type_code` VARCHAR(20) PRIMARY KEY, `property_type_description` VARCHAR(80) ); CREATE TABLE `Other_Available_Features` ( `feature_id` INTEGER PRIMARY KEY, `feature_type_code` VARCHAR(20) NOT NULL, `feature_name` VARCHAR(80), `feature_description` VARCHAR(80), FOREIGN KEY (`feature_type_code` ) REFERENCES `Ref_Feature_Types`(`feature_type_code` ) ); CREATE TABLE `Properties` ( `property_id` INTEGER PRIMARY KEY, `property_type_code` VARCHAR(20) NOT NULL, `date_on_market` DATETIME, `date_sold` DATETIME, `property_name` VARCHAR(80), `property_address` VARCHAR(255), `room_count` INTEGER, `vendor_requested_price` DECIMAL(19,4), `buyer_offered_price` DECIMAL(19,4), `agreed_selling_price` DECIMAL(19,4), `apt_feature_1` VARCHAR(255), `apt_feature_2` VARCHAR(255), `apt_feature_3` VARCHAR(255), `fld_feature_1` VARCHAR(255), `fld_feature_2` VARCHAR(255), `fld_feature_3` VARCHAR(255), `hse_feature_1` VARCHAR(255), `hse_feature_2` VARCHAR(255), `hse_feature_3` VARCHAR(255), `oth_feature_1` VARCHAR(255), `oth_feature_2` VARCHAR(255), `oth_feature_3` VARCHAR(255), `shp_feature_1` VARCHAR(255), `shp_feature_2` VARCHAR(255), `shp_feature_3` VARCHAR(255), `other_property_details` VARCHAR(255), FOREIGN KEY (`property_type_code` ) REFERENCES `Ref_Property_Types`(`property_type_code` ) ); CREATE TABLE `Other_Property_Features` ( `property_id` INTEGER NOT NULL, `feature_id` INTEGER NOT NULL, `property_feature_description` VARCHAR(80), FOREIGN KEY (`feature_id` ) REFERENCES `Other_Available_Features`(`feature_id` ), FOREIGN KEY (`property_id` ) REFERENCES `Properties`(`property_id` ) ); QUESTION: How many available features are there in total?
real_estate_properties
SELECT T2.feature_type_name FROM Other_Available_Features AS T1 JOIN Ref_Feature_Types AS T2 ON T1.feature_type_code = T2.feature_type_code WHERE T1.feature_name = "AirCon"
What is the feature type name of feature AirCon?
CREATE TABLE `Ref_Feature_Types` ( `feature_type_code` VARCHAR(20) PRIMARY KEY, `feature_type_name` VARCHAR(80) ); CREATE TABLE `Ref_Property_Types` ( `property_type_code` VARCHAR(20) PRIMARY KEY, `property_type_description` VARCHAR(80) ); CREATE TABLE `Other_Available_Features` ( `feature_id` INTEGER PRIMARY KEY, `feature_type_code` VARCHAR(20) NOT NULL, `feature_name` VARCHAR(80), `feature_description` VARCHAR(80), FOREIGN KEY (`feature_type_code` ) REFERENCES `Ref_Feature_Types`(`feature_type_code` ) ); CREATE TABLE `Properties` ( `property_id` INTEGER PRIMARY KEY, `property_type_code` VARCHAR(20) NOT NULL, `date_on_market` DATETIME, `date_sold` DATETIME, `property_name` VARCHAR(80), `property_address` VARCHAR(255), `room_count` INTEGER, `vendor_requested_price` DECIMAL(19,4), `buyer_offered_price` DECIMAL(19,4), `agreed_selling_price` DECIMAL(19,4), `apt_feature_1` VARCHAR(255), `apt_feature_2` VARCHAR(255), `apt_feature_3` VARCHAR(255), `fld_feature_1` VARCHAR(255), `fld_feature_2` VARCHAR(255), `fld_feature_3` VARCHAR(255), `hse_feature_1` VARCHAR(255), `hse_feature_2` VARCHAR(255), `hse_feature_3` VARCHAR(255), `oth_feature_1` VARCHAR(255), `oth_feature_2` VARCHAR(255), `oth_feature_3` VARCHAR(255), `shp_feature_1` VARCHAR(255), `shp_feature_2` VARCHAR(255), `shp_feature_3` VARCHAR(255), `other_property_details` VARCHAR(255), FOREIGN KEY (`property_type_code` ) REFERENCES `Ref_Property_Types`(`property_type_code` ) ); CREATE TABLE `Other_Property_Features` ( `property_id` INTEGER NOT NULL, `feature_id` INTEGER NOT NULL, `property_feature_description` VARCHAR(80), FOREIGN KEY (`feature_id` ) REFERENCES `Other_Available_Features`(`feature_id` ), FOREIGN KEY (`property_id` ) REFERENCES `Properties`(`property_id` ) );
CREATE TABLE Ref_Feature_Types (feature_type_code VARCHAR(20), feature_type_name VARCHAR(80)); CREATE TABLE Ref_Property_Types (property_type_code VARCHAR(20), property_type_description VARCHAR(80)); CREATE TABLE Other_Available_Features (feature_id INTEGER, feature_type_code VARCHAR(20), feature_name VARCHAR(80), feature_description VARCHAR(80)); CREATE TABLE Properties (property_id INTEGER, property_type_code VARCHAR(20), date_on_market DATETIME, date_sold DATETIME, property_name VARCHAR(80), property_address VARCHAR(255), room_count INTEGER, vendor_requested_price DECIMAL(19,4), buyer_offered_price DECIMAL(19,4), agreed_selling_price DECIMAL(19,4), apt_feature_1 VARCHAR(255), apt_feature_2 VARCHAR(255), apt_feature_3 VARCHAR(255), fld_feature_1 VARCHAR(255), fld_feature_2 VARCHAR(255), fld_feature_3 VARCHAR(255), hse_feature_1 VARCHAR(255), hse_feature_2 VARCHAR(255), hse_feature_3 VARCHAR(255), oth_feature_1 VARCHAR(255), oth_feature_2 VARCHAR(255), oth_feature_3 VARCHAR(255), shp_feature_1 VARCHAR(255), shp_feature_2 VARCHAR(255), shp_feature_3 VARCHAR(255), other_property_details VARCHAR(255)); CREATE TABLE Other_Property_Features (property_id INTEGER, feature_id INTEGER, property_feature_description VARCHAR(80));
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE `Ref_Feature_Types` ( `feature_type_code` VARCHAR(20) PRIMARY KEY, `feature_type_name` VARCHAR(80) ); CREATE TABLE `Ref_Property_Types` ( `property_type_code` VARCHAR(20) PRIMARY KEY, `property_type_description` VARCHAR(80) ); CREATE TABLE `Other_Available_Features` ( `feature_id` INTEGER PRIMARY KEY, `feature_type_code` VARCHAR(20) NOT NULL, `feature_name` VARCHAR(80), `feature_description` VARCHAR(80), FOREIGN KEY (`feature_type_code` ) REFERENCES `Ref_Feature_Types`(`feature_type_code` ) ); CREATE TABLE `Properties` ( `property_id` INTEGER PRIMARY KEY, `property_type_code` VARCHAR(20) NOT NULL, `date_on_market` DATETIME, `date_sold` DATETIME, `property_name` VARCHAR(80), `property_address` VARCHAR(255), `room_count` INTEGER, `vendor_requested_price` DECIMAL(19,4), `buyer_offered_price` DECIMAL(19,4), `agreed_selling_price` DECIMAL(19,4), `apt_feature_1` VARCHAR(255), `apt_feature_2` VARCHAR(255), `apt_feature_3` VARCHAR(255), `fld_feature_1` VARCHAR(255), `fld_feature_2` VARCHAR(255), `fld_feature_3` VARCHAR(255), `hse_feature_1` VARCHAR(255), `hse_feature_2` VARCHAR(255), `hse_feature_3` VARCHAR(255), `oth_feature_1` VARCHAR(255), `oth_feature_2` VARCHAR(255), `oth_feature_3` VARCHAR(255), `shp_feature_1` VARCHAR(255), `shp_feature_2` VARCHAR(255), `shp_feature_3` VARCHAR(255), `other_property_details` VARCHAR(255), FOREIGN KEY (`property_type_code` ) REFERENCES `Ref_Property_Types`(`property_type_code` ) ); CREATE TABLE `Other_Property_Features` ( `property_id` INTEGER NOT NULL, `feature_id` INTEGER NOT NULL, `property_feature_description` VARCHAR(80), FOREIGN KEY (`feature_id` ) REFERENCES `Other_Available_Features`(`feature_id` ), FOREIGN KEY (`property_id` ) REFERENCES `Properties`(`property_id` ) ); QUESTION: What is the feature type name of feature AirCon?
real_estate_properties
SELECT T2.property_type_description FROM Properties AS T1 JOIN Ref_Property_Types AS T2 ON T1.property_type_code = T2.property_type_code GROUP BY T1.property_type_code
Show the property type descriptions of properties belonging to that code.
CREATE TABLE `Ref_Feature_Types` ( `feature_type_code` VARCHAR(20) PRIMARY KEY, `feature_type_name` VARCHAR(80) ); CREATE TABLE `Ref_Property_Types` ( `property_type_code` VARCHAR(20) PRIMARY KEY, `property_type_description` VARCHAR(80) ); CREATE TABLE `Other_Available_Features` ( `feature_id` INTEGER PRIMARY KEY, `feature_type_code` VARCHAR(20) NOT NULL, `feature_name` VARCHAR(80), `feature_description` VARCHAR(80), FOREIGN KEY (`feature_type_code` ) REFERENCES `Ref_Feature_Types`(`feature_type_code` ) ); CREATE TABLE `Properties` ( `property_id` INTEGER PRIMARY KEY, `property_type_code` VARCHAR(20) NOT NULL, `date_on_market` DATETIME, `date_sold` DATETIME, `property_name` VARCHAR(80), `property_address` VARCHAR(255), `room_count` INTEGER, `vendor_requested_price` DECIMAL(19,4), `buyer_offered_price` DECIMAL(19,4), `agreed_selling_price` DECIMAL(19,4), `apt_feature_1` VARCHAR(255), `apt_feature_2` VARCHAR(255), `apt_feature_3` VARCHAR(255), `fld_feature_1` VARCHAR(255), `fld_feature_2` VARCHAR(255), `fld_feature_3` VARCHAR(255), `hse_feature_1` VARCHAR(255), `hse_feature_2` VARCHAR(255), `hse_feature_3` VARCHAR(255), `oth_feature_1` VARCHAR(255), `oth_feature_2` VARCHAR(255), `oth_feature_3` VARCHAR(255), `shp_feature_1` VARCHAR(255), `shp_feature_2` VARCHAR(255), `shp_feature_3` VARCHAR(255), `other_property_details` VARCHAR(255), FOREIGN KEY (`property_type_code` ) REFERENCES `Ref_Property_Types`(`property_type_code` ) ); CREATE TABLE `Other_Property_Features` ( `property_id` INTEGER NOT NULL, `feature_id` INTEGER NOT NULL, `property_feature_description` VARCHAR(80), FOREIGN KEY (`feature_id` ) REFERENCES `Other_Available_Features`(`feature_id` ), FOREIGN KEY (`property_id` ) REFERENCES `Properties`(`property_id` ) );
CREATE TABLE Ref_Feature_Types (feature_type_code VARCHAR(20), feature_type_name VARCHAR(80)); CREATE TABLE Ref_Property_Types (property_type_code VARCHAR(20), property_type_description VARCHAR(80)); CREATE TABLE Other_Available_Features (feature_id INTEGER, feature_type_code VARCHAR(20), feature_name VARCHAR(80), feature_description VARCHAR(80)); CREATE TABLE Properties (property_id INTEGER, property_type_code VARCHAR(20), date_on_market DATETIME, date_sold DATETIME, property_name VARCHAR(80), property_address VARCHAR(255), room_count INTEGER, vendor_requested_price DECIMAL(19,4), buyer_offered_price DECIMAL(19,4), agreed_selling_price DECIMAL(19,4), apt_feature_1 VARCHAR(255), apt_feature_2 VARCHAR(255), apt_feature_3 VARCHAR(255), fld_feature_1 VARCHAR(255), fld_feature_2 VARCHAR(255), fld_feature_3 VARCHAR(255), hse_feature_1 VARCHAR(255), hse_feature_2 VARCHAR(255), hse_feature_3 VARCHAR(255), oth_feature_1 VARCHAR(255), oth_feature_2 VARCHAR(255), oth_feature_3 VARCHAR(255), shp_feature_1 VARCHAR(255), shp_feature_2 VARCHAR(255), shp_feature_3 VARCHAR(255), other_property_details VARCHAR(255)); CREATE TABLE Other_Property_Features (property_id INTEGER, feature_id INTEGER, property_feature_description VARCHAR(80));
medium
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE `Ref_Feature_Types` ( `feature_type_code` VARCHAR(20) PRIMARY KEY, `feature_type_name` VARCHAR(80) ); CREATE TABLE `Ref_Property_Types` ( `property_type_code` VARCHAR(20) PRIMARY KEY, `property_type_description` VARCHAR(80) ); CREATE TABLE `Other_Available_Features` ( `feature_id` INTEGER PRIMARY KEY, `feature_type_code` VARCHAR(20) NOT NULL, `feature_name` VARCHAR(80), `feature_description` VARCHAR(80), FOREIGN KEY (`feature_type_code` ) REFERENCES `Ref_Feature_Types`(`feature_type_code` ) ); CREATE TABLE `Properties` ( `property_id` INTEGER PRIMARY KEY, `property_type_code` VARCHAR(20) NOT NULL, `date_on_market` DATETIME, `date_sold` DATETIME, `property_name` VARCHAR(80), `property_address` VARCHAR(255), `room_count` INTEGER, `vendor_requested_price` DECIMAL(19,4), `buyer_offered_price` DECIMAL(19,4), `agreed_selling_price` DECIMAL(19,4), `apt_feature_1` VARCHAR(255), `apt_feature_2` VARCHAR(255), `apt_feature_3` VARCHAR(255), `fld_feature_1` VARCHAR(255), `fld_feature_2` VARCHAR(255), `fld_feature_3` VARCHAR(255), `hse_feature_1` VARCHAR(255), `hse_feature_2` VARCHAR(255), `hse_feature_3` VARCHAR(255), `oth_feature_1` VARCHAR(255), `oth_feature_2` VARCHAR(255), `oth_feature_3` VARCHAR(255), `shp_feature_1` VARCHAR(255), `shp_feature_2` VARCHAR(255), `shp_feature_3` VARCHAR(255), `other_property_details` VARCHAR(255), FOREIGN KEY (`property_type_code` ) REFERENCES `Ref_Property_Types`(`property_type_code` ) ); CREATE TABLE `Other_Property_Features` ( `property_id` INTEGER NOT NULL, `feature_id` INTEGER NOT NULL, `property_feature_description` VARCHAR(80), FOREIGN KEY (`feature_id` ) REFERENCES `Other_Available_Features`(`feature_id` ), FOREIGN KEY (`property_id` ) REFERENCES `Properties`(`property_id` ) ); QUESTION: Show the property type descriptions of properties belonging to that code.
real_estate_properties
SELECT property_name FROM Properties WHERE property_type_code = "House" UNION SELECT property_name FROM Properties WHERE property_type_code = "Apartment" AND room_count > 1
What are the names of properties that are either houses or apartments with more than 1 room?
CREATE TABLE `Ref_Feature_Types` ( `feature_type_code` VARCHAR(20) PRIMARY KEY, `feature_type_name` VARCHAR(80) ); CREATE TABLE `Ref_Property_Types` ( `property_type_code` VARCHAR(20) PRIMARY KEY, `property_type_description` VARCHAR(80) ); CREATE TABLE `Other_Available_Features` ( `feature_id` INTEGER PRIMARY KEY, `feature_type_code` VARCHAR(20) NOT NULL, `feature_name` VARCHAR(80), `feature_description` VARCHAR(80), FOREIGN KEY (`feature_type_code` ) REFERENCES `Ref_Feature_Types`(`feature_type_code` ) ); CREATE TABLE `Properties` ( `property_id` INTEGER PRIMARY KEY, `property_type_code` VARCHAR(20) NOT NULL, `date_on_market` DATETIME, `date_sold` DATETIME, `property_name` VARCHAR(80), `property_address` VARCHAR(255), `room_count` INTEGER, `vendor_requested_price` DECIMAL(19,4), `buyer_offered_price` DECIMAL(19,4), `agreed_selling_price` DECIMAL(19,4), `apt_feature_1` VARCHAR(255), `apt_feature_2` VARCHAR(255), `apt_feature_3` VARCHAR(255), `fld_feature_1` VARCHAR(255), `fld_feature_2` VARCHAR(255), `fld_feature_3` VARCHAR(255), `hse_feature_1` VARCHAR(255), `hse_feature_2` VARCHAR(255), `hse_feature_3` VARCHAR(255), `oth_feature_1` VARCHAR(255), `oth_feature_2` VARCHAR(255), `oth_feature_3` VARCHAR(255), `shp_feature_1` VARCHAR(255), `shp_feature_2` VARCHAR(255), `shp_feature_3` VARCHAR(255), `other_property_details` VARCHAR(255), FOREIGN KEY (`property_type_code` ) REFERENCES `Ref_Property_Types`(`property_type_code` ) ); CREATE TABLE `Other_Property_Features` ( `property_id` INTEGER NOT NULL, `feature_id` INTEGER NOT NULL, `property_feature_description` VARCHAR(80), FOREIGN KEY (`feature_id` ) REFERENCES `Other_Available_Features`(`feature_id` ), FOREIGN KEY (`property_id` ) REFERENCES `Properties`(`property_id` ) );
CREATE TABLE Ref_Feature_Types (feature_type_code VARCHAR(20), feature_type_name VARCHAR(80)); CREATE TABLE Ref_Property_Types (property_type_code VARCHAR(20), property_type_description VARCHAR(80)); CREATE TABLE Other_Available_Features (feature_id INTEGER, feature_type_code VARCHAR(20), feature_name VARCHAR(80), feature_description VARCHAR(80)); CREATE TABLE Properties (property_id INTEGER, property_type_code VARCHAR(20), date_on_market DATETIME, date_sold DATETIME, property_name VARCHAR(80), property_address VARCHAR(255), room_count INTEGER, vendor_requested_price DECIMAL(19,4), buyer_offered_price DECIMAL(19,4), agreed_selling_price DECIMAL(19,4), apt_feature_1 VARCHAR(255), apt_feature_2 VARCHAR(255), apt_feature_3 VARCHAR(255), fld_feature_1 VARCHAR(255), fld_feature_2 VARCHAR(255), fld_feature_3 VARCHAR(255), hse_feature_1 VARCHAR(255), hse_feature_2 VARCHAR(255), hse_feature_3 VARCHAR(255), oth_feature_1 VARCHAR(255), oth_feature_2 VARCHAR(255), oth_feature_3 VARCHAR(255), shp_feature_1 VARCHAR(255), shp_feature_2 VARCHAR(255), shp_feature_3 VARCHAR(255), other_property_details VARCHAR(255)); CREATE TABLE Other_Property_Features (property_id INTEGER, feature_id INTEGER, property_feature_description VARCHAR(80));
hard
Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE `Ref_Feature_Types` ( `feature_type_code` VARCHAR(20) PRIMARY KEY, `feature_type_name` VARCHAR(80) ); CREATE TABLE `Ref_Property_Types` ( `property_type_code` VARCHAR(20) PRIMARY KEY, `property_type_description` VARCHAR(80) ); CREATE TABLE `Other_Available_Features` ( `feature_id` INTEGER PRIMARY KEY, `feature_type_code` VARCHAR(20) NOT NULL, `feature_name` VARCHAR(80), `feature_description` VARCHAR(80), FOREIGN KEY (`feature_type_code` ) REFERENCES `Ref_Feature_Types`(`feature_type_code` ) ); CREATE TABLE `Properties` ( `property_id` INTEGER PRIMARY KEY, `property_type_code` VARCHAR(20) NOT NULL, `date_on_market` DATETIME, `date_sold` DATETIME, `property_name` VARCHAR(80), `property_address` VARCHAR(255), `room_count` INTEGER, `vendor_requested_price` DECIMAL(19,4), `buyer_offered_price` DECIMAL(19,4), `agreed_selling_price` DECIMAL(19,4), `apt_feature_1` VARCHAR(255), `apt_feature_2` VARCHAR(255), `apt_feature_3` VARCHAR(255), `fld_feature_1` VARCHAR(255), `fld_feature_2` VARCHAR(255), `fld_feature_3` VARCHAR(255), `hse_feature_1` VARCHAR(255), `hse_feature_2` VARCHAR(255), `hse_feature_3` VARCHAR(255), `oth_feature_1` VARCHAR(255), `oth_feature_2` VARCHAR(255), `oth_feature_3` VARCHAR(255), `shp_feature_1` VARCHAR(255), `shp_feature_2` VARCHAR(255), `shp_feature_3` VARCHAR(255), `other_property_details` VARCHAR(255), FOREIGN KEY (`property_type_code` ) REFERENCES `Ref_Property_Types`(`property_type_code` ) ); CREATE TABLE `Other_Property_Features` ( `property_id` INTEGER NOT NULL, `feature_id` INTEGER NOT NULL, `property_feature_description` VARCHAR(80), FOREIGN KEY (`feature_id` ) REFERENCES `Other_Available_Features`(`feature_id` ), FOREIGN KEY (`property_id` ) REFERENCES `Properties`(`property_id` ) ); QUESTION: What are the names of properties that are either houses or apartments with more than 1 room?