Lab_05_demo - have been entered? SELECT state, count(*)...

Info iconThis 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
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background 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

This note was uploaded on 08/02/2009 for the course IST 210 taught by Professor Mcconn,charlotteryoo,jungwoo during the Summer '08 term at Pennsylvania State University, University Park.

Page1 / 2

Lab_05_demo - have been entered? SELECT state, count(*)...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online