{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lab_05_demo - have been entered SELECT state count FROM...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
IST210 Organization of Data In Class Demonstration of SQL query on multiple tables (JOIN operations) This is NOT the lab assignment but an example of the techniques for the lab. Execute the SQL statements in VLABS, SQL SERVER, SCHEMA: WCIST210 1. Display the order number and customer name for all sales orders. SELECT order_id, name FROM demo_sales_order, demo_customer WHERE demo_sales_order.customer_id = demo_customer.customer_id; 2. Display the order number, item identification, description and total of item where the total of an entry is greater than 1,000. Sort the result by total in descending value. SELECT order_id, item_id, description, total FROM demo_item, demo_product WHERE demo_item.product_id = demo_product.product_id AND total > 1000 ORDER BY total DESC; 3. For each state where customers reside, how many sales orders
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: have been entered? SELECT state, count(*) FROM demo_customer, demo_sales_order WHERE demo_sales_order.customer_id = demo_customer.customer_id GROUP BY demo_customer.state 4. Identify the salesperson on record for each customer. Include the job function for the salesperson. SELECT name, city, salesperson_id, last_name, job_function FROM demo_customer, demo_employee, demo_job WHERE salesperson_id = employee_id and demo_employee.job_id = demo_job.job_id; 5. List the credit limit, total value of all orders, and the earliest and the latest ship date for each customer. SELECT demo_customer.customer_id, credit_limit, sum(total), min(ship_date), max(ship_date) FROM demo_customer, demo_sales_order WHERE demo_customer.customer_id = demo_sales_order.customer_id GROUP BY demo_customer.customer_id, credit_limit;...
View Full Document

{[ snackBarMessage ]}