target-benchmark/spider-queries huggingface dataset:
Database: college_3 (tables: course, faculty)
Question: What is the full name of the instructor who has a course named COMPUTER LITERACY?
SQL: SELECT T2.Fname ,  T2.Lname FROM COURSE AS T1 JOIN FACULTY AS T2 ON T1.Instructor  =  T2.FacID WHERE T1.CName  =  "COMPUTER LITERACY"
Database: college_3 (tables: course, department)
Question: Find the department name and room of the course INTRODUCTION TO COMPUTER SCIENCE.
SQL: SELECT T2.Dname ,  T2.Room FROM COURSE AS T1 JOIN DEPARTMENT AS T2 ON T1.DNO  =  T2.DNO WHERE T1.CName  =  "INTRODUCTION TO COMPUTER SCIENCE"
Database: college_3 (tables: course, department)
Question: What are the department name and room for the course INTRODUCTION TO COMPUTER SCIENCE?
SQL: SELECT T2.Dname ,  T2.Room FROM COURSE AS T1 JOIN DEPARTMENT AS T2 ON T1.DNO  =  T2.DNO WHERE T1.CName  =  "INTRODUCTION TO COMPUTER SCIENCE"
Database: college_3 (tables: gradeconversion, enrolled_in, student)
Question: Find the student first and last names and grade points of all enrollments.
SQL: SELECT T3.Fname ,  T3.LName ,  T2.gradepoint FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade  =  T2.lettergrade AND T1.StuID  =  T3.StuID
Database: college_3 (tables: gradeconversion, enrolled_in, student)
Question: What are the full names and gradepoints for all enrollments?
SQL: SELECT T3.Fname ,  T3.LName ,  T2.gradepoint FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade  =  T2.lettergrade AND T1.StuID  =  T3.StuID
Database: college_3 (tables: gradeconversion, enrolled_in, student)
Question: Find the distinct student first names of all students that have grade point at least 3.8 in one course.
SQL: SELECT DISTINCT T3.Fname FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade  =  T2.lettergrade AND T1.StuID  =  T3.StuID WHERE T2.gradepoint  >=  3.8
Database: college_3 (tables: gradeconversion, enrolled_in, student)
Question: What are the distinct first names for students with a grade point of 3.8 or above in at least one course?
SQL: SELECT DISTINCT T3.Fname FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade  =  T2.lettergrade AND T1.StuID  =  T3.StuID WHERE T2.gradepoint  >=  3.8
Database: college_3 (tables: member_of, faculty)
Question: Find the full names of faculties who are members of department with department number 520.
SQL: SELECT T1.Fname ,  T1.Lname FROM FACULTY AS T1 JOIN MEMBER_OF AS T2 ON T1.FacID  =  T2.FacID WHERE T2.DNO  =  520
Database: college_3 (tables: member_of, faculty)
Question: What are the full names of faculty members who are a part of department 520?
SQL: SELECT T1.Fname ,  T1.Lname FROM FACULTY AS T1 JOIN MEMBER_OF AS T2 ON T1.FacID  =  T2.FacID WHERE T2.DNO  =  520
Database: college_3 (tables: minor_in, student)
Question: What are the first names and last names of the students that minor in the department with DNO 140.
SQL: SELECT T2.Fname ,  T2.Lname FROM MINOR_IN AS T1 JOIN STUDENT AS T2 ON T1.StuID  =  T2.StuID WHERE T1.DNO  =  140
Database: college_3 (tables: minor_in, student)
Question: What are the full names of students minoring in department 140?
SQL: SELECT T2.Fname ,  T2.Lname FROM MINOR_IN AS T1 JOIN STUDENT AS T2 ON T1.StuID  =  T2.StuID WHERE T1.DNO  =  140
Database: college_3 (tables: department, member_of, faculty)
Question: Find the last names of faculties who are members of computer science department.
SQL: SELECT T2.Lname FROM DEPARTMENT AS T1 JOIN FACULTY AS T2 ON T1.DNO  =  T3.DNO JOIN MEMBER_OF AS T3 ON T2.FacID  =  T3.FacID WHERE T1.DName  =  "Computer Science"
Database: college_3 (tables: department, member_of, faculty)
Question: What are the last names of faculty who are part of the computer science department?
SQL: SELECT T2.Lname FROM DEPARTMENT AS T1 JOIN FACULTY AS T2 ON T1.DNO  =  T3.DNO JOIN MEMBER_OF AS T3 ON T2.FacID  =  T3.FacID WHERE T1.DName  =  "Computer Science"
Database: college_3 (tables: gradeconversion, enrolled_in, student)
Question: Find the average grade point of student whose last name is Smith.
SQL: SELECT avg(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade  =  T2.lettergrade AND T1.StuID  =  T3.StuID WHERE T3.LName  =  "Smith"
Database: college_3 (tables: gradeconversion, enrolled_in, student)
Question: What is the average gradepoint for students with the last name Smith?
SQL: SELECT avg(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade  =  T2.lettergrade AND T1.StuID  =  T3.StuID WHERE T3.LName  =  "Smith"
Database: college_3 (tables: gradeconversion, enrolled_in, student)
Question: What is the maximum and minimum grade point of students who live in NYC?
SQL: SELECT max(T2.gradepoint) ,  min(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade  =  T2.lettergrade AND T1.StuID  =  T3.StuID WHERE T3.city_code  =  "NYC"
Database: college_3 (tables: gradeconversion, enrolled_in, student)
Question: Give the maximum and minimum gradepoints for students living in NYC?
SQL: SELECT max(T2.gradepoint) ,  min(T2.gradepoint) FROM ENROLLED_IN AS T1 JOIN GRADECONVERSION AS T2 JOIN STUDENT AS T3 ON T1.Grade  =  T2.lettergrade AND T1.StuID  =  T3.StuID WHERE T3.city_code  =  "NYC"
Database: college_3 (tables: course)
Question: Find the names of courses that have either 3 credits or 1 credit but 4 hours.
SQL: SELECT CName FROM COURSE WHERE Credits  =  3 UNION SELECT CName FROM COURSE WHERE Credits  =  1 AND Hours  =  4
Database: college_3 (tables: course)
Question: What are the names of courses that give either 3 credits, or 1 credit and 4 hours?
SQL: SELECT CName FROM COURSE WHERE Credits  =  3 UNION SELECT CName FROM COURSE WHERE Credits  =  1 AND Hours  =  4
Database: college_3 (tables: department)
Question: Find the names of departments that are either in division AS or in division EN and in Building NEB.
SQL: SELECT DName FROM DEPARTMENT WHERE Division  =  "AS" UNION SELECT DName FROM DEPARTMENT WHERE Division  =  "EN" AND Building  =  "NEB"
Database: college_3 (tables: department)
Question: What are the names of departments either in division AS, or in division EN and in building NEB?
SQL: SELECT DName FROM DEPARTMENT WHERE Division  =  "AS" UNION SELECT DName FROM DEPARTMENT WHERE Division  =  "EN" AND Building  =  "NEB"
Database: college_3 (tables: enrolled_in, student)
Question: Find the first name of students not enrolled in any course.
SQL: SELECT Fname FROM STUDENT WHERE StuID NOT IN (SELECT StuID FROM ENROLLED_IN)
Database: college_3 (tables: enrolled_in, student)
Question: What are the first names of all students that are not enrolled in courses?
SQL: SELECT Fname FROM STUDENT WHERE StuID NOT IN (SELECT StuID FROM ENROLLED_IN)
Database: department_store (tables: product_suppliers)
Question: What are the ids of the top three products that were purchased in the largest amount?
SQL: SELECT product_id FROM product_suppliers ORDER BY total_amount_purchased DESC LIMIT 3
Database: department_store (tables: product_suppliers)
Question: Give the ids of the three products purchased in the largest amounts.
SQL: SELECT product_id FROM product_suppliers ORDER BY total_amount_purchased DESC LIMIT 3
Database: department_store (tables: products)
Question: What are the product id and product type of the cheapest product?
SQL: SELECT product_id ,  product_type_code FROM products ORDER BY product_price LIMIT 1
Database: department_store (tables: products)
Question: Give the id and product type of the product with the lowest price.
SQL: SELECT product_id ,  product_type_code FROM products ORDER BY product_price LIMIT 1
Database: department_store (tables: products)
Question: Find the number of different product types.
SQL: SELECT count(DISTINCT product_type_code) FROM products
Database: department_store (tables: products)
Question: Count the number of distinct product types.
SQL: SELECT count(DISTINCT product_type_code) FROM products
Database: department_store (tables: addresses, customer_addresses)
Question: Return the address of customer 10.
SQL: SELECT T1.address_details FROM addresses AS T1 JOIN customer_addresses AS T2 ON T1.address_id  =  T2.address_id WHERE T2.customer_id  =  10
Database: department_store (tables: addresses, customer_addresses)
Question: What is the address for the customer with id 10?
SQL: SELECT T1.address_details FROM addresses AS T1 JOIN customer_addresses AS T2 ON T1.address_id  =  T2.address_id WHERE T2.customer_id  =  10
Database: department_store (tables: staff_department_assignments, staff)
Question: What are the staff ids and genders of all staffs whose job title is Department Manager?
SQL: SELECT T1.staff_id ,  T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id  =  T2.staff_id WHERE T2.job_title_code  =  "Department Manager"
Database: department_store (tables: staff_department_assignments, staff)
Question: Return the staff ids and genders for any staff with the title Department Manager.
SQL: SELECT T1.staff_id ,  T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id  =  T2.staff_id WHERE T2.job_title_code  =  "Department Manager"
Database: department_store (tables: customers)
Question: For each payment method, return how many customers use it.
SQL: SELECT payment_method_code ,  count(*) FROM customers GROUP BY payment_method_code
Database: department_store (tables: customers)
Question: How many customers use each payment method?
SQL: SELECT payment_method_code ,  count(*) FROM customers GROUP BY payment_method_code
Database: department_store (tables: order_items)
Question: What is the id of the product that was ordered the most often?
SQL: SELECT product_id FROM order_items GROUP BY product_id ORDER BY count(*) DESC LIMIT 1
Database: department_store (tables: order_items)
Question: Give the product id for the product that was ordered most frequently.
SQL: SELECT product_id FROM order_items GROUP BY product_id ORDER BY count(*) DESC LIMIT 1
Database: department_store (tables: customer_orders, customers)
Question: What are the name, phone number and email address of the customer who made the largest number of orders?
SQL: SELECT T1.customer_name ,  T1.customer_phone ,  T1.customer_email FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T2.customer_id ORDER BY count(*) DESC LIMIT 1
Database: department_store (tables: customer_orders, customers)
Question: Return the name, phone number and email address for the customer with the most orders.
SQL: SELECT T1.customer_name ,  T1.customer_phone ,  T1.customer_email FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T2.customer_id ORDER BY count(*) DESC LIMIT 1
Database: department_store (tables: products)
Question: What is the average price for each type of product?
SQL: SELECT product_type_code ,  avg(product_price) FROM products GROUP BY product_type_code
Database: department_store (tables: products)
Question: Return the average price for each product type.
SQL: SELECT product_type_code ,  avg(product_price) FROM products GROUP BY product_type_code
Database: department_store (tables: department_store_chain, department_stores)
Question: How many department stores does the store chain South have?
SQL: SELECT count(*) FROM department_stores AS T1 JOIN department_store_chain AS T2 ON T1.dept_store_chain_id  =  T2.dept_store_chain_id WHERE T2.dept_store_chain_name  =  "South"
Database: department_store (tables: department_store_chain, department_stores)
Question: Count the number of stores the chain South has.
SQL: SELECT count(*) FROM department_stores AS T1 JOIN department_store_chain AS T2 ON T1.dept_store_chain_id  =  T2.dept_store_chain_id WHERE T2.dept_store_chain_name  =  "South"
Database: department_store (tables: staff_department_assignments, staff)
Question: What is the name and job title of the staff who was assigned the latest?
SQL: SELECT T1.staff_name ,  T2.job_title_code FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id  =  T2.staff_id ORDER BY T2.date_assigned_to DESC LIMIT 1
Database: department_store (tables: staff_department_assignments, staff)
Question: Return the name and job title of the staff with the latest date assigned.
SQL: SELECT T1.staff_name ,  T2.job_title_code FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id  =  T2.staff_id ORDER BY T2.date_assigned_to DESC LIMIT 1
Database: department_store (tables: products, product_suppliers)
Question: Give me the product type, name and price for all the products supplied by supplier id 3.
SQL: SELECT T2.product_type_code ,  T2.product_name ,  T2.product_price FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id  =  T2.product_id WHERE T1.supplier_id  =  3
Database: department_store (tables: products, product_suppliers)
Question: Return the product type, name, and price for products supplied by supplier 3.
SQL: SELECT T2.product_type_code ,  T2.product_name ,  T2.product_price FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id  =  T2.product_id WHERE T1.supplier_id  =  3
Database: department_store (tables: customer_orders, customers)
Question: Return the distinct name of customers whose order status is Pending, in the order of customer id.
SQL: SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.order_status_code  =  "Pending" ORDER BY T2.customer_id
Database: department_store (tables: customer_orders, customers)
Question: What are the distinct names of customers with an order status of Pending, sorted by customer id?
SQL: SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.order_status_code  =  "Pending" ORDER BY T2.customer_id
Database: department_store (tables: customer_orders, customers)
Question: Find the name and address of the customers who have both New and Pending orders.
SQL: SELECT T1.customer_name ,  T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.order_status_code  =  "New" INTERSECT SELECT T1.customer_name ,  T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.order_status_code  =  "Pending"
Database: department_store (tables: customer_orders, customers)
Question: What are the names and addressed of customers who have both New and Pending orders?
SQL: SELECT T1.customer_name ,  T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.order_status_code  =  "New" INTERSECT SELECT T1.customer_name ,  T1.customer_address FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.order_status_code  =  "Pending"
Database: department_store (tables: products, product_suppliers)
Question: Return ids of all the products that are supplied by supplier id 2 and are more expensive than the average price of all products.
SQL: SELECT T1.product_id FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id  =  T2.product_id WHERE T1.supplier_id  =  2 AND T2.product_price  >  (SELECT avg(product_price) FROM products)
Database: department_store (tables: products, product_suppliers)
Question: What are the ids of products from the supplier with id 2, which are more expensive than the average price across all products?
SQL: SELECT T1.product_id FROM product_suppliers AS T1 JOIN products AS T2 ON T1.product_id  =  T2.product_id WHERE T1.supplier_id  =  2 AND T2.product_price  >  (SELECT avg(product_price) FROM products)
Database: department_store (tables: departments, department_stores)
Question: What is the id and name of the department store that has both marketing and managing department?
SQL: SELECT T2.dept_store_id ,  T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id  =  T2.dept_store_id WHERE T1.department_name  =  "marketing" INTERSECT SELECT T2.dept_store_id ,  T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id  =  T2.dept_store_id WHERE T1.department_name  =  "managing"
Database: department_store (tables: departments, department_stores)
Question: What are the ids and names of department stores with both marketing and managing departments?
SQL: SELECT T2.dept_store_id ,  T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id  =  T2.dept_store_id WHERE T1.department_name  =  "marketing" INTERSECT SELECT T2.dept_store_id ,  T2.store_name FROM departments AS T1 JOIN department_stores AS T2 ON T1.dept_store_id  =  T2.dept_store_id WHERE T1.department_name  =  "managing"
Database: department_store (tables: department_stores)
Question: What are the ids of the two department store chains with the largest number of department stores?
SQL: SELECT dept_store_chain_id FROM department_stores GROUP BY dept_store_chain_id ORDER BY count(*) DESC LIMIT 2
Database: department_store (tables: department_stores)
Question: Return the ids of the two department store chains with the most department stores.
SQL: SELECT dept_store_chain_id FROM department_stores GROUP BY dept_store_chain_id ORDER BY count(*) DESC LIMIT 2
Database: department_store (tables: staff_department_assignments)
Question: What is the id of the department with the least number of staff?
SQL: SELECT department_id FROM staff_department_assignments GROUP BY department_id ORDER BY count(*) LIMIT 1
Database: department_store (tables: staff_department_assignments)
Question: Return the id of the department with the fewest staff assignments.
SQL: SELECT department_id FROM staff_department_assignments GROUP BY department_id ORDER BY count(*) LIMIT 1
Database: department_store (tables: products)
Question: For each product type, return the maximum and minimum price.
SQL: SELECT product_type_code ,  max(product_price) ,  min(product_price) FROM products GROUP BY product_type_code
Database: department_store (tables: products)
Question: What are the maximum and minimum product prices for each product type?
SQL: SELECT product_type_code ,  max(product_price) ,  min(product_price) FROM products GROUP BY product_type_code
Database: department_store (tables: products)
Question: Find the product type whose average price is higher than the average price of all products.
SQL: SELECT product_type_code FROM products GROUP BY product_type_code HAVING avg(product_price)  >  (SELECT avg(product_price) FROM products)
Database: department_store (tables: products)
Question: What is the code of the product type with an average price higher than the average price of all products?
SQL: SELECT product_type_code FROM products GROUP BY product_type_code HAVING avg(product_price)  >  (SELECT avg(product_price) FROM products)
Database: department_store (tables: staff_department_assignments, staff)
Question: Find the id and name of the staff who has been assigned for the shortest period.
SQL: SELECT T1.staff_id ,  T1.staff_name FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id  =  T2.staff_id ORDER BY date_assigned_to - date_assigned_from LIMIT 1
Database: department_store (tables: staff_department_assignments, staff)
Question: What is the id and name of the staff who has been assigned for the least amount of time?
SQL: SELECT T1.staff_id ,  T1.staff_name FROM staff AS T1 JOIN Staff_Department_Assignments AS T2 ON T1.staff_id  =  T2.staff_id ORDER BY date_assigned_to - date_assigned_from LIMIT 1
Database: department_store (tables: products)
Question: Return the names and ids of all products whose price is between 600 and 700.
SQL: SELECT product_name ,  product_id FROM products WHERE product_price BETWEEN 600 AND 700
Database: department_store (tables: products)
Question: What are the names and ids of products costing between 600 and 700?
SQL: SELECT product_name ,  product_id FROM products WHERE product_price BETWEEN 600 AND 700
Database: department_store (tables: customer_orders)
Question: Find the ids of all distinct customers who made order after some orders that were Cancelled.
SQL: SELECT DISTINCT customer_id FROM Customer_Orders WHERE order_date  >  (SELECT min(order_date) FROM Customer_Orders WHERE order_status_code  =  "Cancelled")
Database: department_store (tables: customer_orders)
Question: What are the distinct ids of customers who made an order after any order that was Cancelled?
SQL: SELECT DISTINCT customer_id FROM Customer_Orders WHERE order_date  >  (SELECT min(order_date) FROM Customer_Orders WHERE order_status_code  =  "Cancelled")
Database: department_store (tables: staff_department_assignments)
Question: What is id of the staff who had a Staff Department Assignment earlier than any Clerical Staff?
SQL: SELECT staff_id FROM Staff_Department_Assignments WHERE date_assigned_to  <  (SELECT max(date_assigned_to) FROM Staff_Department_Assignments WHERE job_title_code  =  'Clerical Staff')
Database: department_store (tables: staff_department_assignments)
Question: Return the id of the staff whose Staff Department Assignment was earlier than that of any Clerical Staff.
SQL: SELECT staff_id FROM Staff_Department_Assignments WHERE date_assigned_to  <  (SELECT max(date_assigned_to) FROM Staff_Department_Assignments WHERE job_title_code  =  'Clerical Staff')
Database: department_store (tables: customers)
Question: What are the names and ids of customers whose address contains TN?
SQL: SELECT customer_name ,  customer_id FROM customers WHERE customer_address LIKE "%TN%"
Database: department_store (tables: customers)
Question: Return the names and ids of customers who have TN in their address.
SQL: SELECT customer_name ,  customer_id FROM customers WHERE customer_address LIKE "%TN%"
Database: department_store (tables: staff_department_assignments, staff)
Question: Return the name and gender of the staff who was assigned in 2016.
SQL: SELECT T1.staff_name ,  T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id  =  T2.staff_id WHERE T2.date_assigned_from LIKE "2016%"
Database: department_store (tables: staff_department_assignments, staff)
Question: What are the names and genders of staff who were assigned in 2016?
SQL: SELECT T1.staff_name ,  T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id  =  T2.staff_id WHERE T2.date_assigned_from LIKE "2016%"
Database: department_store (tables: staff_department_assignments, staff)
Question: List the name of staff who has been assigned multiple jobs.
SQL: SELECT T1.staff_name FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id  =  T2.staff_id GROUP BY T2.staff_id HAVING COUNT (*)  >  1
Database: department_store (tables: staff_department_assignments, staff)
Question: What are the names of staff who have been assigned multiple jobs?
SQL: SELECT T1.staff_name FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id  =  T2.staff_id GROUP BY T2.staff_id HAVING COUNT (*)  >  1
Database: department_store (tables: supplier_addresses, suppliers, addresses)
Question: List the name and phone number of all suppliers in the alphabetical order of their addresses.
SQL: SELECT T1.supplier_name ,  T1.supplier_phone FROM Suppliers AS T1 JOIN supplier_addresses AS T2 ON T1.supplier_id  =  T2.supplier_id JOIN addresses AS T3 ON T2.address_id  =  T3.address_id ORDER BY T3.address_details
Database: department_store (tables: supplier_addresses, suppliers, addresses)
Question: What are the names and phone numbers for all suppliers, sorted in alphabetical order of their addressed?
SQL: SELECT T1.supplier_name ,  T1.supplier_phone FROM Suppliers AS T1 JOIN supplier_addresses AS T2 ON T1.supplier_id  =  T2.supplier_id JOIN addresses AS T3 ON T2.address_id  =  T3.address_id ORDER BY T3.address_details
Database: department_store (tables: customers, suppliers)
Question: What are the phone numbers of all customers and suppliers.
SQL: SELECT customer_phone FROM customers UNION SELECT supplier_phone FROM suppliers
Database: department_store (tables: customers, suppliers)
Question: Return the phone numbers for all customers and suppliers.
SQL: SELECT customer_phone FROM customers UNION SELECT supplier_phone FROM suppliers