CREATE TABLE artists (
    id NUMBER PRIMARY KEY,
    name TEXT
);
CREATE TABLE sqlite_sequence (
    name TEXT,
    seq TEXT
);
CREATE TABLE albums (
    id NUMBER PRIMARY KEY,
    title TEXT,
    artist_id NUMBER,
    FOREIGN KEY ("artist_id") REFERENCES artists("id")
);
CREATE TABLE employees (
    id NUMBER PRIMARY KEY,
    last_name TEXT,
    first_name TEXT,
    title TEXT,
    reports_to NUMBER,
    birth_date TIME,
    hire_date TIME,
    address TEXT,
    city TEXT,
    state TEXT,
    country TEXT,
    postal_code TEXT,
    phone TEXT,
    fax TEXT,
    email TEXT,
    FOREIGN KEY ("reports_to") REFERENCES employees("id")
);
CREATE TABLE customers (
    id NUMBER PRIMARY KEY,
    first_name TEXT,
    last_name TEXT,
    company TEXT,
    address TEXT,
    city TEXT,
    state TEXT,
    country TEXT,
    postal_code TEXT,
    phone TEXT,
    fax TEXT,
    email TEXT,
    support_rep_id NUMBER,
    FOREIGN KEY ("support_rep_id") REFERENCES employees("id")
);
CREATE TABLE genres (
    id NUMBER PRIMARY KEY,
    name TEXT
);
CREATE TABLE invoices (
    id NUMBER PRIMARY KEY,
    customer_id NUMBER,
    invoice_date TIME,
    billing_address TEXT,
    billing_city TEXT,
    billing_state TEXT,
    billing_country TEXT,
    billing_postal_code TEXT,
    total NUMBER,
    FOREIGN KEY ("customer_id") REFERENCES customers("id")
);
CREATE TABLE media_types (
    id NUMBER PRIMARY KEY,
    name TEXT
);
CREATE TABLE tracks (
    id NUMBER PRIMARY KEY,
    name TEXT,
    album_id NUMBER,
    media_type_id NUMBER,
    genre_id NUMBER,
    composer TEXT,
    milliseconds NUMBER,
    bytes NUMBER,
    unit_price NUMBER,
    FOREIGN KEY ("media_type_id") REFERENCES media_types("id"),
    FOREIGN KEY ("genre_id") REFERENCES genres("id"),
    FOREIGN KEY ("album_id") REFERENCES albums("id")
);
CREATE TABLE invoice_lines (
    id NUMBER PRIMARY KEY,
    invoice_id NUMBER,
    track_id NUMBER,
    unit_price NUMBER,
    quantity NUMBER,
    FOREIGN KEY ("track_id") REFERENCES tracks("id"),
    FOREIGN KEY ("invoice_id") REFERENCES invoices("id")
);
CREATE TABLE playlists (
    id NUMBER PRIMARY KEY,
    name TEXT
);
CREATE TABLE playlist_tracks (
    playlist_id NUMBER PRIMARY KEY,
    track_id NUMBER,
    FOREIGN KEY ("track_id") REFERENCES tracks("id"),
    FOREIGN KEY ("playlist_id") REFERENCES playlists("id")
);

Question: List the state in the US with the most invoices.
SQL: SELECT billing_state ,  COUNT(*) FROM invoices WHERE billing_country  =  "USA" GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1;

Question: What are the states with the most invoices?
SQL: SELECT billing_state ,  COUNT(*) FROM invoices WHERE billing_country  =  "USA" GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1;

Question: List the number of invoices and the invoice total from California.
SQL: SELECT billing_state ,  COUNT(*) ,  SUM(total) FROM invoices WHERE billing_state  =  "CA";

Question: What is the number of invoices and total money billed in them from CA?
SQL: SELECT billing_state ,  COUNT(*) ,  SUM(total) FROM invoices WHERE billing_state  =  "CA";

Question: List Aerosmith's albums.
SQL: SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON  T1.artist_id = T2.id WHERE T2.name = "Aerosmith";

Question: What are the titles of all the Aerosmith albums?
SQL: SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON  T1.artist_id = T2.id WHERE T2.name = "Aerosmith";

Question: How many albums does Billy Cobham has?
SQL: SELECT count(*) FROM albums AS T1 JOIN artists AS T2 ON  T1.artist_id = T2.id WHERE T2.name = "Billy Cobham";

Question: How many albums has Billy Cobam released?
SQL: SELECT count(*) FROM albums AS T1 JOIN artists AS T2 ON  T1.artist_id = T2.id WHERE T2.name = "Billy Cobham";

Question: Eduardo Martins is a customer at which company?
SQL: SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins";

Question: What is the company where Eduardo Martins is a customer?
SQL: SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins";

Question: What is Astrid Gruber's email and phone number?
SQL: SELECT email ,  phone FROM customers WHERE first_name = "Astrid" AND last_name = "Gruber";

Question: What is the email and phone number of Astrid Gruber the customer?
SQL: SELECT email ,  phone FROM customers WHERE first_name = "Astrid" AND last_name = "Gruber";

Question: How many customers live in Prague city?
SQL: SELECT count(*) FROM customers WHERE city = "Prague";

Question: How many customers live in the city of Prague?
SQL: SELECT count(*) FROM customers WHERE city = "Prague";

Question: How many customers in state of CA?
SQL: SELECT count(*) FROM customers WHERE state = "CA";

Question: How many customers are from California?
SQL: SELECT count(*) FROM customers WHERE state = "CA";

Question: What country does Roberto Almeida live?
SQL: SELECT country FROM customers WHERE first_name = "Roberto" AND last_name = "Almeida";

Question: In which country does Roberto Almeida?
SQL: SELECT country FROM customers WHERE first_name = "Roberto" AND last_name = "Almeida";

Question: List the name of albums that are released by aritist whose name has 'Led'
SQL: SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id  =  T2.artist_id WHERE T1.name LIKE '%Led%'

Question: What is the title of the album that was released by the artist whose name has the phrase 'Led'?
SQL: SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id  =  T2.artist_id WHERE T1.name LIKE '%Led%'

Question: How many customers does Steve Johnson support?
SQL: SELECT count(*) FROM employees AS T1 JOIN customers AS T2 ON T2.support_rep_id = T1.id WHERE T1.first_name = "Steve" AND T1.last_name = "Johnson";

Question: What is the count of customers that Steve Johnson supports?
SQL: SELECT count(*) FROM employees AS T1 JOIN customers AS T2 ON T2.support_rep_id = T1.id WHERE T1.first_name = "Steve" AND T1.last_name = "Johnson";

Question: What is the title, phone and hire date of Nancy Edwards?
SQL: SELECT title ,  phone ,  hire_date FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards";

Question: What is the title, phone number and hire date for the employee named Nancy Edwards?
SQL: SELECT title ,  phone ,  hire_date FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards";

Question: find the full name of employees who report to Nancy Edwards?
SQL: SELECT T2.first_name , T2.last_name FROM employees AS T1 JOIN employees AS T2 ON T1.id = T2.reports_to WHERE T1.first_name = "Nancy" AND T1.last_name = "Edwards";

Question: What is the first and last name of the employee who reports to Nancy Edwards?
SQL: SELECT T2.first_name , T2.last_name FROM employees AS T1 JOIN employees AS T2 ON T1.id = T2.reports_to WHERE T1.first_name = "Nancy" AND T1.last_name = "Edwards";

Question: What is the address of employee Nancy Edwards?
SQL: SELECT address FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards";

Question: What is Nancy Edwards's address?
SQL: SELECT address FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards";

Question: Find the full name of employee who supported the most number of customers.
SQL: SELECT T1.first_name , T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id  =  T2.support_rep_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1

Question: What is the full name of the employee who has the most customers?
SQL: SELECT T1.first_name , T1.last_name FROM employees AS T1 JOIN customers AS T2 ON T1.id  =  T2.support_rep_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1

Question: How many employees are living in Canada?
SQL: SELECT count(*) FROM employees WHERE country = "Canada";

Question: How many employees live in Canada?
SQL: SELECT count(*) FROM employees WHERE country = "Canada";

Question: What is employee Nancy Edwards's phone number?
SQL: SELECT phone FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards";