SQL
stringlengths
18
577
question
stringlengths
317
11.5k
SELECT advisor , count(*) FROM Student GROUP BY advisor
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many students does each advisor have?
SELECT advisor FROM Student GROUP BY advisor ORDER BY count(*) DESC LIMIT 1
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which advisor has most number of students?
SELECT advisor FROM Student GROUP BY advisor ORDER BY count(*) DESC LIMIT 1
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Give the advisor with the most students.
SELECT count(*) FROM Has_allergy WHERE Allergy = "Cat"
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many students have cat allergies?
SELECT count(*) FROM Has_allergy WHERE Allergy = "Cat"
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many students are affected by cat allergies?
SELECT StuID FROM Has_allergy GROUP BY StuID HAVING count(*) >= 2
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Show all student IDs who have at least two allergies.
SELECT StuID FROM Has_allergy GROUP BY StuID HAVING count(*) >= 2
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the students ids of students who have more than one allergy?
SELECT StuID FROM Student EXCEPT SELECT StuID FROM Has_allergy
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the student ids of students who don't have any allergies?
SELECT StuID FROM Student EXCEPT SELECT StuID FROM Has_allergy
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which students are unaffected by allergies?
SELECT count(*) FROM has_allergy AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.sex = "F" AND T1.allergy = "Milk" OR T1.allergy = "Eggs"
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many female students have milk or egg allergies?
SELECT count(*) FROM has_allergy AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.sex = "F" AND T1.allergy = "Milk" OR T1.allergy = "Eggs"
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many students who are female are allergic to milk or eggs?
SELECT count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "food"
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many students have a food allergy?
SELECT count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "food"
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many students are affected by food related allergies?
SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY count(*) DESC LIMIT 1
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which allergy has most number of students affected?
SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY count(*) DESC LIMIT 1
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which allergy is the most common?
SELECT Allergy , count(*) FROM Has_allergy GROUP BY Allergy
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Show all allergies with number of students affected.
SELECT Allergy , count(*) FROM Has_allergy GROUP BY Allergy
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many students have each different allergy?
SELECT T2.allergytype , count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy GROUP BY T2.allergytype
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Show all allergy type with number of students affected.
SELECT T2.allergytype , count(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy GROUP BY T2.allergytype
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many students are affected by each allergy type?
SELECT lname , age FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Milk" INTERSECT SELECT StuID FROM Has_allergy WHERE Allergy = "Cat")
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Find the last name and age of the student who has allergy to both milk and cat.
SELECT lname , age FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Milk" INTERSECT SELECT StuID FROM Has_allergy WHERE Allergy = "Cat")
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the last names and ages of the students who are allergic to milk and cat?
SELECT T1.Allergy , T1.AllergyType FROM Allergy_type AS T1 JOIN Has_allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = "Lisa" ORDER BY T1.Allergy
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the allergies and their types that the student with first name Lisa has? And order the result by name of allergies.
SELECT T1.Allergy , T1.AllergyType FROM Allergy_type AS T1 JOIN Has_allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = "Lisa" ORDER BY T1.Allergy
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the allergies the girl named Lisa has? And what are the types of them? Order the result by allergy names.
SELECT fname , sex FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Milk" EXCEPT SELECT StuID FROM Has_allergy WHERE Allergy = "Cat")
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Find the first name and gender of the student who has allergy to milk but not cat.
SELECT fname , sex FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Milk" EXCEPT SELECT StuID FROM Has_allergy WHERE Allergy = "Cat")
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the first name and gender of the students who have allergy to milk but can put up with cats?
SELECT avg(age) FROM Student WHERE StuID IN ( SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food" INTERSECT SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "animal")
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Find the average age of the students who have allergies with food and animal types.
SELECT avg(age) FROM Student WHERE StuID IN ( SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food" INTERSECT SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "animal")
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How old are the students with allergies to food and animal types on average?
SELECT fname , lname FROM Student WHERE StuID NOT IN (SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food")
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. List the first and last name of the students who do not have any food type allergy.
SELECT fname , lname FROM Student WHERE StuID NOT IN (SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food")
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the full name of each student who is not allergic to any type of food.
SELECT count(*) FROM Student WHERE sex = "M" AND StuID IN (SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food")
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Find the number of male (sex is 'M') students who have some food type allery.
SELECT count(*) FROM Student WHERE sex = "M" AND StuID IN (SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food")
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many male students (sex is 'M') are allergic to any type of food?
SELECT DISTINCT T1.fname , T1.city_code FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.stuid = T2.stuid WHERE T2.Allergy = "Milk" OR T2.Allergy = "Cat"
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Find the different first names and cities of the students who have allergy to milk or cat.
SELECT DISTINCT T1.fname , T1.city_code FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.stuid = T2.stuid WHERE T2.Allergy = "Milk" OR T2.Allergy = "Cat"
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the distinct first names and cities of the students who have allergy either to milk or to cat?
SELECT count(*) FROM Student WHERE age > 18 AND StuID NOT IN ( SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food" OR T2.allergytype = "animal")
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Find the number of students who are older than 18 and do not have allergy to either food or animal.
SELECT count(*) FROM Student WHERE age > 18 AND StuID NOT IN ( SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food" OR T2.allergytype = "animal")
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many students are over 18 and do not have allergy to food type or animal type?
SELECT fname , major FROM Student WHERE StuID NOT IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Soy")
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Find the first name and major of the students who are not allegry to soy.
SELECT fname , major FROM Student WHERE StuID NOT IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Soy")
Given the Table allergy type having columns as Allergy has datatype text, AllergyType has datatype text which has Allergy and Given the Table has allergy having columns as StuID has datatype number, Allergy has datatype text which has StuID and Given the Table student having columns as StuID has datatype number, LName has datatype text, Fname has datatype text, Age has datatype number, Sex has datatype text, Major has datatype number, Advisor has datatype number, city_code has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the first name and major of the students who are able to consume soy?
SELECT billing_country , COUNT(*) FROM invoices GROUP BY billing_country ORDER BY count(*) DESC LIMIT 5;
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. A list of the top 5 countries by number of invoices. List country name and number of invoices.
SELECT billing_country , COUNT(*) FROM invoices GROUP BY billing_country ORDER BY count(*) DESC LIMIT 5;
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 top 5 countries by number of invoices and how many do they have?
SELECT billing_country , SUM(total) FROM invoices GROUP BY billing_country ORDER BY SUM(total) DESC LIMIT 8;
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. A list of the top 8 countries by gross/total invoice size. List country name and gross invoice size.
SELECT billing_country , SUM(total) FROM invoices GROUP BY billing_country ORDER BY SUM(total) DESC LIMIT 8;
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 top 8 countries by total invoice size and what are those sizes?
SELECT billing_country , AVG(total) FROM invoices GROUP BY billing_country ORDER BY AVG(total) DESC 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. A list of the top 10 countries by average invoice size. List country name and average invoice size.
SELECT billing_country , AVG(total) FROM invoices GROUP BY billing_country ORDER BY AVG(total) DESC 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 names of the countries and average invoice size of the top countries by size?
SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY T2.invoice_date DESC LIMIT 5;
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 out 5 customers who most recently purchased something. List customers' first and last name.
SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY T2.invoice_date DESC LIMIT 5;
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 5 customers who purchased something most recently?
SELECT T1.first_name , T1.last_name , COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC 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. Find out the top 10 customers by total number of orders. List customers' first and last name and the number of total orders.
SELECT T1.first_name , T1.last_name , COUNT(*) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC 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 top 10 customers' first and last names by total number of orders and how many orders did they make?
SELECT T1.first_name , T1.last_name , SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY SUM(T2.total) DESC 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 the top 10 customers by total gross sales. List customers' first and last name and total gross sales.
SELECT T1.first_name , T1.last_name , SUM(T2.total) FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id GROUP BY T1.id ORDER BY SUM(T2.total) DESC 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 top 10 customers' first and last names with the highest gross sales, and also what are the sales?
SELECT T1.name , COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 5;
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 top 5 genres by number of tracks. List genres name and total tracks.
SELECT T1.name , COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 5;
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 does each genre have and what are the names of the top 5?
SELECT title FROM albums;
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 every album's title.
SELECT title FROM albums;
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 titles of all the albums?
SELECT title FROM albums ORDER BY title;
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 every album ordered by album title in ascending order.
SELECT title FROM albums ORDER BY title;
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 titles of all the albums alphabetically ascending?
SELECT title FROM albums WHERE title LIKE 'A%' ORDER BY title;
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 every album whose title starts with A in alphabetical order.
SELECT title FROM albums WHERE title LIKE 'A%' ORDER BY title;
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 titles of all albums that start with A in alphabetical order?
SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY total 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 the customers first and last name of 10 least expensive invoices.
SELECT T1.first_name , T1.last_name FROM customers AS T1 JOIN invoices AS T2 ON T2.customer_id = T1.id ORDER BY total 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 customers with the 10 cheapest invoices?
SELECT sum(total) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL";
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 total amount of invoice from Chicago, IL.
SELECT sum(total) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL";
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 total amount of money in the invoices billed from Chicago, Illinois?
SELECT COUNT(*) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL";
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 number of invoices from Chicago, IL.
SELECT COUNT(*) FROM invoices WHERE billing_city = "Chicago" AND billing_state = "IL";
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 invoices were billed from Chicago, IL?
SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state;
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 number of invoices from the US, grouped by state.
SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state;
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 invoices were billed from each state?
SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY COUNT(*) 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. List the state in the US with the most invoices.
SELECT billing_state , COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY COUNT(*) 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 states with the most invoices?
SELECT billing_state , COUNT(*) , SUM(total) FROM invoices WHERE billing_state = "CA";
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 number of invoices and the invoice total from California.
SELECT billing_state , COUNT(*) , SUM(total) FROM invoices WHERE billing_state = "CA";
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 number of invoices and total money billed in them from CA?
SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Aerosmith";
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 Aerosmith's albums.
SELECT T1.title FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Aerosmith";
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 titles of all the Aerosmith albums?
SELECT count(*) FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Billy Cobham";
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 albums does Billy Cobham has?
SELECT count(*) FROM albums AS T1 JOIN artists AS T2 ON T1.artist_id = T2.id WHERE T2.name = "Billy Cobham";
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 albums has Billy Cobam released?
SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins";
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. Eduardo Martins is a customer at which company?
SELECT company FROM customers WHERE first_name = "Eduardo" AND last_name = "Martins";
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 company where Eduardo Martins is a customer?
SELECT email , phone FROM customers WHERE first_name = "Astrid" AND last_name = "Gruber";
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 Astrid Gruber's email and phone number?
SELECT email , phone FROM customers WHERE first_name = "Astrid" AND last_name = "Gruber";
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 email and phone number of Astrid Gruber the customer?
SELECT count(*) FROM customers WHERE city = "Prague";
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 customers live in Prague city?
SELECT count(*) FROM customers WHERE city = "Prague";
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 customers live in the city of Prague?
SELECT count(*) FROM customers WHERE state = "CA";
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 customers in state of CA?
SELECT count(*) FROM customers WHERE state = "CA";
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 customers are from California?
SELECT country FROM customers WHERE first_name = "Roberto" AND last_name = "Almeida";
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 country does Roberto Almeida live?
SELECT country FROM customers WHERE first_name = "Roberto" AND last_name = "Almeida";
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. In which country does Roberto Almeida?
SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id = T2.artist_id WHERE T1.name LIKE '%Led%'
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 albums that are released by aritist whose name has 'Led'
SELECT T2.title FROM artists AS T1 JOIN albums AS T2 ON T1.id = T2.artist_id WHERE T1.name LIKE '%Led%'
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 title of the album that was released by the artist whose name has the phrase 'Led'?
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";
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 customers does Steve Johnson support?
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";
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 count of customers that Steve Johnson supports?
SELECT title , phone , hire_date FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards";
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 title, phone and hire date of Nancy Edwards?
SELECT title , phone , hire_date FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards";
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 title, phone number and hire date for the employee named Nancy Edwards?
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";
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 full name of employees who report to Nancy Edwards?
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";
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 first and last name of the employee who reports to Nancy Edwards?
SELECT address FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards";
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 address of employee Nancy Edwards?
SELECT address FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards";
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 Nancy Edwards's address?
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
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 full name of employee who supported the most number of customers.
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
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 full name of the employee who has the most customers?
SELECT count(*) FROM employees WHERE country = "Canada";
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 are living in Canada?
SELECT count(*) FROM employees WHERE country = "Canada";
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 live in Canada?
SELECT phone FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards";
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 employee Nancy Edwards's phone number?
SELECT phone FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards";
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 the phone number of Nancy Edwards?
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. Who is the youngest employee in the company? List employee's first and last name.