SQL
stringlengths
18
577
question
stringlengths
317
11.5k
SELECT first_name , last_name FROM employees ORDER BY birth_date DESC LIMIT 1;
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What si the youngest employee's first and last name?
SELECT first_name , last_name FROM employees ORDER BY hire_date ASC LIMIT 10;
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. List top 10 employee work longest in the company. List employee's first and last name.
SELECT first_name , last_name FROM employees ORDER BY hire_date ASC LIMIT 10;
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the first and last names of the top 10 longest-serving employees?
SELECT count(*) , city FROM employees WHERE title = 'IT Staff' GROUP BY city
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Find the number of employees whose title is IT Staff from each city?
SELECT count(*) , city FROM employees WHERE title = 'IT Staff' GROUP BY city
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many employees who are IT staff are from each city?
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;
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which employee manage most number of peoples? List employee's first and last name, and number of people report to that employee.
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;
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the first and last names of all the employees and how many people report to them?
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";
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many orders does Lucas Mancini has?
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";
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many orders does Luca Mancini have in his invoices?
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";
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the total amount of money spent by Lucas Mancini?
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";
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How much money did Lucas Mancini spend?
SELECT name FROM media_types;
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. List all media types.
SELECT name FROM media_types;
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the names of all the media types?
SELECT DISTINCT name FROM genres;
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. List all different genre types.
SELECT DISTINCT name FROM genres;
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the different names of the genres?
SELECT name FROM playlists;
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. List the name of all playlist.
SELECT name FROM playlists;
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the names of all the playlists?
SELECT composer FROM tracks WHERE name = "Fast As a Shark";
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Who is the composer of track Fast As a Shark?
SELECT composer FROM tracks WHERE name = "Fast As a Shark";
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the composer who created the track "Fast As a Shark"?
SELECT milliseconds FROM tracks WHERE name = "Fast As a Shark";
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How long does track Fast As a Shark has?
SELECT milliseconds FROM tracks WHERE name = "Fast As a Shark";
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many milliseconds long is Fast As a Shark?
SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "Rock";
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the name of tracks whose genre is Rock?
SELECT T2.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.name = "Rock";
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the name of all tracks in the Rock genre?
SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T2.name = "Balls to the Wall";
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is title of album which track Balls to the Wall belongs to?
SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T2.name = "Balls to the Wall";
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the name of the album that has the track Ball to the Wall?
SELECT T2.name FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.title = "Balls to the Wall";
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. List name of all tracks in Balls to the Wall.
SELECT T2.name FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id WHERE T1.title = "Balls to the Wall";
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the name of all tracks in the album named Balls to the Wall?
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;
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. List title of albums have the number of tracks greater than 10.
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;
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the names of the albums that have more than 10 tracks?
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";
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. List the name of tracks belongs to genre Rock and whose media type is MPEG audio file.
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";
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the names of all Rock tracks that are stored on MPEG audio files?
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";
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. List the name of tracks belongs to genre Rock or media type is MPEG audio file.
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";
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the names of all tracks that belong to the Rock genre and whose media type is MPEG?
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"
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. List the name of tracks belongs to genre Rock or genre Jazz.
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"
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the names of the tracks that are Rock or Jazz songs?
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";
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. List the name of all tracks in the playlists of Movies.
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";
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the names of all tracks that are on playlists titled Movies?
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;
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. List the name of playlist which has number of tracks greater than 100.
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;
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the names of all playlists that have more than 100 tracks?
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";
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. List all tracks bought by customer Daan Peeters.
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";
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the tracks that Dean Peeters bought?
SELECT unit_price FROM tracks WHERE name = "Fast As a Shark";
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How much is the track Fast As a Shark?
SELECT unit_price FROM tracks WHERE name = "Fast As a Shark";
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the unit price of the tune "Fast As a Shark"?
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'
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Find the name of tracks which are in Movies playlist but not in music playlist.
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'
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the names of all tracks that are on the Movies playlist but not in the music playlist?
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'
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Find the name of tracks which are in both Movies and music playlists.
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'
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the names of all the tracks that are in both the Movies and music playlists?
SELECT count(*) , T1.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id GROUP BY T1.name;
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Find number of tracks in each genre?
SELECT count(*) , T1.name FROM genres AS T1 JOIN tracks AS T2 ON T1.id = T2.genre_id GROUP BY T1.name;
Given the Table sqlite sequence having columns as id has datatype number, name has datatype text which has id and Given the Table artists having columns as name has datatype text, seq has datatype text which has id and Given the Table albums having columns as id has datatype number, title has datatype text, artist_id has datatype number which has id and Given the Table employees having columns as id has datatype number, last_name has datatype text, first_name has datatype text, title has datatype text, reports_to has datatype number, birth_date has datatype time, hire_date has datatype time, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text which has id and Given the Table customers having columns as id has datatype number, first_name has datatype text, last_name has datatype text, company has datatype text, address has datatype text, city has datatype text, state has datatype text, country has datatype text, postal_code has datatype text, phone has datatype text, fax has datatype text, email has datatype text, support_rep_id has datatype number which has id and Given the Table genres having columns as id has datatype number, name has datatype text which has id and Given the Table invoices having columns as id has datatype number, customer_id has datatype number, invoice_date has datatype time, billing_address has datatype text, billing_city has datatype text, billing_state has datatype text, billing_country has datatype text, billing_postal_code has datatype text, total has datatype number which has id and Given the Table media types having columns as id has datatype number, name has datatype text which has id and Given the Table tracks having columns as id has datatype number, name has datatype text, album_id has datatype number, media_type_id has datatype number, genre_id has datatype number, composer has datatype text, milliseconds has datatype number, bytes has datatype number, unit_price has datatype number which has id and Given the Table invoice lines having columns as id has datatype number, invoice_id has datatype number, track_id has datatype number, unit_price has datatype number, quantity has datatype number which has id and Given the Table playlists having columns as id has datatype number, name has datatype text which has playlist_id and Given the Table playlist tracks having columns as playlist_id has datatype number, track_id has datatype number which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many tracks are in each genre?
SELECT count(*) FROM editor
Given the Table journal having columns as Journal_ID has datatype number, Date has datatype text, Theme has datatype text, Sales has datatype number which has Journal_ID and Given the Table editor having columns as Editor_ID has datatype number, Name has datatype text, Age has datatype number which has Editor_ID and Given the Table journal committee having columns as Editor_ID has datatype number, Journal_ID has datatype number, Work_Type has datatype text which has Editor_ID. Answer the question by writing the appropriate SQL code. How many editors are there?
SELECT Name FROM editor ORDER BY Age ASC
Given the Table journal having columns as Journal_ID has datatype number, Date has datatype text, Theme has datatype text, Sales has datatype number which has Journal_ID and Given the Table editor having columns as Editor_ID has datatype number, Name has datatype text, Age has datatype number which has Editor_ID and Given the Table journal committee having columns as Editor_ID has datatype number, Journal_ID has datatype number, Work_Type has datatype text which has Editor_ID. Answer the question by writing the appropriate SQL code. List the names of editors in ascending order of age.
SELECT Name , Age FROM editor
Given the Table journal having columns as Journal_ID has datatype number, Date has datatype text, Theme has datatype text, Sales has datatype number which has Journal_ID and Given the Table editor having columns as Editor_ID has datatype number, Name has datatype text, Age has datatype number which has Editor_ID and Given the Table journal committee having columns as Editor_ID has datatype number, Journal_ID has datatype number, Work_Type has datatype text which has Editor_ID. Answer the question by writing the appropriate SQL code. What are the names and ages of editors?
SELECT Name FROM editor WHERE Age > 25
Given the Table journal having columns as Journal_ID has datatype number, Date has datatype text, Theme has datatype text, Sales has datatype number which has Journal_ID and Given the Table editor having columns as Editor_ID has datatype number, Name has datatype text, Age has datatype number which has Editor_ID and Given the Table journal committee having columns as Editor_ID has datatype number, Journal_ID has datatype number, Work_Type has datatype text which has Editor_ID. Answer the question by writing the appropriate SQL code. List the names of editors who are older than 25.
SELECT Name FROM editor WHERE Age = 24 OR Age = 25
Given the Table journal having columns as Journal_ID has datatype number, Date has datatype text, Theme has datatype text, Sales has datatype number which has Journal_ID and Given the Table editor having columns as Editor_ID has datatype number, Name has datatype text, Age has datatype number which has Editor_ID and Given the Table journal committee having columns as Editor_ID has datatype number, Journal_ID has datatype number, Work_Type has datatype text which has Editor_ID. Answer the question by writing the appropriate SQL code. Show the names of editors of age either 24 or 25.
SELECT Name FROM editor ORDER BY Age ASC LIMIT 1
Given the Table journal having columns as Journal_ID has datatype number, Date has datatype text, Theme has datatype text, Sales has datatype number which has Journal_ID and Given the Table editor having columns as Editor_ID has datatype number, Name has datatype text, Age has datatype number which has Editor_ID and Given the Table journal committee having columns as Editor_ID has datatype number, Journal_ID has datatype number, Work_Type has datatype text which has Editor_ID. Answer the question by writing the appropriate SQL code. What is the name of the youngest editor?
SELECT Age , COUNT(*) FROM editor GROUP BY Age
Given the Table journal having columns as Journal_ID has datatype number, Date has datatype text, Theme has datatype text, Sales has datatype number which has Journal_ID and Given the Table editor having columns as Editor_ID has datatype number, Name has datatype text, Age has datatype number which has Editor_ID and Given the Table journal committee having columns as Editor_ID has datatype number, Journal_ID has datatype number, Work_Type has datatype text which has Editor_ID. Answer the question by writing the appropriate SQL code. What are the different ages of editors? Show each age along with the number of editors of that age.
SELECT Age FROM editor GROUP BY Age ORDER BY COUNT(*) DESC LIMIT 1
Given the Table journal having columns as Journal_ID has datatype number, Date has datatype text, Theme has datatype text, Sales has datatype number which has Journal_ID and Given the Table editor having columns as Editor_ID has datatype number, Name has datatype text, Age has datatype number which has Editor_ID and Given the Table journal committee having columns as Editor_ID has datatype number, Journal_ID has datatype number, Work_Type has datatype text which has Editor_ID. Answer the question by writing the appropriate SQL code. Please show the most common age of editors.
SELECT DISTINCT Theme FROM journal
Given the Table journal having columns as Journal_ID has datatype number, Date has datatype text, Theme has datatype text, Sales has datatype number which has Journal_ID and Given the Table editor having columns as Editor_ID has datatype number, Name has datatype text, Age has datatype number which has Editor_ID and Given the Table journal committee having columns as Editor_ID has datatype number, Journal_ID has datatype number, Work_Type has datatype text which has Editor_ID. Answer the question by writing the appropriate SQL code. Show the distinct themes of journals.
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
Given the Table journal having columns as Journal_ID has datatype number, Date has datatype text, Theme has datatype text, Sales has datatype number which has Journal_ID and Given the Table editor having columns as Editor_ID has datatype number, Name has datatype text, Age has datatype number which has Editor_ID and Given the Table journal committee having columns as Editor_ID has datatype number, Journal_ID has datatype number, Work_Type has datatype text which has Editor_ID. Answer the question by writing the appropriate SQL code. Show the names of editors and the theme of journals for which they serve on committees.
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
Given the Table journal having columns as Journal_ID has datatype number, Date has datatype text, Theme has datatype text, Sales has datatype number which has Journal_ID and Given the Table editor having columns as Editor_ID has datatype number, Name has datatype text, Age has datatype number which has Editor_ID and Given the Table journal committee having columns as Editor_ID has datatype number, Journal_ID has datatype number, Work_Type has datatype text which has Editor_ID. Answer the question by writing the appropriate SQL code. For each journal_committee, find the editor name and the journal theme.
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
Given the Table journal having columns as Journal_ID has datatype number, Date has datatype text, Theme has datatype text, Sales has datatype number which has Journal_ID and Given the Table editor having columns as Editor_ID has datatype number, Name has datatype text, Age has datatype number which has Editor_ID and Given the Table journal committee having columns as Editor_ID has datatype number, Journal_ID has datatype number, Work_Type has datatype text which has Editor_ID. Answer the question by writing the appropriate SQL code. Show the names and ages of editors and the theme of journals for which they serve on committees, in ascending alphabetical order of theme.
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
Given the Table journal having columns as Journal_ID has datatype number, Date has datatype text, Theme has datatype text, Sales has datatype number which has Journal_ID and Given the Table editor having columns as Editor_ID has datatype number, Name has datatype text, Age has datatype number which has Editor_ID and Given the Table journal committee having columns as Editor_ID has datatype number, Journal_ID has datatype number, Work_Type has datatype text which has Editor_ID. Answer the question by writing the appropriate SQL code. Show the names of editors that are on the committee of journals with sales bigger than 3000.
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
Given the Table journal having columns as Journal_ID has datatype number, Date has datatype text, Theme has datatype text, Sales has datatype number which has Journal_ID and Given the Table editor having columns as Editor_ID has datatype number, Name has datatype text, Age has datatype number which has Editor_ID and Given the Table journal committee having columns as Editor_ID has datatype number, Journal_ID has datatype number, Work_Type has datatype text which has Editor_ID. Answer the question by writing the appropriate SQL code. Show the id, name of each editor and the number of journal committees they are on.
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
Given the Table journal having columns as Journal_ID has datatype number, Date has datatype text, Theme has datatype text, Sales has datatype number which has Journal_ID and Given the Table editor having columns as Editor_ID has datatype number, Name has datatype text, Age has datatype number which has Editor_ID and Given the Table journal committee having columns as Editor_ID has datatype number, Journal_ID has datatype number, Work_Type has datatype text which has Editor_ID. Answer the question by writing the appropriate SQL code. Show the names of editors that are on at least two journal committees.
SELECT Name FROM editor WHERE editor_id NOT IN (SELECT editor_id FROM journal_committee)
Given the Table journal having columns as Journal_ID has datatype number, Date has datatype text, Theme has datatype text, Sales has datatype number which has Journal_ID and Given the Table editor having columns as Editor_ID has datatype number, Name has datatype text, Age has datatype number which has Editor_ID and Given the Table journal committee having columns as Editor_ID has datatype number, Journal_ID has datatype number, Work_Type has datatype text which has Editor_ID. Answer the question by writing the appropriate SQL code. List the names of editors that are not on any journal committee.
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
Given the Table journal having columns as Journal_ID has datatype number, Date has datatype text, Theme has datatype text, Sales has datatype number which has Journal_ID and Given the Table editor having columns as Editor_ID has datatype number, Name has datatype text, Age has datatype number which has Editor_ID and Given the Table journal committee having columns as Editor_ID has datatype number, Journal_ID has datatype number, Work_Type has datatype text which has Editor_ID. Answer the question by writing the appropriate SQL code. List the date, theme and sales of the journal which did not have any of the listed editors serving on committee.
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'
Given the Table journal having columns as Journal_ID has datatype number, Date has datatype text, Theme has datatype text, Sales has datatype number which has Journal_ID and Given the Table editor having columns as Editor_ID has datatype number, Name has datatype text, Age has datatype number which has Editor_ID and Given the Table journal committee having columns as Editor_ID has datatype number, Journal_ID has datatype number, Work_Type has datatype text which has Editor_ID. Answer the question by writing the appropriate SQL code. What is the average sales of the journals that have an editor whose work type is 'Photo'?
SELECT count(*) FROM Accounts
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many accounts do we have?
SELECT count(*) FROM Accounts
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Count the number of accounts.
SELECT account_id , customer_id , account_name FROM Accounts
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Show ids, customer ids, names for all accounts.
SELECT account_id , customer_id , account_name FROM Accounts
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the account ids, customer ids, and account names for all the accounts?
SELECT other_account_details FROM Accounts WHERE account_name = "338"
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Show other account details for account with name 338.
SELECT other_account_details FROM Accounts WHERE account_name = "338"
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the other account details for the account with the name 338?
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"
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the first name, last name, and phone of the customer with account name 162?
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"
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Give the full name and phone of the customer who has the account name 162.
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"
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many accounts does the customer with first name Art and last name Turcotte have?
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"
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Return the number of accounts that the customer with the first name Art and last name Turcotte has.
SELECT customer_id , count(*) FROM Accounts GROUP BY customer_id
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Show all customer ids and the number of accounts for each customer.
SELECT customer_id , count(*) FROM Accounts GROUP BY customer_id
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many accounts are there for each customer id?
SELECT customer_id , count(*) FROM Accounts GROUP BY customer_id ORDER BY count(*) DESC LIMIT 1
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Show the customer id and number of accounts with most accounts.
SELECT customer_id , count(*) FROM Accounts GROUP BY customer_id ORDER BY count(*) DESC LIMIT 1
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the customer id of the customer with the most accounts, and how many accounts does this person have?
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
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the customer first, last name and id with least number of accounts.
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
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Give the full name and customer id of the customer with the fewest accounts.
SELECT count(*) FROM Customers WHERE customer_id NOT IN (SELECT customer_id FROM Accounts)
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Show the number of all customers without an account.
SELECT count(*) FROM Customers WHERE customer_id NOT IN (SELECT customer_id FROM Accounts)
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many customers do not have an account?
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
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Show the first names and last names of customers without any account.
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
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the full names of customers who do not have any accounts?
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
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Show distinct first and last names for all customers with an account.
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
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the full names of customers who have accounts?
SELECT count(DISTINCT customer_id) FROM Accounts
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many customers have an account?
SELECT count(DISTINCT customer_id) FROM Accounts
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Count the number of customers who hold an account.
SELECT count(*) FROM Customers
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many customers do we have?
SELECT count(*) FROM Customers
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Count the number of customers.
SELECT customer_id , customer_first_name , customer_last_name , customer_phone FROM Customers
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Show ids, first names, last names, and phones for all customers.
SELECT customer_id , customer_first_name , customer_last_name , customer_phone FROM Customers
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the ids, full names, and phones of each customer?
SELECT customer_phone , customer_email FROM Customers WHERE customer_first_name = "Aniyah" AND customer_last_name = "Feest"
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the phone and email for customer with first name Aniyah and last name Feest?
SELECT customer_phone , customer_email FROM Customers WHERE customer_first_name = "Aniyah" AND customer_last_name = "Feest"
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Return the phone and email of the customer with the first name Aniyah and last name Feest.
SELECT count(*) FROM Customers_cards
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Show the number of customer cards.
SELECT count(*) FROM Customers_cards
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many customer cards are there?
SELECT card_id , customer_id , card_type_code , card_number FROM Customers_cards
Given the Table accounts having columns as account_id has datatype number, customer_id has datatype number, account_name has datatype text, other_account_details has datatype text which has account_id and Given the Table customers having columns as customer_id has datatype number, customer_first_name has datatype text, customer_last_name has datatype text, customer_address has datatype text, customer_phone has datatype text, customer_email has datatype text, other_customer_details has datatype text which has customer_id and Given the Table customers cards having columns as card_id has datatype number, customer_id has datatype number, card_type_code has datatype text, card_number has datatype text, date_valid_from has datatype time, date_valid_to has datatype time, other_card_details has datatype text which has card_id and Given the Table financial transactions having columns as transaction_id has datatype number, previous_transaction_id has datatype number, account_id has datatype number, card_id has datatype number, transaction_type has datatype text, transaction_date has datatype time, transaction_amount has datatype number, transaction_comment has datatype text, other_transaction_details has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Show ids, customer ids, card type codes, card numbers for all cards.