aherntech/sparc huggingface dataset:
Database: phone_1
Question sequence:
tell me the chip model produced by the company named "Nokia Corporation".
Okay, tell me the ROM size of those chip models.
So, what is the average ROM size?
SQL query sequence:
SELECT chip_model FROM phone WHERE Company_name = "Nokia Corporation"
SELECT T1.ROM_MiB FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model WHERE T2.Company_name = "Nokia Corporation";
SELECT avg(T1.ROM_MiB) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model WHERE T2.Company_name = "Nokia Corporation"
Final question: What is the average ROM size of phones produced by the company named "Nokia Corporation"?
Final SQL: SELECT avg(T1.ROM_MiB) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model WHERE T2.Company_name = "Nokia Corporation";
Database: phone_1
Question sequence:
Tell me the phones that were launched in the year 2002.
What companies were they produced by?
Give information about the company and hardware model name for phones that have RAM size greater than 32.
SQL query sequence:
SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model WHERE T1.Launch_year = 2002
SELECT T2.Company_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model WHERE T1.Launch_year = 2002
SELECT T2.Hardware_Model_name ,  T2.Company_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model WHERE T1.RAM_MiB  >  32;
Final question: List the hardware model name and company name for all the phones that were launched in year 2002 or have RAM size greater than 32.
Final SQL: SELECT T2.Hardware_Model_name ,  T2.Company_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model WHERE T1.Launch_year = 2002 OR T1.RAM_MiB  >  32;
Database: phone_1
Question sequence:
Tell me the phones that have the word 'Provisional' in their accreditation types.
How about their company names?
Okay, I want to know the same information of the phones that have word 'Full' in their accreditation types.
SQL query sequence:
SELECT Hardware_Model_name FROM phone WHERE Accreditation_type LIKE 'Provisional'
SELECT Company_name FROM phone WHERE Accreditation_type LIKE 'Provisional';
SELECT Hardware_Model_name ,  Company_name FROM phone WHERE Accreditation_type LIKE 'Full';
Final question: Find all phones that have word 'Full' in their accreditation types. List the Hardware Model name and Company name.
Final SQL: SELECT Hardware_Model_name ,  Company_name FROM phone WHERE Accreditation_type LIKE 'Full';
Database: phone_1
Question sequence:
Tell me the chip model of the phone with hardware model name "LG-P760".
How about the Char cells, Pixels and Hardware colours for its screen?
SQL query sequence:
SELECT chip_model FROM phone WHERE Hardware_Model_name = "LG-P760"
SELECT T1.Char_cells ,  T1.Pixels ,  T1.Hardware_colours FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T2.Hardware_Model_name = "LG-P760";
Final question: Find the Char cells, Pixels and Hardware colours for the screen of the phone whose hardware model name is "LG-P760".
Final SQL: SELECT T1.Char_cells ,  T1.Pixels ,  T1.Hardware_colours FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T2.Hardware_Model_name = "LG-P760";
Database: phone_1
Question sequence:
List the hardware model name and company name for the phone whose screen mode type is "Text".
How about that with screen mode type "Graphics".
SQL query sequence:
SELECT T2.Hardware_Model_name ,  T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type  =  "Text";
SELECT T2.Hardware_Model_name ,  T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type  =  "Graphics"
Final question: List the hardware model name and company name for the phone whose screen mode type is "Graphics"
Final SQL: SELECT T2.Hardware_Model_name ,  T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type  =  "Graphics";
Database: phone_1
Question sequence:
Tell me the name of the company that has the largest number of phone models? Give the count as well.
How about the smallest one?
SQL query sequence:
SELECT Company_name ,  count(*) FROM phone GROUP BY Company_name ORDER BY count(*) DESC LIMIT 1;
SELECT Company_name ,  count(*) FROM phone GROUP BY Company_name ORDER BY count(*) ASC LIMIT 1;
Final question: Find the name of the company that has the least number of phone models. List the company name and the number of phone model produced by that company.
Final SQL: SELECT Company_name ,  count(*) FROM phone GROUP BY Company_name ORDER BY count(*) ASC LIMIT 1;
Database: phone_1
Question sequence:
Tell the name of the company which produced the phone Nokia 700.
So what is the company which produced the phone LG-P760?
Tell me the name of the company that produced more than one phone model.
SQL query sequence:
SELECT Company_name FROM phone WHERE Hardware_Model_name = "Nokia 700"
SELECT Company_name FROM phone WHERE Hardware_Model_name = "LG-P760"
SELECT Company_name FROM phone GROUP BY Company_name HAVING count(*)  >  1;
Final question: List the name of the company that produced more than one phone model.
Final SQL: SELECT Company_name FROM phone GROUP BY Company_name HAVING count(*)  >  1;
Database: phone_1
Question sequence:
Tell me the distinct maps in screen mode.
How about the used kb values?
Okay, I want to know the maximum, minimum and average number of used kb in screen mode.
SQL query sequence:
SELECT DISTINCT map FROM screen_mode
SELECT DISTINCT used_kb FROM screen_mode
SELECT max(used_kb) , min(used_kb) , avg(used_kb) FROM screen_mode
Final question: List the maximum, minimum and average number of used kb in screen mode.
Final SQL: SELECT max(used_kb) , min(used_kb) , avg(used_kb) FROM screen_mode;
Database: phone_1
Question sequence:
Tell me the the name of the phone model launched in the year 2003.
How about that in the year 2002?
I want to know the one with highest RAM size.
SQL query sequence:
SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model WHERE T1.Launch_year = 2003
SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model WHERE T1.Launch_year = 2002
SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model WHERE T1.Launch_year = 2002 ORDER BY T1.RAM_MiB DESC LIMIT 1;
Final question: List the name of the phone model launched in year 2002 and with the highest RAM size.
Final SQL: SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model WHERE T1.Launch_year = 2002 ORDER BY T1.RAM_MiB DESC LIMIT 1;
Database: phone_1
Question sequence:
What are the wifi and screen mode type of the hardware model named "GT-I9300"?
How about that of the hardware model named "Z520e"?
Okay, I want to know that of the hardware model named "LG-P760".
SQL query sequence:
SELECT T1.WiFi , T3.Type FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T2.Hardware_Model_name = "GT-I9300"
SELECT T1.WiFi , T3.Type FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T2.Hardware_Model_name = "Z520e"
SELECT T1.WiFi , T3.Type FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T2.Hardware_Model_name = "LG-P760"
Final question: What are the wifi and screen mode type of the hardware model named "LG-P760"?
Final SQL: SELECT T1.WiFi , T3.Type FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T2.Hardware_Model_name = "LG-P760";
Database: phone_1
Question sequence:
Tell me the hardware model name for the phones that have screen mode type "Graphics".
So how about the phones that have screen model type "Text"?
Okay, I want to know the same for the phones that have RAM size greater than 32.
SQL query sequence:
SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T3.Type = "Graphics"
SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T3.Type = "Text"
SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T1.RAM_MiB  >  32;
Final question: List the hardware model name for the phones that have screen mode type "Text" or RAM size greater than 32.
Final SQL: SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T3.Type = "Text" OR T1.RAM_MiB  >  32;
Database: phone_1
Question sequence:
Tell me the hardware model name for the phones that have screen mode type "Graphics".
So how about the phones that have screen model type "Text"?
Okay, for now I want to know the hardware model name for the phones that were produced by "Nokia Corporation" or whose screen mode type is "Graphics."
SQL query sequence:
SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type  =  "Graphics"
SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type  =  "Text"
SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type  =  "Graphics" OR t2.Company_name  =  "Nokia Corporation"
Final question: List the hardware model name for the phones that were produced by "Nokia Corporation" or whose screen mode type is "Graphics."
Final SQL: SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type  =  "Graphics" OR t2.Company_name  =  "Nokia Corporation"
Database: phone_1
Question sequence:
List the hardware model name for the phones that were produced by "Nokia Corporation".
For these phones, which ones have screen model Text?
How about the ones that do not?
SQL query sequence:
SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE t2.Company_name  =  "Nokia Corporation"
SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE t2.Company_name  =  "Nokia Corporation" AND T1.Type = "Text"
SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE t2.Company_name  =  "Nokia Corporation" AND T1.Type != "Text"
Final question: List the hardware model name for the phones that were produced by "Nokia Corporation" but whose screen mode type is not Text.
Final SQL: SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE t2.Company_name  =  "Nokia Corporation" AND T1.Type != "Text";
Database: phone_1
Question sequence:
Tell me the phone hardware model and company name for the phones whose screen usage in kb is larger than 10.
Smaller than 15?
Okay, now I want to know the phones with screen usage within that range.
SQL query sequence:
SELECT DISTINCT T2.Hardware_Model_name , T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.used_kb > 10
SELECT DISTINCT T2.Hardware_Model_name , T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.used_kb < 15
SELECT DISTINCT T2.Hardware_Model_name , T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.used_kb BETWEEN 10 AND 15
Final question: List the phone hardware model and company name for the phones whose screen usage in kb is between 10 and 15.
Final SQL: SELECT DISTINCT T2.Hardware_Model_name , T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.used_kb BETWEEN 10 AND 15;
Database: phone_1
Question sequence:
Tell me the accreditation level of the hardware model with name Z520e.
How about that of Nokia 700?
Okay, I want to know the accreditation level that more than 3 phones use.
SQL query sequence:
SELECT Accreditation_level FROM phone WHERE Hardware_Model_name = "Z520e"
SELECT Accreditation_level FROM phone WHERE Hardware_Model_name = "Nokia 700"
SELECT Accreditation_level FROM phone GROUP BY Accreditation_level HAVING count(*)  >  3
Final question: Find the accreditation level that more than 3 phones use.
Final SQL: SELECT Accreditation_level FROM phone GROUP BY Accreditation_level HAVING count(*)  >  3
Database: phone_1
Question sequence:
Tell me the ram size of the hardware model with name Nokia 700.
How about for the GT-I9300?
Tell me the average ram mib size of the chip models that are never used by any phone.
SQL query sequence:
SELECT T1.RAM_MiB FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model WHERE T2.Hardware_Model_name = "Nokia 700"
SELECT T1.RAM_MiB FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model WHERE T2.Hardware_Model_name = "GT-I9300"
SELECT avg(RAM_MiB) FROM chip_model WHERE model_name NOT IN (SELECT chip_model FROM phone)
Final question: Find the average ram mib size of the chip models that are never used by any phone.
Final SQL: SELECT avg(RAM_MiB) FROM chip_model WHERE model_name NOT IN (SELECT chip_model FROM phone)
Database: phone_1
Question sequence:
Tell me all the chip models.
Tell me all the chip models that are used by phones with full accreditation type.
How about not used by any phone with full accreditation type?
SQL query sequence:
SELECT model_name FROM chip_model
SELECT T1.model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name  =  T2.chip_model WHERE T2.Accreditation_type  =  'Full'
SELECT model_name FROM chip_model EXCEPT SELECT chip_model FROM phone WHERE Accreditation_type  =  'Full'
Final question: Find the names of the chip models that are not used by any phone with full accreditation type.
Final SQL: SELECT model_name FROM chip_model EXCEPT SELECT chip_model FROM phone WHERE Accreditation_type  =  'Full'
Database: driving_school
Question sequence:
Give the first and last names of the staff.
Also list the date of birth.
What is the birthday of the staff member with first name as Janessa and last name as Sawayn?
SQL query sequence:
SELECT first_name, last_name from staff
SELECT first_name, last_name, date_of_birth from staff
SELECT date_of_birth FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
Final question: What is the birthday of the staff member with first name as Janessa and last name as Sawayn?
Final SQL: SELECT date_of_birth FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
Database: driving_school
Question sequence:
When did various staff join?
When did the staff member with first name as Janessa and last name as Sawayn join the company?
SQL query sequence:
SELECT first_name, last_name, date_joined_staff from staff
SELECT date_joined_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
Final question: When did the staff member with first name as Janessa and last name as Sawayn join the company?
Final SQL: SELECT date_joined_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
Database: driving_school
Question sequence:
What was the most recent leaving of the company for any staff member?
When did the staff member with first name as Janessa and last name as Sawayn leave the company?
SQL query sequence:
SELECT max(date_left_staff) from staff
SELECT date_left_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
Final question: When did the staff member with first name as Janessa and last name as Sawayn leave the company?
Final SQL: SELECT date_left_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
Database: driving_school
Question sequence:
How many unique nicknames are there for the staff?
What is the nickname of staff with first name as Janessa and last name as Sawayn?
SQL query sequence:
SELECT count(*) from (SELECT DISTINCT nickname from staff)
SELECT nickname FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
Final question: What is the nickname of staff with first name as Janessa and last name as Sawayn?
Final SQL: SELECT nickname FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";
Database: driving_school
Question sequence:
Sort the cities in which the staff live in by alphabetical order.
Which city does staff with first name as Janessa and last name as Sawayn live?
SQL query sequence:
SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id ORDER by T1.city
SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn";
Final question: Which city does staff with first name as Janessa and last name as Sawayn live?
Final SQL: SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn";
Database: driving_school
Question sequence:
Where do the staff live? Give first and last name and also country and state.
Narrow that to Janessa Sawayn.
SQL query sequence:
SELECT T2.first_name, T2.last_name, T1.country ,  T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id
SELECT T1.country ,  T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn";
Final question: In which country and state does staff with first name as Janessa and last name as Sawayn live?
Final SQL: SELECT T1.country ,  T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn";
Database: driving_school
Question sequence:
Which customer ids took lessons?
Sum over the lesson time for those groups. Also count the number of lessons take.
What is the customer id of Rylan Goodwin?
How long is the total lesson time took by customer with first name as Rylan and last name as Goodwin?
SQL query sequence:
SELECT DISTINCT customer_id from lessons
SELECT customer_id, sum(lesson_time), count(*) from lessons GROUP by customer_id
SELECT customer_id from customers WHERE first_name = "Rylan" AND last_name = "Goodwin";
SELECT sum(T1.lesson_time) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id  = T2.customer_id WHERE T2.first_name = "Rylan" AND T2.last_name = "Goodwin";
Final question: How long is the total lesson time took by customer with first name as Rylan and last name as Goodwin?
Final SQL: SELECT sum(T1.lesson_time) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id  = T2.customer_id WHERE T2.first_name = "Rylan" AND T2.last_name = "Goodwin";
Database: driving_school
Question sequence:
What is the address id of Janessa Sawayn?
For that address id, give teh zip code.
SQL query sequence:
SELECT staff_address_id from staff where first_name = 'Janessa' and last_name = 'Sawayn'
SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn";
Final question: What is the zip code of staff with first name as Janessa and last name as Sawayn?
Final SQL: SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn";
Database: driving_school
Question sequence:
Which address ids correspond to the city Damianfort?
Join that with staff to find staff living there. Give first and last name.
SQL query sequence:
SELECT address_id from Addresses where city = 'Damianfort'
SELECT T2.first_name ,  T2.last_name FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T1.city = "Damianfort";
Final question: Find out the first name and last name of staff living in city Damianfort.
Final SQL: SELECT T2.first_name ,  T2.last_name FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T1.city = "Damianfort";
Database: driving_school
Question sequence:
What is the most common address_id for staff?
List the corresponding city name and number of staff living there.
SQL query sequence:
SELECT staff_address_id from staff ORDER by staff_address_id DESC LIMIT 1
SELECT T1.city ,  count(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.city ORDER BY count(*) DESC LIMIT 1;
Final question: In which city live the most staff? List the city name and number of staff.
Final SQL: SELECT T1.city ,  count(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.city ORDER BY count(*) DESC LIMIT 1;
Database: driving_school
Question sequence:
List the states and counts of staff living there.
List the states which have between 2 to 4 staff living there.
SQL query sequence:
SELECT T1.state_province_county, count(*) from Addresses as T1 join staff as T2 on T1.address_id = T2.staff_address_id GROUP by T2.staff_id
SELECT T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.state_province_county HAVING count(*) BETWEEN 2 AND 4;
Final question: List the states which have between 2 to 4 staff living there.
Final SQL: SELECT T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.state_province_county HAVING count(*) BETWEEN 2 AND 4;
Database: driving_school
Question sequence:
Give records on the customer with last name Kohler.
Also show records for first name 'Marina'
Just show the status code, mobile phone number and email address for the above.
SQL query sequence:
SELECT * from customers where last_name = 'Kohler'
SELECT * from customers where last_name = 'Kohler' OR first_name = 'Marina'
SELECT customer_status_code ,  cell_mobile_phone_number ,  email_address FROM Customers WHERE first_name = "Marina" OR last_name  =  "Kohler"
Final question: What is the status code, mobile phone number and email address of the customer with last name as Kohler or first name as Marina?
Final SQL: SELECT customer_status_code ,  cell_mobile_phone_number ,  email_address FROM Customers WHERE first_name = "Marina" OR last_name  =  "Kohler"
Database: driving_school
Question sequence:
List the names and date became customer for the customers.
Limit that to Carole Bernhard, and just show the relevant date.
SQL query sequence:
SELECT first_name, last_name, date_became_customer from customers
SELECT date_became_customer FROM Customers WHERE first_name = "Carole" AND last_name = "Bernhard";
Final question: When did customer with first name as Carole and last name as Bernhard became a customer?
Final SQL: SELECT date_became_customer FROM Customers WHERE first_name = "Carole" AND last_name = "Bernhard";
Database: driving_school
Question sequence:
List the customer status code with their respective counts.
Sort by ascending counts.
Which customer status code has least number of customers?
SQL query sequence:
SELECT customer_status_code, count(*) from customers GROUP by customer_status_code
SELECT customer_status_code, count(*) from customers GROUP by customer_status_code ORDER by count(*) ASC
SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY count(*) ASC LIMIT 1;
Final question: Which customer status code has least number of customers?
Final SQL: SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY count(*) ASC LIMIT 1;