db_name
stringclasses 146
values | prompt
stringlengths 310
4.81k
|
|---|---|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# Find the name of all students who were in the tryout sorted in alphabetic order.
#
### SQL:
#
# SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID ORDER BY T1.pName
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# What are the names of all students who tried out in alphabetical order?
#
### SQL:
#
# SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID ORDER BY T1.pName
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# Find the name and hours of the students whose tryout decision is yes.
#
### SQL:
#
# SELECT T1.pName , T1.HS FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# What are the names and hours spent practicing of every student who received a yes at tryouts?
#
### SQL:
#
# SELECT T1.pName , T1.HS FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# Find the states of the colleges that have students in the tryout who played in striker position.
#
### SQL:
#
# SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'striker'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# What are the states of the colleges where students who tried out for the striker position attend?
#
### SQL:
#
# SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'striker'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# Find the names of the students who are in the position of striker and got a yes tryout decision.
#
### SQL:
#
# SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes' AND T2.pPos = 'striker'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# What are the names of all students who successfully tried out for the position of striker?
#
### SQL:
#
# SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes' AND T2.pPos = 'striker'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# Find the state of the college which player Charles is attending.
#
### SQL:
#
# SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName JOIN player AS T3 ON T2.pID = T3.pID WHERE T3.pName = 'Charles'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# In which state is the college that Charles attends?
#
### SQL:
#
# SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName JOIN player AS T3 ON T2.pID = T3.pID WHERE T3.pName = 'Charles'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# Find the average and maximum hours for the students whose tryout decision is yes.
#
### SQL:
#
# SELECT avg(T1.HS) , max(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# What is the average and maximum number of hours students who made the team practiced?
#
### SQL:
#
# SELECT avg(T1.HS) , max(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# Find the average hours for the students whose tryout decision is no.
#
### SQL:
#
# SELECT avg(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'no'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# What is the average number of hours spent practicing for students who got rejected?
#
### SQL:
#
# SELECT avg(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'no'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# What is the maximum training hours for the students whose training hours is greater than 1000 in different positions?
#
### SQL:
#
# SELECT max(T1.HS) , pPos FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T1.HS > 1000 GROUP BY T2.pPos
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# For each position, what is the maximum number of hours for students who spent more than 1000 hours training?
#
### SQL:
#
# SELECT max(T1.HS) , pPos FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T1.HS > 1000 GROUP BY T2.pPos
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# Which colleges do the tryout players whose name starts with letter D go to?
#
### SQL:
#
# SELECT T1.cName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T2.pName LIKE 'D%'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# Which colleges does each player with a name that starts with the letter D who tried out go to?
#
### SQL:
#
# SELECT T1.cName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T2.pName LIKE 'D%'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# Which college has any student who is a goalie and succeeded in the tryout.
#
### SQL:
#
# SELECT cName FROM tryout WHERE decision = 'yes' AND pPos = 'goalie'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# What college has a student who successfully made the team in the role of a goalie?
#
### SQL:
#
# SELECT cName FROM tryout WHERE decision = 'yes' AND pPos = 'goalie'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# Find the name of the tryout players who are from the college with largest size.
#
### SQL:
#
# SELECT T2.pName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T1.cName = (SELECT cName FROM college ORDER BY enr DESC LIMIT 1)
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# What are the names of all tryout participants who are from the largest college?
#
### SQL:
#
# SELECT T2.pName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T1.cName = (SELECT cName FROM college ORDER BY enr DESC LIMIT 1)
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# What is the state and enrollment of the colleges where have any students who got accepted in the tryout decision.
#
### SQL:
#
# SELECT DISTINCT T1.state , T1.enr FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# How many students are enrolled in colleges that have student accepted during tryouts, and in which states are those colleges?
#
### SQL:
#
# SELECT DISTINCT T1.state , T1.enr FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# Find the names of either colleges in LA with greater than 15000 size or in state AZ with less than 13000 enrollment.
#
### SQL:
#
# SELECT cName FROM College WHERE enr < 13000 AND state = "AZ" UNION SELECT cName FROM College WHERE enr > 15000 AND state = "LA"
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# What are the names of colleges in LA that have more than 15,000 students and of colleges in AZ with less than 13,000 students?
#
### SQL:
#
# SELECT cName FROM College WHERE enr < 13000 AND state = "AZ" UNION SELECT cName FROM College WHERE enr > 15000 AND state = "LA"
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# Find the names of schools that have some students playing in goalie and mid positions.
#
### SQL:
#
# SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# What are the names of all schools that have students trying out for the position of goal and 'mid'-field.
#
### SQL:
#
# SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# Find the names of states that have some college students playing in goalie and mid positions.
#
### SQL:
#
# SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie' INTERSECT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# What are the names of the states that have some college students playing in the positions of goalie and mid-field?
#
### SQL:
#
# SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie' INTERSECT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# How many schools have some students playing in goalie and mid positions.
#
### SQL:
#
# SELECT COUNT(*) FROM (SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid')
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# How many schools have students playing in goalie and mid-field positions?
#
### SQL:
#
# SELECT COUNT(*) FROM (SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid')
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# Find the names of schools that have some players in the mid position but not in the goalie position.
#
### SQL:
#
# SELECT cName FROM tryout WHERE pPos = 'mid' EXCEPT SELECT cName FROM tryout WHERE pPos = 'goalie'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# What are the names of the schools with some players in the mid position but no goalies?
#
### SQL:
#
# SELECT cName FROM tryout WHERE pPos = 'mid' EXCEPT SELECT cName FROM tryout WHERE pPos = 'goalie'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# Find the names of states that have some college students playing in the mid position but not in the goalie position.
#
### SQL:
#
# SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# What are the names of all the states with college students playing in the mid position but no goalies?
#
### SQL:
#
# SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie'
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# How many states that have some college students playing in the mid position but not in the goalie position.
#
### SQL:
#
# SELECT COUNT(*) FROM (SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie')
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# What is the count of states with college students playing in the mid position but not as goalies?
#
### SQL:
#
# SELECT COUNT(*) FROM (SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie')
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# Find the states where have the colleges whose enrollments are less than the largest size.
#
### SQL:
#
# SELECT DISTINCT state FROM college WHERE enr < (SELECT max(enr) FROM college)
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# What are the states with colleges that have enrollments less than the some other college?
#
### SQL:
#
# SELECT DISTINCT state FROM college WHERE enr < (SELECT max(enr) FROM college)
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# Find names of colleges with enrollment greater than that of some (at least one) college in the FL state.
#
### SQL:
#
# SELECT DISTINCT cName FROM college WHERE enr > (SELECT min(enr) FROM college WHERE state = 'FL')
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# What are the names of the colleges that are larger than at least one college in Florida?
#
### SQL:
#
# SELECT DISTINCT cName FROM college WHERE enr > (SELECT min(enr) FROM college WHERE state = 'FL')
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# Find names of all colleges whose enrollment is greater than that of all colleges in the FL state.
#
### SQL:
#
# SELECT cName FROM college WHERE enr > (SELECT max(enr) FROM college WHERE state = 'FL')
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# What are the names of all colleges with a larger enrollment than the largest college in Florida?
#
### SQL:
#
# SELECT cName FROM college WHERE enr > (SELECT max(enr) FROM college WHERE state = 'FL')
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# What is the total number of enrollment of schools that do not have any goalie player?
#
### SQL:
#
# SELECT sum(enr) FROM college WHERE cName NOT IN (SELECT cName FROM tryout WHERE pPos = "goalie")
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# What is the total number of students enrolled in schools without any goalies?
#
### SQL:
#
# SELECT sum(enr) FROM college WHERE cName NOT IN (SELECT cName FROM tryout WHERE pPos = "goalie")
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# What is the number of states that has some college whose enrollment is larger than the average enrollment?
#
### SQL:
#
# SELECT count(DISTINCT state) FROM college WHERE enr > (SELECT avg(enr) FROM college)
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# How many states have a college with more students than average?
#
### SQL:
#
# SELECT count(DISTINCT state) FROM college WHERE enr > (SELECT avg(enr) FROM college)
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# What is the number of states that has some colleges whose enrollment is smaller than the average enrollment?
#
### SQL:
#
# SELECT count(DISTINCT state) FROM college WHERE enr < (SELECT avg(enr) FROM college)
#
### End.
|
soccer_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# College ( cName, state, enr )
# Player ( pID, pName, yCard, HS )
# Tryout ( pID, cName, pPos, decision )
#
# Tryout.cName can be joined with College.cName
# Tryout.pID can be joined with Player.pID
#
### Question:
#
# How many states have smaller colleges than average?
#
### SQL:
#
# SELECT count(DISTINCT state) FROM college WHERE enr < (SELECT avg(enr) FROM college)
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# How many devices are there?
#
### SQL:
#
# SELECT count(*) FROM device
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# Count the number of devices.
#
### SQL:
#
# SELECT count(*) FROM device
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# List the carriers of devices in ascending alphabetical order.
#
### SQL:
#
# SELECT Carrier FROM device ORDER BY Carrier ASC
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# What are the different carriers for devices, listed in alphabetical order?
#
### SQL:
#
# SELECT Carrier FROM device ORDER BY Carrier ASC
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# What are the carriers of devices whose software platforms are not "Android"?
#
### SQL:
#
# SELECT Carrier FROM device WHERE Software_Platform != 'Android'
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# Return the device carriers that do not have Android as their software platform.
#
### SQL:
#
# SELECT Carrier FROM device WHERE Software_Platform != 'Android'
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# What are the names of shops in ascending order of open year?
#
### SQL:
#
# SELECT Shop_Name FROM shop ORDER BY Open_Year ASC
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# Return the names of shops, ordered by year of opening ascending.
#
### SQL:
#
# SELECT Shop_Name FROM shop ORDER BY Open_Year ASC
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# What is the average quantity of stocks?
#
### SQL:
#
# SELECT avg(Quantity) FROM stock
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# Give the average quantity of stocks.
#
### SQL:
#
# SELECT avg(Quantity) FROM stock
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# What are the names and location of the shops in ascending alphabetical order of name.
#
### SQL:
#
# SELECT Shop_Name , LOCATION FROM shop ORDER BY Shop_Name ASC
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# Return the names and locations of shops, ordered by name in alphabetical order.
#
### SQL:
#
# SELECT Shop_Name , LOCATION FROM shop ORDER BY Shop_Name ASC
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# How many different software platforms are there for devices?
#
### SQL:
#
# SELECT count(DISTINCT Software_Platform) FROM device
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# Count the number of different software platforms.
#
### SQL:
#
# SELECT count(DISTINCT Software_Platform) FROM device
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# List the open date of open year of the shop named "Apple".
#
### SQL:
#
# SELECT Open_Date , Open_Year FROM shop WHERE Shop_Name = "Apple"
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# What are the open dates and years for the shop named Apple?
#
### SQL:
#
# SELECT Open_Date , Open_Year FROM shop WHERE Shop_Name = "Apple"
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# List the name of the shop with the latest open year.
#
### SQL:
#
# SELECT Shop_Name FROM shop ORDER BY Open_Year DESC LIMIT 1
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# What is the shop name corresponding to the shop that opened in the most recent year?
#
### SQL:
#
# SELECT Shop_Name FROM shop ORDER BY Open_Year DESC LIMIT 1
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# Show names of shops and the carriers of devices they have in stock.
#
### SQL:
#
# SELECT T3.Shop_Name , T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# What are the names of device shops, and what are the carriers that they carry devices in stock for?
#
### SQL:
#
# SELECT T3.Shop_Name , T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# Show names of shops that have more than one kind of device in stock.
#
### SQL:
#
# SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID HAVING COUNT(*) > 1
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# What are the names of shops that have more than a single kind of device in stock?
#
### SQL:
#
# SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID HAVING COUNT(*) > 1
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# Show the name of the shop that has the most kind of devices in stock.
#
### SQL:
#
# SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY COUNT(*) DESC LIMIT 1
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# What is the name of the shop that has the most different kinds of devices in stock?
#
### SQL:
#
# SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY COUNT(*) DESC LIMIT 1
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# Show the name of the shop that have the largest quantity of devices in stock.
#
### SQL:
#
# SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY SUM(T1.quantity) DESC LIMIT 1
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# What is the name of the shop that has the greatest quantity of devices in stock?
#
### SQL:
#
# SELECT T2.Shop_Name FROM stock AS T1 JOIN shop AS T2 ON T1.Shop_ID = T2.Shop_ID GROUP BY T1.Shop_ID ORDER BY SUM(T1.quantity) DESC LIMIT 1
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# Please show different software platforms and the corresponding number of devices using each.
#
### SQL:
#
# SELECT Software_Platform , COUNT(*) FROM device GROUP BY Software_Platform
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# What are the different software platforms for devices, and how many devices have each?
#
### SQL:
#
# SELECT Software_Platform , COUNT(*) FROM device GROUP BY Software_Platform
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# Please show the software platforms of devices in descending order of the count.
#
### SQL:
#
# SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# What are the different software platforms for devices, ordered by frequency descending?
#
### SQL:
#
# SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# List the software platform shared by the greatest number of devices.
#
### SQL:
#
# SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC LIMIT 1
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# What is the software platform that is most common amongst all devices?
#
### SQL:
#
# SELECT Software_Platform FROM device GROUP BY Software_Platform ORDER BY COUNT(*) DESC LIMIT 1
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# List the names of shops that have no devices in stock.
#
### SQL:
#
# SELECT Shop_Name FROM shop WHERE Shop_ID NOT IN (SELECT Shop_ID FROM stock)
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# What are the names of shops that do not have any devices in stock?
#
### SQL:
#
# SELECT Shop_Name FROM shop WHERE Shop_ID NOT IN (SELECT Shop_ID FROM stock)
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# Show the locations shared by shops with open year later than 2012 and shops with open year before 2008.
#
### SQL:
#
# SELECT LOCATION FROM shop WHERE Open_Year > 2012 INTERSECT SELECT LOCATION FROM shop WHERE Open_Year < 2008
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# Which locations contains both shops that opened after the year 2012 and shops that opened before 2008?
#
### SQL:
#
# SELECT LOCATION FROM shop WHERE Open_Year > 2012 INTERSECT SELECT LOCATION FROM shop WHERE Open_Year < 2008
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# List the carriers of devices that have no devices in stock.
#
### SQL:
#
# SELECT Carrier FROM device WHERE Device_ID NOT IN (SELECT Device_ID FROM stock)
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# What are the carriers of devices that are not in stock anywhere?
#
### SQL:
#
# SELECT Carrier FROM device WHERE Device_ID NOT IN (SELECT Device_ID FROM stock)
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# Show the carriers of devices in stock at more than one shop.
#
### SQL:
#
# SELECT T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID GROUP BY T1.Device_ID HAVING COUNT(*) > 1
#
### End.
|
device
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# device ( Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform )
# shop ( Shop_ID, Shop_Name, Location, Open_Date, Open_Year )
# stock ( Shop_ID, Device_ID, Quantity )
#
# stock.Device_ID can be joined with device.Device_ID
# stock.Shop_ID can be joined with shop.Shop_ID
#
### Question:
#
# What are the carriers of devices that are in stock in more than a single shop?
#
### SQL:
#
# SELECT T2.Carrier FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID GROUP BY T1.Device_ID HAVING COUNT(*) > 1
#
### End.
|
cre_Drama_Workshop_Groups
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Payment_Methods ( payment_method_code, payment_method_description )
# Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description )
# Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details )
# Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details )
# Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details )
# Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details )
# Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details )
# Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details )
# Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details )
# Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details )
# Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details )
# Performers_in_Bookings ( Order_ID, Performer_ID )
# Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details )
# Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details )
# Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID )
# Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details )
# Bookings_Services ( Order_ID, Product_ID )
# Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details )
#
# Clients.Address_ID can be joined with Addresses.Address_ID
# Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID
# Performers.Address_ID can be joined with Addresses.Address_ID
# Customers.Address_ID can be joined with Addresses.Address_ID
# Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code
# Stores.Address_ID can be joined with Addresses.Address_ID
# Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID
# Bookings.Customer_ID can be joined with Clients.Client_ID
# Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID
# Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID
# Customer_Orders.Store_ID can be joined with Stores.Store_ID
# Customer_Orders.Customer_ID can be joined with Customers.Customer_ID
# Order_Items.Product_ID can be joined with Products.Product_ID
# Order_Items.Order_ID can be joined with Customer_Orders.Order_ID
# Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code
# Invoices.Order_ID can be joined with Bookings.Booking_ID
# Invoices.Order_ID can be joined with Customer_Orders.Order_ID
# Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code
# Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID
# Bookings_Services.Product_ID can be joined with Services.Service_ID
# Bookings_Services.Order_ID can be joined with Bookings.Booking_ID
# Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID
# Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID
# Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID
# Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID
#
### Question:
#
# How many bookings do we have?
#
### SQL:
#
# SELECT count(*) FROM BOOKINGS
#
### End.
|
cre_Drama_Workshop_Groups
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Payment_Methods ( payment_method_code, payment_method_description )
# Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description )
# Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details )
# Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details )
# Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details )
# Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details )
# Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details )
# Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details )
# Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details )
# Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details )
# Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details )
# Performers_in_Bookings ( Order_ID, Performer_ID )
# Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details )
# Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details )
# Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID )
# Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details )
# Bookings_Services ( Order_ID, Product_ID )
# Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details )
#
# Clients.Address_ID can be joined with Addresses.Address_ID
# Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID
# Performers.Address_ID can be joined with Addresses.Address_ID
# Customers.Address_ID can be joined with Addresses.Address_ID
# Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code
# Stores.Address_ID can be joined with Addresses.Address_ID
# Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID
# Bookings.Customer_ID can be joined with Clients.Client_ID
# Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID
# Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID
# Customer_Orders.Store_ID can be joined with Stores.Store_ID
# Customer_Orders.Customer_ID can be joined with Customers.Customer_ID
# Order_Items.Product_ID can be joined with Products.Product_ID
# Order_Items.Order_ID can be joined with Customer_Orders.Order_ID
# Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code
# Invoices.Order_ID can be joined with Bookings.Booking_ID
# Invoices.Order_ID can be joined with Customer_Orders.Order_ID
# Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code
# Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID
# Bookings_Services.Product_ID can be joined with Services.Service_ID
# Bookings_Services.Order_ID can be joined with Bookings.Booking_ID
# Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID
# Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID
# Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID
# Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID
#
### Question:
#
# Count the total number of bookings made.
#
### SQL:
#
# SELECT count(*) FROM BOOKINGS
#
### End.
|
cre_Drama_Workshop_Groups
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Payment_Methods ( payment_method_code, payment_method_description )
# Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description )
# Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details )
# Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details )
# Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details )
# Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details )
# Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details )
# Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details )
# Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details )
# Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details )
# Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details )
# Performers_in_Bookings ( Order_ID, Performer_ID )
# Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details )
# Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details )
# Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID )
# Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details )
# Bookings_Services ( Order_ID, Product_ID )
# Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details )
#
# Clients.Address_ID can be joined with Addresses.Address_ID
# Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID
# Performers.Address_ID can be joined with Addresses.Address_ID
# Customers.Address_ID can be joined with Addresses.Address_ID
# Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code
# Stores.Address_ID can be joined with Addresses.Address_ID
# Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID
# Bookings.Customer_ID can be joined with Clients.Client_ID
# Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID
# Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID
# Customer_Orders.Store_ID can be joined with Stores.Store_ID
# Customer_Orders.Customer_ID can be joined with Customers.Customer_ID
# Order_Items.Product_ID can be joined with Products.Product_ID
# Order_Items.Order_ID can be joined with Customer_Orders.Order_ID
# Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code
# Invoices.Order_ID can be joined with Bookings.Booking_ID
# Invoices.Order_ID can be joined with Customer_Orders.Order_ID
# Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code
# Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID
# Bookings_Services.Product_ID can be joined with Services.Service_ID
# Bookings_Services.Order_ID can be joined with Bookings.Booking_ID
# Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID
# Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID
# Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID
# Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID
#
### Question:
#
# List the order dates of all the bookings.
#
### SQL:
#
# SELECT Order_Date FROM BOOKINGS
#
### End.
|
cre_Drama_Workshop_Groups
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Payment_Methods ( payment_method_code, payment_method_description )
# Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description )
# Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details )
# Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details )
# Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details )
# Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details )
# Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details )
# Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details )
# Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details )
# Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details )
# Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details )
# Performers_in_Bookings ( Order_ID, Performer_ID )
# Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details )
# Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details )
# Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID )
# Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details )
# Bookings_Services ( Order_ID, Product_ID )
# Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details )
#
# Clients.Address_ID can be joined with Addresses.Address_ID
# Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID
# Performers.Address_ID can be joined with Addresses.Address_ID
# Customers.Address_ID can be joined with Addresses.Address_ID
# Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code
# Stores.Address_ID can be joined with Addresses.Address_ID
# Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID
# Bookings.Customer_ID can be joined with Clients.Client_ID
# Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID
# Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID
# Customer_Orders.Store_ID can be joined with Stores.Store_ID
# Customer_Orders.Customer_ID can be joined with Customers.Customer_ID
# Order_Items.Product_ID can be joined with Products.Product_ID
# Order_Items.Order_ID can be joined with Customer_Orders.Order_ID
# Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code
# Invoices.Order_ID can be joined with Bookings.Booking_ID
# Invoices.Order_ID can be joined with Customer_Orders.Order_ID
# Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code
# Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID
# Bookings_Services.Product_ID can be joined with Services.Service_ID
# Bookings_Services.Order_ID can be joined with Bookings.Booking_ID
# Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID
# Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID
# Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID
# Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID
#
### Question:
#
# What is the order date of each booking?
#
### SQL:
#
# SELECT Order_Date FROM BOOKINGS
#
### End.
|
cre_Drama_Workshop_Groups
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Payment_Methods ( payment_method_code, payment_method_description )
# Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description )
# Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details )
# Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details )
# Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details )
# Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details )
# Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details )
# Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details )
# Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details )
# Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details )
# Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details )
# Performers_in_Bookings ( Order_ID, Performer_ID )
# Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details )
# Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details )
# Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID )
# Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details )
# Bookings_Services ( Order_ID, Product_ID )
# Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details )
#
# Clients.Address_ID can be joined with Addresses.Address_ID
# Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID
# Performers.Address_ID can be joined with Addresses.Address_ID
# Customers.Address_ID can be joined with Addresses.Address_ID
# Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code
# Stores.Address_ID can be joined with Addresses.Address_ID
# Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID
# Bookings.Customer_ID can be joined with Clients.Client_ID
# Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID
# Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID
# Customer_Orders.Store_ID can be joined with Stores.Store_ID
# Customer_Orders.Customer_ID can be joined with Customers.Customer_ID
# Order_Items.Product_ID can be joined with Products.Product_ID
# Order_Items.Order_ID can be joined with Customer_Orders.Order_ID
# Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code
# Invoices.Order_ID can be joined with Bookings.Booking_ID
# Invoices.Order_ID can be joined with Customer_Orders.Order_ID
# Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code
# Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID
# Bookings_Services.Product_ID can be joined with Services.Service_ID
# Bookings_Services.Order_ID can be joined with Bookings.Booking_ID
# Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID
# Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID
# Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID
# Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID
#
### Question:
#
# Show all the planned delivery dates and actual delivery dates of bookings.
#
### SQL:
#
# SELECT Planned_Delivery_Date , Actual_Delivery_Date FROM BOOKINGS
#
### End.
|
cre_Drama_Workshop_Groups
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Payment_Methods ( payment_method_code, payment_method_description )
# Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description )
# Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details )
# Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details )
# Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details )
# Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details )
# Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details )
# Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details )
# Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details )
# Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details )
# Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details )
# Performers_in_Bookings ( Order_ID, Performer_ID )
# Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details )
# Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details )
# Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID )
# Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details )
# Bookings_Services ( Order_ID, Product_ID )
# Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details )
#
# Clients.Address_ID can be joined with Addresses.Address_ID
# Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID
# Performers.Address_ID can be joined with Addresses.Address_ID
# Customers.Address_ID can be joined with Addresses.Address_ID
# Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code
# Stores.Address_ID can be joined with Addresses.Address_ID
# Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID
# Bookings.Customer_ID can be joined with Clients.Client_ID
# Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID
# Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID
# Customer_Orders.Store_ID can be joined with Stores.Store_ID
# Customer_Orders.Customer_ID can be joined with Customers.Customer_ID
# Order_Items.Product_ID can be joined with Products.Product_ID
# Order_Items.Order_ID can be joined with Customer_Orders.Order_ID
# Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code
# Invoices.Order_ID can be joined with Bookings.Booking_ID
# Invoices.Order_ID can be joined with Customer_Orders.Order_ID
# Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code
# Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID
# Bookings_Services.Product_ID can be joined with Services.Service_ID
# Bookings_Services.Order_ID can be joined with Bookings.Booking_ID
# Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID
# Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID
# Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID
# Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID
#
### Question:
#
# What are the planned delivery date and actual delivery date for each booking?
#
### SQL:
#
# SELECT Planned_Delivery_Date , Actual_Delivery_Date FROM BOOKINGS
#
### End.
|
cre_Drama_Workshop_Groups
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Payment_Methods ( payment_method_code, payment_method_description )
# Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description )
# Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details )
# Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details )
# Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details )
# Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details )
# Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details )
# Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details )
# Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details )
# Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details )
# Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details )
# Performers_in_Bookings ( Order_ID, Performer_ID )
# Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details )
# Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details )
# Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID )
# Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details )
# Bookings_Services ( Order_ID, Product_ID )
# Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details )
#
# Clients.Address_ID can be joined with Addresses.Address_ID
# Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID
# Performers.Address_ID can be joined with Addresses.Address_ID
# Customers.Address_ID can be joined with Addresses.Address_ID
# Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code
# Stores.Address_ID can be joined with Addresses.Address_ID
# Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID
# Bookings.Customer_ID can be joined with Clients.Client_ID
# Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID
# Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID
# Customer_Orders.Store_ID can be joined with Stores.Store_ID
# Customer_Orders.Customer_ID can be joined with Customers.Customer_ID
# Order_Items.Product_ID can be joined with Products.Product_ID
# Order_Items.Order_ID can be joined with Customer_Orders.Order_ID
# Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code
# Invoices.Order_ID can be joined with Bookings.Booking_ID
# Invoices.Order_ID can be joined with Customer_Orders.Order_ID
# Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code
# Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID
# Bookings_Services.Product_ID can be joined with Services.Service_ID
# Bookings_Services.Order_ID can be joined with Bookings.Booking_ID
# Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID
# Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID
# Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID
# Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID
#
### Question:
#
# How many customers do we have?
#
### SQL:
#
# SELECT count(*) FROM CUSTOMERS
#
### End.
|
cre_Drama_Workshop_Groups
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Payment_Methods ( payment_method_code, payment_method_description )
# Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description )
# Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details )
# Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details )
# Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details )
# Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details )
# Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details )
# Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details )
# Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details )
# Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details )
# Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details )
# Performers_in_Bookings ( Order_ID, Performer_ID )
# Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details )
# Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details )
# Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID )
# Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details )
# Bookings_Services ( Order_ID, Product_ID )
# Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details )
#
# Clients.Address_ID can be joined with Addresses.Address_ID
# Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID
# Performers.Address_ID can be joined with Addresses.Address_ID
# Customers.Address_ID can be joined with Addresses.Address_ID
# Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code
# Stores.Address_ID can be joined with Addresses.Address_ID
# Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID
# Bookings.Customer_ID can be joined with Clients.Client_ID
# Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID
# Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID
# Customer_Orders.Store_ID can be joined with Stores.Store_ID
# Customer_Orders.Customer_ID can be joined with Customers.Customer_ID
# Order_Items.Product_ID can be joined with Products.Product_ID
# Order_Items.Order_ID can be joined with Customer_Orders.Order_ID
# Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code
# Invoices.Order_ID can be joined with Bookings.Booking_ID
# Invoices.Order_ID can be joined with Customer_Orders.Order_ID
# Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code
# Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID
# Bookings_Services.Product_ID can be joined with Services.Service_ID
# Bookings_Services.Order_ID can be joined with Bookings.Booking_ID
# Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID
# Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID
# Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID
# Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID
#
### Question:
#
# Count the number of customers recorded.
#
### SQL:
#
# SELECT count(*) FROM CUSTOMERS
#
### End.
|
cre_Drama_Workshop_Groups
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Payment_Methods ( payment_method_code, payment_method_description )
# Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description )
# Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details )
# Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details )
# Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details )
# Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details )
# Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details )
# Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details )
# Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details )
# Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details )
# Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details )
# Performers_in_Bookings ( Order_ID, Performer_ID )
# Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details )
# Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details )
# Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID )
# Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details )
# Bookings_Services ( Order_ID, Product_ID )
# Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details )
#
# Clients.Address_ID can be joined with Addresses.Address_ID
# Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID
# Performers.Address_ID can be joined with Addresses.Address_ID
# Customers.Address_ID can be joined with Addresses.Address_ID
# Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code
# Stores.Address_ID can be joined with Addresses.Address_ID
# Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID
# Bookings.Customer_ID can be joined with Clients.Client_ID
# Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID
# Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID
# Customer_Orders.Store_ID can be joined with Stores.Store_ID
# Customer_Orders.Customer_ID can be joined with Customers.Customer_ID
# Order_Items.Product_ID can be joined with Products.Product_ID
# Order_Items.Order_ID can be joined with Customer_Orders.Order_ID
# Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code
# Invoices.Order_ID can be joined with Bookings.Booking_ID
# Invoices.Order_ID can be joined with Customer_Orders.Order_ID
# Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code
# Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID
# Bookings_Services.Product_ID can be joined with Services.Service_ID
# Bookings_Services.Order_ID can be joined with Bookings.Booking_ID
# Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID
# Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID
# Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID
# Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID
#
### Question:
#
# What are the phone and email for customer Harold?
#
### SQL:
#
# SELECT Customer_Phone , Customer_Email_Address FROM CUSTOMERS WHERE Customer_Name = "Harold"
#
### End.
|
cre_Drama_Workshop_Groups
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Payment_Methods ( payment_method_code, payment_method_description )
# Ref_Service_Types ( Service_Type_Code, Parent_Service_Type_Code, Service_Type_Description )
# Addresses ( Address_ID, Line_1, Line_2, City_Town, State_County, Other_Details )
# Products ( Product_ID, Product_Name, Product_Price, Product_Description, Other_Product_Service_Details )
# Marketing_Regions ( Marketing_Region_Code, Marketing_Region_Name, Marketing_Region_Descriptrion, Other_Details )
# Clients ( Client_ID, Address_ID, Customer_Email_Address, Customer_Name, Customer_Phone, Other_Details )
# Drama_Workshop_Groups ( Workshop_Group_ID, Address_ID, Currency_Code, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details )
# Performers ( Performer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details )
# Customers ( Customer_ID, Address_ID, Customer_Name, Customer_Phone, Customer_Email_Address, Other_Details )
# Stores ( Store_ID, Address_ID, Marketing_Region_Code, Store_Name, Store_Phone, Store_Email_Address, Other_Details )
# Bookings ( Booking_ID, Customer_ID, Workshop_Group_ID, Status_Code, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details )
# Performers_in_Bookings ( Order_ID, Performer_ID )
# Customer_Orders ( Order_ID, Customer_ID, Store_ID, Order_Date, Planned_Delivery_Date, Actual_Delivery_Date, Other_Order_Details )
# Order_Items ( Order_Item_ID, Order_ID, Product_ID, Order_Quantity, Other_Item_Details )
# Invoices ( Invoice_ID, Order_ID, payment_method_code, Product_ID, Order_Quantity, Other_Item_Details, Order_Item_ID )
# Services ( Service_ID, Service_Type_Code, Workshop_Group_ID, Product_Description, Product_Name, Product_Price, Other_Product_Service_Details )
# Bookings_Services ( Order_ID, Product_ID )
# Invoice_Items ( Invoice_Item_ID, Invoice_ID, Order_ID, Order_Item_ID, Product_ID, Order_Quantity, Other_Item_Details )
#
# Clients.Address_ID can be joined with Addresses.Address_ID
# Drama_Workshop_Groups.Address_ID can be joined with Addresses.Address_ID
# Performers.Address_ID can be joined with Addresses.Address_ID
# Customers.Address_ID can be joined with Addresses.Address_ID
# Stores.Marketing_Region_Code can be joined with Marketing_Regions.Marketing_Region_Code
# Stores.Address_ID can be joined with Addresses.Address_ID
# Bookings.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID
# Bookings.Customer_ID can be joined with Clients.Client_ID
# Performers_in_Bookings.Order_ID can be joined with Bookings.Booking_ID
# Performers_in_Bookings.Performer_ID can be joined with Performers.Performer_ID
# Customer_Orders.Store_ID can be joined with Stores.Store_ID
# Customer_Orders.Customer_ID can be joined with Customers.Customer_ID
# Order_Items.Product_ID can be joined with Products.Product_ID
# Order_Items.Order_ID can be joined with Customer_Orders.Order_ID
# Invoices.payment_method_code can be joined with Ref_Payment_Methods.payment_method_code
# Invoices.Order_ID can be joined with Bookings.Booking_ID
# Invoices.Order_ID can be joined with Customer_Orders.Order_ID
# Services.Service_Type_Code can be joined with Ref_Service_Types.Service_Type_Code
# Services.Workshop_Group_ID can be joined with Drama_Workshop_Groups.Workshop_Group_ID
# Bookings_Services.Product_ID can be joined with Services.Service_ID
# Bookings_Services.Order_ID can be joined with Bookings.Booking_ID
# Invoice_Items.Order_ID can be joined with Bookings_Services.Order_ID
# Invoice_Items.Product_ID can be joined with Bookings_Services.Product_ID
# Invoice_Items.Invoice_ID can be joined with Invoices.Invoice_ID
# Invoice_Items.Order_Item_ID can be joined with Order_Items.Order_Item_ID
#
### Question:
#
# Find the phone number and email address of customer "Harold".
#
### SQL:
#
# SELECT Customer_Phone , Customer_Email_Address FROM CUSTOMERS WHERE Customer_Name = "Harold"
#
### End.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.