Database: driving_school

Question: What is the birthday of the staff member with first name as Janessa and last name as Sawayn?
SQL: SELECT date_of_birth FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";

Question: When did the staff member with first name as Janessa and last name as Sawayn join the company?
SQL: SELECT date_joined_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";

Question: When did the staff member with first name as Janessa and last name as Sawayn leave the company?
SQL: SELECT date_left_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";

Question: What is the nickname of staff with first name as Janessa and last name as Sawayn?
SQL: SELECT nickname FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn";

Question: Which city does staff with first name as Janessa and last name as Sawayn live?
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";

Question: In which country and state does staff with first name as Janessa and last name as Sawayn live?
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";

Question: How long is the total lesson time took by customer with first name as Rylan and last name as Goodwin?
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";

Question: What is the zip code of staff with first name as Janessa and last name as Sawayn?
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";

Question: Find out the first name and last name of staff living in city Damianfort.
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";

Question: In which city live the most staff? List the city name and number of staff.
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;

Question: List the states which have between 2 to 4 staff living there.
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;

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?
SQL: SELECT customer_status_code ,  cell_mobile_phone_number ,  email_address FROM Customers WHERE first_name = "Marina" OR last_name  =  "Kohler"

Question: When did customer with first name as Carole and last name as Bernhard became a customer?
SQL: SELECT date_became_customer FROM Customers WHERE first_name = "Carole" AND last_name = "Bernhard";