Informatics Practices
Below are the customer and order tables :
Customers
| customer id (PK) |
|---|
| first_name |
| last_name |
| address |
| city |
| state |
| zip |
Orders
| order id (PK) |
|---|
| order_date |
| amount |
| customer_id (FK) |
List the customers (name) and their orders' details.
SQL Queries
1 Like
Answer
SELECT c.first_name, c.last_name, o.order_id, o.order_date, o.amount
FROM Customers c, Orders o
WHERE c.customer_id = o.customer_id;
Answered By
2 Likes
Related Questions
Below are the customer and order tables :
Customers
customer id (PK) first_name last_name email address city state zip Orders
order id (PK) order_date amount customer_id (FK) List the sum of the totals of orders grouped by customer and state.
Below are the customer and order tables :
Customers
customer id (PK) first_name last_name email address city state zip Orders
order id (PK) order_date amount customer_id (FK) List the sum of the totals of orders where this sum is greater than $1000 grouped by customer (id) and state and ordered by state.
Below are the customer and order tables :
Customers
customer id (PK) first_name last_name email address city state zip Orders
order id (PK) order_date amount customer_id (FK) List the customers (name) and the total amount of all their orders.
Schemas of tables EMPL, Dept, SalaryGrade are being shown below :
EMPL (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) SALARYGRADE (Lowsal, Highsal, Grade) DEPT (Deptno, DeptName, Location)List the department names and the number of their employees.