instruction
stringlengths
1.07k
3.45k
output
stringlengths
19
508
system
stringclasses
1 value
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT building_short_name FROM apartment_buildings WHERE building_manager = "Emma";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT building_short_name FROM apartment_buildings WHERE building_manager = "Emma";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT building_address, building_phone FROM apartment_buildings WHERE building_manager = "Brenden";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT building_address, building_phone FROM apartment_buildings WHERE building_manager = "Brenden";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT building_full_name FROM apartment_buildings WHERE building_full_name LIKE "%court%";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT building_full_name FROM apartment_buildings WHERE building_full_name LIKE "%court%";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT min(bathroom_count), max(bathroom_count) FROM apartments;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT min(bathroom_count), max(bathroom_count) FROM apartments;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT avg(bedroom_count) FROM apartments;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT avg(bedroom_count) FROM apartments;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT apt_number, room_count FROM apartments;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT apt_number, room_count FROM apartments;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT avg(room_count) FROM apartments WHERE apt_type_code = "Studio";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT avg(room_count) FROM apartments WHERE apt_type_code = "Studio";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT apt_number FROM apartments WHERE apt_type_code = "Flat";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT apt_number FROM apartments WHERE apt_type_code = "Flat";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT guest_first_name, guest_last_name FROM guests;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT guest_first_name, guest_last_name FROM guests;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT date_of_birth FROM guests WHERE gender_code = "Male";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT date_of_birth FROM guests WHERE gender_code = "Male";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.apt_number, t1.booking_start_date, t1.booking_start_date FROM apartment_bookings AS t1 JOIN apartments AS t2 ON t1.apt_id = t2.apt_id;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.apt_number, t1.booking_start_date, t1.booking_start_date FROM apartment_bookings AS t1 JOIN apartments AS t2 ON t1.apt_id = t2.apt_id;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.booking_start_date, t1.booking_start_date FROM apartment_bookings AS t1 JOIN apartments AS t2 ON t1.apt_id = t2.apt_id WHERE t2.apt_type_code = "Duplex";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.booking_start_date, t1.booking_start_date FROM apartment_bookings AS t1 JOIN apartments AS t2 ON t1.apt_id = t2.apt_id WHERE t2.apt_type_code = "Duplex";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.booking_start_date, t1.booking_start_date FROM apartment_bookings AS t1 JOIN apartments AS t2 ON t1.apt_id = t2.apt_id WHERE t2.bedroom_count > 2;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.booking_start_date, t1.booking_start_date FROM apartment_bookings AS t1 JOIN apartments AS t2 ON t1.apt_id = t2.apt_id WHERE t2.bedroom_count > 2;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.booking_status_code FROM apartment_bookings AS t1 JOIN apartments AS t2 ON t1.apt_id = t2.apt_id WHERE t2.apt_number = "Suite 634";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.booking_status_code FROM apartment_bookings AS t1 JOIN apartments AS t2 ON t1.apt_id = t2.apt_id WHERE t2.apt_number = "Suite 634";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT DISTINCT t2.apt_number FROM apartment_bookings AS t1 JOIN apartments AS t2 ON t1.apt_id = t2.apt_id WHERE t1.booking_status_code = "Confirmed";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT DISTINCT t2.apt_number FROM apartment_bookings AS t1 JOIN apartments AS t2 ON t1.apt_id = t2.apt_id WHERE t1.booking_status_code = "Confirmed";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT avg(room_count) FROM apartment_bookings AS t1 JOIN apartments AS t2 ON t1.apt_id = t2.apt_id WHERE t1.booking_status_code = "Provisional";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT avg(room_count) FROM apartment_bookings AS t1 JOIN apartments AS t2 ON t1.apt_id = t2.apt_id WHERE t1.booking_status_code = "Provisional";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.guest_first_name, t1.booking_start_date, t1.booking_start_date FROM apartment_bookings AS t1 JOIN guests AS t2 ON t1.guest_id = t2.guest_id;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.guest_first_name, t1.booking_start_date, t1.booking_start_date FROM apartment_bookings AS t1 JOIN guests AS t2 ON t1.guest_id = t2.guest_id;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.booking_start_date, t1.booking_start_date FROM apartment_bookings AS t1 JOIN guests AS t2 ON t1.guest_id = t2.guest_id WHERE t2.gender_code = "Female";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.booking_start_date, t1.booking_start_date FROM apartment_bookings AS t1 JOIN guests AS t2 ON t1.guest_id = t2.guest_id WHERE t2.gender_code = "Female";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.guest_first_name, t2.guest_last_name FROM apartment_bookings AS t1 JOIN guests AS t2 ON t1.guest_id = t2.guest_id WHERE t1.booking_status_code = "Confirmed";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.guest_first_name, t2.guest_last_name FROM apartment_bookings AS t1 JOIN guests AS t2 ON t1.guest_id = t2.guest_id WHERE t1.booking_status_code = "Confirmed";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.facility_code FROM apartment_facilities AS t1 JOIN apartments AS t2 ON t1.apt_id = t2.apt_id WHERE t2.bedroom_count > 4;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.facility_code FROM apartment_facilities AS t1 JOIN apartments AS t2 ON t1.apt_id = t2.apt_id WHERE t2.bedroom_count > 4;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT sum(t2.room_count) FROM apartment_facilities AS t1 JOIN apartments AS t2 ON t1.apt_id = t2.apt_id WHERE t1.facility_code = "Gym";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT sum(t2.room_count) FROM apartment_facilities AS t1 JOIN apartments AS t2 ON t1.apt_id = t2.apt_id WHERE t1.facility_code = "Gym";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT sum(t2.room_count) FROM apartment_buildings AS t1 JOIN apartments AS t2 ON t1.building_id = t2.building_id WHERE t1.building_short_name = "Columbus Square";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT sum(t2.room_count) FROM apartment_buildings AS t1 JOIN apartments AS t2 ON t1.building_id = t2.building_id WHERE t1.building_short_name = "Columbus Square";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.building_address FROM apartment_buildings AS t1 JOIN apartments AS t2 ON t1.building_id = t2.building_id WHERE t2.bathroom_count > 2;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.building_address FROM apartment_buildings AS t1 JOIN apartments AS t2 ON t1.building_id = t2.building_id WHERE t2.bathroom_count > 2;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.apt_type_code, t2.apt_number FROM apartment_buildings AS t1 JOIN apartments AS t2 ON t1.building_id = t2.building_id WHERE t1.building_manager = "Kyle";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.apt_type_code, t2.apt_number FROM apartment_buildings AS t1 JOIN apartments AS t2 ON t1.building_id = t2.building_id WHERE t1.building_manager = "Kyle";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT booking_status_code, count(*) FROM apartment_bookings GROUP BY booking_status_code;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT booking_status_code, count(*) FROM apartment_bookings GROUP BY booking_status_code;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT apt_number FROM apartments ORDER BY room_count ASC;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT apt_number FROM apartments ORDER BY room_count ASC;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT apt_number FROM apartments ORDER BY bedroom_count DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT apt_number FROM apartments ORDER BY bedroom_count DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT apt_type_code, count(*) FROM apartments GROUP BY apt_type_code ORDER BY count(*) ASC;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT apt_type_code, count(*) FROM apartments GROUP BY apt_type_code ORDER BY count(*) ASC;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT apt_type_code FROM apartments GROUP BY apt_type_code ORDER BY avg(room_count) DESC LIMIT 3;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT apt_type_code FROM apartments GROUP BY apt_type_code ORDER BY avg(room_count) DESC LIMIT 3;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT apt_type_code, bathroom_count, bedroom_count FROM apartments GROUP BY apt_type_code ORDER BY sum(room_count) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT apt_type_code, bathroom_count, bedroom_count FROM apartments GROUP BY apt_type_code ORDER BY sum(room_count) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT apt_type_code FROM apartments GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT apt_type_code FROM apartments GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT apt_type_code FROM apartments WHERE bathroom_count > 1 GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT apt_type_code FROM apartments WHERE bathroom_count > 1 GROUP BY apt_type_code ORDER BY count(*) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT apt_type_code, max(room_count), min(room_count) FROM apartments GROUP BY apt_type_code;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT apt_type_code, max(room_count), min(room_count) FROM apartments GROUP BY apt_type_code;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT gender_code, count(*) FROM guests GROUP BY gender_code ORDER BY count(*) DESC;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT gender_code, count(*) FROM guests GROUP BY gender_code ORDER BY count(*) DESC;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM apartments WHERE apt_id NOT IN (SELECT apt_id FROM apartment_facilities);
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM apartments WHERE apt_id NOT IN (SELECT apt_id FROM apartment_facilities);
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.apt_number FROM apartment_bookings AS t1 JOIN apartments AS t2 ON t1.apt_id = t2.apt_id WHERE t1.booking_status_code = "Confirmed" INTERSECT SELECT t2.apt_number FROM apartment_bookings AS t1 JOIN apartments AS t2 ON t1.apt_id = t2.apt_id WHERE t1.booking_status_code = "Provisional";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.apt_number FROM apartment_bookings AS t1 JOIN apartments AS t2 ON t1.apt_id = t2.apt_id WHERE t1.booking_status_code = "Confirmed" INTERSECT SELECT t2.apt_number FROM apartment_bookings AS t1 JOIN apartments AS t2 ON t1.apt_id = t2.apt_id WHERE t1.booking_status_code = "Provisional";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.apt_number FROM apartments AS t1 JOIN view_unit_status AS t2 ON t1.apt_id = t2.apt_id WHERE t2.available_yn = 0 INTERSECT SELECT t1.apt_number FROM apartments AS t1 JOIN view_unit_status AS t2 ON t1.apt_id = t2.apt_id WHERE t2.available_yn = 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.apt_number FROM apartments AS t1 JOIN view_unit_status AS t2 ON t1.apt_id = t2.apt_id WHERE t2.available_yn = 0 INTERSECT SELECT t1.apt_number FROM apartments AS t1 JOIN view_unit_status AS t2 ON t1.apt_id = t2.apt_id WHERE t2.available_yn = 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM game WHERE season > 2007;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT Date FROM game ORDER BY home_team DESC;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT season, home_team, away_team FROM game;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT max(home_games), min(home_games), avg(home_games) FROM stadium;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT average_attendance FROM stadium WHERE capacity_percentage > 100;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT player, number_of_matches, SOURCE FROM injury_accident WHERE injury != 'Knee problem';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.season FROM game AS t1 JOIN injury_accident AS t2 ON t1.id = t2.game_id WHERE t2.player = 'Walter Samuel';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.id, t1.score, t1.date FROM game AS t1 JOIN injury_accident AS t2 ON t2.game_id = t1.id GROUP BY t1.id HAVING count(*) >= 2;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.id, t1.name FROM stadium AS t1 JOIN game AS t2 ON t1.id = t2.stadium_id JOIN injury_accident AS t3 ON t2.id = t3.game_id GROUP BY t1.id ORDER BY count(*) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.id, t1.name FROM stadium AS t1 JOIN game AS t2 ON t1.id = t2.stadium_id JOIN injury_accident AS t3 ON t2.id = t3.game_id GROUP BY t1.id ORDER BY count(*) DESC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.season, t2.name FROM game AS t1 JOIN stadium AS t2 ON t1.stadium_id = t2.id JOIN injury_accident AS t3 ON t1.id = t3.game_id WHERE t3.injury = 'Foot injury' OR t3.injury = 'Knee problem';
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(DISTINCT SOURCE) FROM injury_accident;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM game WHERE id NOT IN (SELECT game_id FROM injury_accident);
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(DISTINCT t1.injury) FROM injury_accident AS t1 JOIN game AS t2 ON t1.game_id = t2.id WHERE t2.season > 2010;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.name FROM game AS t1 JOIN stadium AS t2 ON t1.stadium_id = t2.id JOIN injury_accident AS t3 ON t1.id = t3.game_id WHERE t3.player = 'Walter Samuel' INTERSECT SELECT t2.name FROM game AS t1 JOIN stadium AS t2 ON t1.stadium_id = t2.id JOIN injury_accident AS t3 ON t1.id = t3.game_id WHERE t3.player = 'Thiago Mo...
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT name, average_attendance, total_attendance FROM stadium EXCEPT SELECT t2.name, t2.average_attendance, t2.total_attendance FROM game AS t1 JOIN stadium AS t2 ON t1.stadium_id = t2.id JOIN injury_accident AS t3 ON t1.id = t3.game_id;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT name FROM stadium WHERE name LIKE "%Bank%";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.id, count(*) FROM stadium AS t1 JOIN game AS t2 ON t1.id = t2.stadium_id GROUP BY t1.id;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.date, t2.player FROM game AS t1 JOIN injury_accident AS t2 ON t1.id = t2.game_id ORDER BY t1.season DESC;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.name, t2.name FROM country AS t1 JOIN league AS t2 ON t1.id = t2.country_id;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM country AS t1 JOIN league AS t2 ON t1.id = t2.country_id WHERE t1.name = "England";
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT avg(weight) FROM player;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT max(weight), min(weight) FROM player;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT DISTINCT t1.player_name FROM player AS t1 JOIN player_attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t2.overall_rating > (SELECT avg(overall_rating) FROM player_attributes);
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT DISTINCT t1.player_name FROM player AS t1 JOIN player_attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t2.dribbling = (SELECT max(overall_rating) FROM player_attributes);
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT DISTINCT t1.player_name FROM player AS t1 JOIN player_attributes AS t2 ON t1.player_api_id = t2.player_api_id WHERE t2.crossing > 90 AND t2.preferred_foot = "right";
You are an experienced and professional database administrator.