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 first_name, last_name FROM employees ORDER BY birth_date 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 first_name, last_name FROM employees ORDER BY hire_date ASC LIMIT 10;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT first_name, last_name FROM employees ORDER BY hire_date ASC LIMIT 10;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*), city FROM employees WHERE title = 'IT Staff' GROUP BY city;
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(*), city FROM employees WHERE title = 'IT Staff' GROUP BY city;
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.first_name, t2.last_name, count(t1.reports_to) FROM employees AS t1 JOIN employees AS t2 ON t1.reports_to = t2.id GROUP BY t1.reports_to ORDER BY count(t1.reports_to) 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 t2.first_name, t2.last_name, count(t1.reports_to) FROM employees AS t1 JOIN employees AS t2 ON t1.reports_to = t2.id GROUP BY t1.reports_to ORDER BY count(t1.reports_to) 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 count(*) FROM customers AS t1 JOIN invoices AS t2 ON t1.id = t2.customer_id WHERE t1.first_name = "Lucas" AND t1.last_name = "Mancini";
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 customers AS t1 JOIN invoices AS t2 ON t1.id = t2.customer_id WHERE t1.first_name = "Lucas" AND t1.last_name = "Mancini";
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.total) FROM customers AS t1 JOIN invoices AS t2 ON t1.id = t2.customer_id WHERE t1.first_name = "Lucas" AND t1.last_name = "Mancini";
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.total) FROM customers AS t1 JOIN invoices AS t2 ON t1.id = t2.customer_id WHERE t1.first_name = "Lucas" AND t1.last_name = "Mancini";
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 media_types;
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 media_types;
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 name FROM genres;
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 name FROM genres;
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 playlists;
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 playlists;
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 composer FROM tracks WHERE name = "Fast As a Shark";
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 composer FROM tracks WHERE name = "Fast As a Shark";
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 milliseconds FROM tracks WHERE name = "Fast As a Shark";
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 milliseconds FROM tracks WHERE name = "Fast As a Shark";
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 genres AS t1 JOIN tracks AS t2 ON t1.id = t2.genre_id WHERE t1.name = "Rock";
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 genres AS t1 JOIN tracks AS t2 ON t1.id = t2.genre_id WHERE t1.name = "Rock";
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.title FROM albums AS t1 JOIN tracks AS t2 ON t1.id = t2.genre_id WHERE t2.name = "Balls to the Wall";
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.title FROM albums AS t1 JOIN tracks AS t2 ON t1.id = t2.genre_id WHERE t2.name = "Balls to the Wall";
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 albums AS t1 JOIN tracks AS t2 ON t1.id = t2.genre_id WHERE t1.title = "Balls to the Wall";
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 albums AS t1 JOIN tracks AS t2 ON t1.id = t2.genre_id WHERE t1.title = "Balls to the Wall";
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.title FROM albums AS t1 JOIN tracks AS t2 ON t1.id = t2.album_id GROUP BY t1.id HAVING count(t1.id) > 10;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t1.title FROM albums AS t1 JOIN tracks AS t2 ON t1.id = t2.album_id GROUP BY t1.id HAVING count(t1.id) > 10;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.name FROM genres AS t1 JOIN tracks AS t2 ON t1.id = t2.genre_id JOIN media_types AS t3 ON t3.id = t2.media_type_id WHERE t1.name = "Rock" AND t3.name = "MPEG audio file";
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 genres AS t1 JOIN tracks AS t2 ON t1.id = t2.genre_id JOIN media_types AS t3 ON t3.id = t2.media_type_id WHERE t1.name = "Rock" AND t3.name = "MPEG audio file";
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 genres AS t1 JOIN tracks AS t2 ON t1.id = t2.genre_id JOIN media_types AS t3 ON t3.id = t2.media_type_id WHERE t1.name = "Rock" OR t3.name = "MPEG audio file";
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 genres AS t1 JOIN tracks AS t2 ON t1.id = t2.genre_id JOIN media_types AS t3 ON t3.id = t2.media_type_id WHERE t1.name = "Rock" OR t3.name = "MPEG audio file";
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 genres AS t1 JOIN tracks AS t2 ON t1.id = t2.genre_id WHERE t1.name = "Rock" OR t1.name = "Jazz";
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 genres AS t1 JOIN tracks AS t2 ON t1.id = t2.genre_id WHERE t1.name = "Rock" OR t1.name = "Jazz";
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 FROM tracks AS t1 JOIN playlist_tracks AS t2 ON t1.id = t2.track_id JOIN playlists AS t3 ON t3.id = t2.playlist_id WHERE t3.name = "Movies";
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 FROM tracks AS t1 JOIN playlist_tracks AS t2 ON t1.id = t2.track_id JOIN playlists AS t3 ON t3.id = t2.playlist_id WHERE t3.name = "Movies";
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 playlist_tracks AS t1 JOIN playlists AS t2 ON t2.id = t1.playlist_id GROUP BY t1.playlist_id HAVING count(t1.track_id) > 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 t2.name FROM playlist_tracks AS t1 JOIN playlists AS t2 ON t2.id = t1.playlist_id GROUP BY t1.playlist_id HAVING count(t1.track_id) > 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 t1.name FROM tracks AS t1 JOIN invoice_lines AS t2 ON t1.id = t2.track_id JOIN invoices AS t3 ON t3.id = t2.invoice_id JOIN customers AS t4 ON t4.id = t3.customer_id WHERE t4.first_name = "Daan" AND t4.last_name = "Peeters";
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 FROM tracks AS t1 JOIN invoice_lines AS t2 ON t1.id = t2.track_id JOIN invoices AS t3 ON t3.id = t2.invoice_id JOIN customers AS t4 ON t4.id = t3.customer_id WHERE t4.first_name = "Daan" AND t4.last_name = "Peeters";
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 unit_price FROM tracks WHERE name = "Fast As a Shark";
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 unit_price FROM tracks WHERE name = "Fast As a Shark";
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 FROM tracks AS t1 JOIN playlist_tracks AS t2 ON t1.id = t2.track_id JOIN playlists AS t3 ON t2.playlist_id = t3.id WHERE t3.name = 'Movies' EXCEPT SELECT t1.name FROM tracks AS t1 JOIN playlist_tracks AS t2 ON t1.id = t2.track_id JOIN playlists AS t3 ON t2.playlist_id = t3.id WHERE t3.name = 'Music';
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 FROM tracks AS t1 JOIN playlist_tracks AS t2 ON t1.id = t2.track_id JOIN playlists AS t3 ON t2.playlist_id = t3.id WHERE t3.name = 'Movies' EXCEPT SELECT t1.name FROM tracks AS t1 JOIN playlist_tracks AS t2 ON t1.id = t2.track_id JOIN playlists AS t3 ON t2.playlist_id = t3.id WHERE t3.name = 'Music';
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 FROM tracks AS t1 JOIN playlist_tracks AS t2 ON t1.id = t2.track_id JOIN playlists AS t3 ON t2.playlist_id = t3.id WHERE t3.name = 'Movies' INTERSECT SELECT t1.name FROM tracks AS t1 JOIN playlist_tracks AS t2 ON t1.id = t2.track_id JOIN playlists AS t3 ON t2.playlist_id = t3.id WHERE t3.name = 'Music';
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 FROM tracks AS t1 JOIN playlist_tracks AS t2 ON t1.id = t2.track_id JOIN playlists AS t3 ON t2.playlist_id = t3.id WHERE t3.name = 'Movies' INTERSECT SELECT t1.name FROM tracks AS t1 JOIN playlist_tracks AS t2 ON t1.id = t2.track_id JOIN playlists AS t3 ON t2.playlist_id = t3.id WHERE t3.name = 'Music';
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(*), t1.name FROM genres AS t1 JOIN tracks AS t2 ON t1.id = t2.genre_id GROUP BY t1.name;
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(*), t1.name FROM genres AS t1 JOIN tracks AS t2 ON t1.id = t2.genre_id GROUP BY t1.name;
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 editor;
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 editor ORDER BY age 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 name, age FROM editor;
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 editor WHERE age > 25;
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 editor WHERE age = 24 OR age = 25;
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 editor ORDER BY age ASC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT age, count(*) FROM editor GROUP BY age;
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 age FROM editor GROUP BY age 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 DISTINCT theme FROM journal;
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, t3.theme FROM journal_committee AS t1 JOIN editor AS t2 ON t1.editor_id = t2.editor_id JOIN journal AS t3 ON t1.journal_id = t3.journal_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.name, t3.theme FROM journal_committee AS t1 JOIN editor AS t2 ON t1.editor_id = t2.editor_id JOIN journal AS t3 ON t1.journal_id = t3.journal_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.name, t2.age, t3.theme FROM journal_committee AS t1 JOIN editor AS t2 ON t1.editor_id = t2.editor_id JOIN journal AS t3 ON t1.journal_id = t3.journal_id ORDER BY t3.theme 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 t2.name FROM journal_committee AS t1 JOIN editor AS t2 ON t1.editor_id = t2.editor_id JOIN journal AS t3 ON t1.journal_id = t3.journal_id WHERE t3.sales > 3000;
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.editor_id, t1.name, count(*) FROM editor AS t1 JOIN journal_committee AS t2 ON t1.editor_id = t2.editor_id GROUP BY t1.editor_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.name FROM editor AS t1 JOIN journal_committee AS t2 ON t1.editor_id = t2.editor_id GROUP BY t1.name 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 name FROM editor WHERE editor_id NOT IN (SELECT editor_id FROM journal_committee);
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 , theme, sales FROM journal EXCEPT SELECT t1.date, t1.theme, t1.sales FROM journal AS t1 JOIN journal_committee AS t2 ON t1.journal_id = t2.journal_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 avg(t1.sales) FROM journal AS t1 JOIN journal_committee AS t2 ON t1.journal_id = t2.journal_id WHERE t2.work_type = 'Photo';
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 accounts;
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 accounts;
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 account_id, customer_id, account_name FROM accounts;
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 account_id, customer_id, account_name FROM accounts;
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 other_account_details FROM accounts WHERE account_name = "338";
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 other_account_details FROM accounts WHERE account_name = "338";
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.customer_first_name, t2.customer_last_name, t2.customer_phone FROM accounts AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.account_name = "162";
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.customer_first_name, t2.customer_last_name, t2.customer_phone FROM accounts AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t1.account_name = "162";
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 accounts AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t2.customer_first_name = "Art" AND t2.customer_last_name = "Turcotte";
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 accounts AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id WHERE t2.customer_first_name = "Art" AND t2.customer_last_name = "Turcotte";
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 customer_id, count(*) FROM accounts GROUP BY customer_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 customer_id, count(*) FROM accounts GROUP BY customer_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 customer_id, count(*) FROM accounts GROUP BY customer_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 customer_id, count(*) FROM accounts GROUP BY customer_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 t2.customer_first_name, t2.customer_last_name, t1.customer_id FROM accounts AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id ORDER BY count(*) ASC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT t2.customer_first_name, t2.customer_last_name, t1.customer_id FROM accounts AS t1 JOIN customers AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_id ORDER BY count(*) ASC LIMIT 1;
You are an experienced and professional database administrator.
Given [Database Schema] and [Foreign Keys], your task is to write a [SQL Query] to answer the [Question]. [Database Schema] Every table consists of several columns. Each line describes the name, type of the column and optional value examples. In some cases, column name can be ambiguous, and extra comment is provided t...
SELECT count(*) FROM customers WHERE customer_id NOT IN (SELECT customer_id FROM accounts);
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 customers WHERE customer_id NOT IN (SELECT customer_id FROM accounts);
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 customer_first_name, customer_last_name FROM customers EXCEPT SELECT t1.customer_first_name, t1.customer_last_name FROM customers AS t1 JOIN accounts AS t2 ON t1.customer_id = t2.customer_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 customer_first_name, customer_last_name FROM customers EXCEPT SELECT t1.customer_first_name, t1.customer_last_name FROM customers AS t1 JOIN accounts AS t2 ON t1.customer_id = t2.customer_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 DISTINCT t1.customer_first_name, t1.customer_last_name FROM customers AS t1 JOIN accounts AS t2 ON t1.customer_id = t2.customer_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 DISTINCT t1.customer_first_name, t1.customer_last_name FROM customers AS t1 JOIN accounts AS t2 ON t1.customer_id = t2.customer_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(DISTINCT customer_id) FROM accounts;
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 customer_id) FROM accounts;
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 customers;
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 customers;
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 customer_id, customer_first_name, customer_last_name, customer_phone FROM customers;
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 customer_id, customer_first_name, customer_last_name, customer_phone FROM customers;
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 customer_phone, customer_email FROM customers WHERE customer_first_name = "Aniyah" AND customer_last_name = "Feest";
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 customer_phone, customer_email FROM customers WHERE customer_first_name = "Aniyah" AND customer_last_name = "Feest";
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 customers_cards;
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 customers_cards;
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 card_id, customer_id, card_type_code, card_number FROM customers_cards;
You are an experienced and professional database administrator.