db_id
stringclasses
31 values
schema
stringclasses
22 values
schemaComEx
stringclasses
22 values
question
stringlengths
18
181
query
stringlengths
20
577
answer
stringlengths
14
41.7k
complexity
stringclasses
4 values
distinct
bool
2 classes
like
bool
2 classes
between
bool
2 classes
order_by
bool
2 classes
limit
bool
2 classes
grouby_by
bool
2 classes
having
bool
2 classes
single_join
bool
2 classes
multiple_join
bool
2 classes
multiple_select
bool
2 classes
intersect
bool
2 classes
except
bool
2 classes
union
bool
2 classes
flight_1
null
null
Show names for all aircrafts with distances more than the average.
SELECT name FROM Aircraft WHERE distance > (SELECT avg(distance) FROM Aircraft)
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What are the names of all aircrafts that can cover more distances than average?
SELECT name FROM Aircraft WHERE distance > (SELECT avg(distance) FROM Aircraft)
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
How many employees do we have?
SELECT count(*) FROM Employee
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the number of employees?
SELECT count(*) FROM Employee
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show name and salary for all employees sorted by salary.
SELECT name , salary FROM Employee ORDER BY salary
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the name and salary of all employees in order of salary?
SELECT name , salary FROM Employee ORDER BY salary
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show ids for all employees with at least 100000 salary.
SELECT eid FROM Employee WHERE salary > 100000
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the id of every employee who has at least a salary of 100000?
SELECT eid FROM Employee WHERE salary > 100000
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
How many employees have salary between 100000 and 200000?
SELECT count(*) FROM Employee WHERE salary BETWEEN 100000 AND 200000
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the number of employees that have a salary between 100000 and 200000?
SELECT count(*) FROM Employee WHERE salary BETWEEN 100000 AND 200000
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the name and salary for employee with id 242518965?
SELECT name , salary FROM Employee WHERE eid = 242518965
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the name and salary of the employee with the id 242518965?
SELECT name , salary FROM Employee WHERE eid = 242518965
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is average and maximum salary of all employees.
SELECT avg(salary) , max(salary) FROM Employee
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the average and largest salary of all employees?
SELECT avg(salary) , max(salary) FROM Employee
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show the id and name of the employee with maximum salary.
SELECT eid , name FROM Employee ORDER BY salary DESC LIMIT 1
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the id and name of the employee with the highest salary?
SELECT eid , name FROM Employee ORDER BY salary DESC LIMIT 1
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show the name of employees with three lowest salaries.
SELECT name FROM Employee ORDER BY salary ASC LIMIT 3
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the name of the 3 employees who get paid the least?
SELECT name FROM Employee ORDER BY salary ASC LIMIT 3
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show names for all employees with salary more than the average.
SELECT name FROM Employee WHERE salary > (SELECT avg(salary) FROM Employee)
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What are the names of all employees who have a salary higher than average?
SELECT name FROM Employee WHERE salary > (SELECT avg(salary) FROM Employee)
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show the id and salary of Mark Young.
SELECT eid , salary FROM Employee WHERE name = 'Mark Young'
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the id and salary of the employee named Mark Young?
SELECT eid , salary FROM Employee WHERE name = 'Mark Young'
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
How many flights do we have?
SELECT count(*) FROM Flight
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the number of flights?
SELECT count(*) FROM Flight
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show flight number, origin, destination of all flights in the alphabetical order of the departure cities.
SELECT flno , origin , destination FROM Flight ORDER BY origin
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the flight number, origin, and destination for all flights in alphabetical order by departure cities?
SELECT flno , origin , destination FROM Flight ORDER BY origin
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show all flight number from Los Angeles.
SELECT flno FROM Flight WHERE origin = "Los Angeles"
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What are the numbers of all flights coming from Los Angeles?
SELECT flno FROM Flight WHERE origin = "Los Angeles"
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show origins of all flights with destination Honolulu.
SELECT origin FROM Flight WHERE destination = "Honolulu"
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What are the origins of all flights that are headed to Honolulu?
SELECT origin FROM Flight WHERE destination = "Honolulu"
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show me the departure date and arrival date for all flights from Los Angeles to Honolulu.
SELECT departure_date , arrival_date FROM Flight WHERE origin = "Los Angeles" AND destination = "Honolulu"
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What are the departure and arrival dates of all flights from LA to Honolulu?
SELECT departure_date , arrival_date FROM Flight WHERE origin = "Los Angeles" AND destination = "Honolulu"
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show flight number for all flights with more than 2000 distance.
SELECT flno FROM Flight WHERE distance > 2000
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What are the numbers of all flights that can cover a distance of more than 2000?
SELECT flno FROM Flight WHERE distance > 2000
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the average price for flights from Los Angeles to Honolulu.
SELECT avg(price) FROM Flight WHERE origin = "Los Angeles" AND destination = "Honolulu"
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the average price for flights from LA to Honolulu?
SELECT avg(price) FROM Flight WHERE origin = "Los Angeles" AND destination = "Honolulu"
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show origin and destination for flights with price higher than 300.
SELECT origin , destination FROM Flight WHERE price > 300
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the origin and destination for all flights whose price is higher than 300?
SELECT origin , destination FROM Flight WHERE price > 300
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show the flight number and distance of the flight with maximum price.
SELECT flno , distance FROM Flight ORDER BY price DESC LIMIT 1
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the flight number and its distance for the one with the maximum price?
SELECT flno , distance FROM Flight ORDER BY price DESC LIMIT 1
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show the flight number of flights with three lowest distances.
SELECT flno FROM Flight ORDER BY distance ASC LIMIT 3
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What are the numbers of the shortest flights?
SELECT flno FROM Flight ORDER BY distance ASC LIMIT 3
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the average distance and average price for flights from Los Angeles.
SELECT avg(distance) , avg(price) FROM Flight WHERE origin = "Los Angeles"
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the average distance and price for all flights from LA?
SELECT avg(distance) , avg(price) FROM Flight WHERE origin = "Los Angeles"
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show all origins and the number of flights from each origin.
SELECT origin , count(*) FROM Flight GROUP BY origin
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
For each origin, how many flights came from there?
SELECT origin , count(*) FROM Flight GROUP BY origin
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show all destinations and the number of flights to each destination.
SELECT destination , count(*) FROM Flight GROUP BY destination
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What are the destinations and number of flights to each one?
SELECT destination , count(*) FROM Flight GROUP BY destination
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Which origin has most number of flights?
SELECT origin FROM Flight GROUP BY origin ORDER BY count(*) DESC LIMIT 1
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What place has the most flights coming from there?
SELECT origin FROM Flight GROUP BY origin ORDER BY count(*) DESC LIMIT 1
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Which destination has least number of flights?
SELECT destination FROM Flight GROUP BY destination ORDER BY count(*) LIMIT 1
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What destination has the fewest number of flights?
SELECT destination FROM Flight GROUP BY destination ORDER BY count(*) LIMIT 1
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the aircraft name for the flight with number 99
SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the name of the aircraft that was on flight number 99?
SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show all flight numbers with aircraft Airbus A340-300.
SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = "Airbus A340-300"
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What are the flight numbers for the aircraft Airbus A340-300?
SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = "Airbus A340-300"
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show aircraft names and number of flights for each aircraft.
SELECT T2.name , count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the name of each aircraft and how many flights does each one complete?
SELECT T2.name , count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show names for all aircraft with at least two flights.
SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING count(*) >= 2
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What are the names for all aircrafts with at least 2 flights?
SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING count(*) >= 2
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
How many employees have certificate.
SELECT count(DISTINCT eid) FROM Certificate
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the count of distinct employees with certificates?
SELECT count(DISTINCT eid) FROM Certificate
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show ids for all employees who don't have a certificate.
SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What are the ids of all employees that don't have certificates?
SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show names for all aircrafts of which John Williams has certificates.
SELECT T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T1.name = "John Williams"
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What are the names of all aircrafts that John Williams have certificates to be able to fly?
SELECT T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T1.name = "John Williams"
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show names for all employees who have certificate of Boeing 737-800.
SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800"
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What are the names of all employees who have a certificate to fly Boeing 737-800?
SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800"
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show names for all employees who have certificates on both Boeing 737-800 and Airbus A340-300.
SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800" INTERSECT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Airbus A340-300"
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What are the names of all employees who can fly both the Boeing 737-800 and the Airbus A340-300?
SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800" INTERSECT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Airbus A340-300"
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show names for all employees who do not have certificate of Boeing 737-800.
SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800"
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What are the names of all employees who are not certified to fly Boeing 737-800s?
SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800"
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show the name of aircraft which fewest people have its certificate.
SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid GROUP BY T1.aid ORDER BY count(*) DESC LIMIT 1
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What are the names of the aircraft that the least people are certified to fly?
SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid GROUP BY T1.aid ORDER BY count(*) DESC LIMIT 1
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
Show the name and distance of the aircrafts with more than 5000 distance and which at least 5 people have its certificate.
SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid WHERE T2.distance > 5000 GROUP BY T1.aid ORDER BY count(*) >= 5
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the name and distance of every aircraft that can cover a distance of more than 5000 and which at least 5 people can fly?
SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid WHERE T2.distance > 5000 GROUP BY T1.aid ORDER BY count(*) >= 5
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
what is the salary and name of the employee who has the most number of aircraft certificates?
SELECT T1.name , T1.salary FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the salaray and name of the employee that is certified to fly the most planes?
SELECT T1.name , T1.salary FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the salary and name of the employee who has the most number of certificates on aircrafts with distance more than 5000?
SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.distance > 5000 GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
flight_1
null
null
What is the salaray and name of the employee with the most certificates to fly planes more than 5000?
SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.distance > 5000 GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
loan_1
null
null
How many bank branches are there?
SELECT count(*) FROM bank
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
loan_1
null
null
Count the number of bank branches.
SELECT count(*) FROM bank
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
loan_1
null
null
How many customers are there?
SELECT sum(no_of_customers) FROM bank
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
loan_1
null
null
What is the total number of customers across banks?
SELECT sum(no_of_customers) FROM bank
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
loan_1
null
null
Find the number of customers in the banks at New York City.
SELECT sum(no_of_customers) FROM bank WHERE city = 'New York City'
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
loan_1
null
null
What is the total number of customers who use banks in New York City?
SELECT sum(no_of_customers) FROM bank WHERE city = 'New York City'
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
loan_1
null
null
Find the average number of customers in all banks of Utah state.
SELECT avg(no_of_customers) FROM bank WHERE state = 'Utah'
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
loan_1
null
null
What is the average number of customers across banks in the state of Utah?
SELECT avg(no_of_customers) FROM bank WHERE state = 'Utah'
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
loan_1
null
null
Find the average number of customers cross all banks.
SELECT avg(no_of_customers) FROM bank
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
loan_1
null
null
What is the average number of bank customers?
SELECT avg(no_of_customers) FROM bank
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
loan_1
null
null
Find the city and state of the bank branch named morningside.
SELECT city , state FROM bank WHERE bname = 'morningside'
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
loan_1
null
null
What city and state is the bank with the name morningside in?
SELECT city , state FROM bank WHERE bname = 'morningside'
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
loan_1
null
null
Find the branch names of banks in the New York state.
SELECT bname FROM bank WHERE state = 'New York'
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
loan_1
null
null
What are the names of banks in the state of New York?
SELECT bname FROM bank WHERE state = 'New York'
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
loan_1
null
null
List the name of all customers sorted by their account balance in ascending order.
SELECT cust_name FROM customer ORDER BY acc_bal
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
loan_1
null
null
What are the names of all customers, ordered by account balance?
SELECT cust_name FROM customer ORDER BY acc_bal
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
loan_1
null
null
List the name of all different customers who have some loan sorted by their total loan amount.
SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount)
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
loan_1
null
null
What are the names of the different customers who have taken out a loan, ordered by the total amount that they have taken?
SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY sum(T2.amount)
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
loan_1
null
null
Find the state, account type, and credit score of the customer whose number of loan is 0.
SELECT state , acc_type , credit_score FROM customer WHERE no_of_loans = 0
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
loan_1
null
null
What are the states, account types, and credit scores for customers who have 0 loans?
SELECT state , acc_type , credit_score FROM customer WHERE no_of_loans = 0
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null