Oracle3C_Spool_Chen_Jason

Oracle3C_Spool_Chen_Jason - SQL> SQL> SQL> SQL>...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
SQL> SQL> -- script to create part of NORTHWOODS database structure SQL> -- BMIS441 SQL> --File name: Ch3CCase.sql SQL> --created 9/11/2006 Jason Chen, Row:1 SQL> SQL> SET linesize 100 SQL> set pagesize 25 SQL> column c_first format A9 SQL> column c_last format A10 SQL> SQL> --************************************************ 1 SQL> SQL> ---#1(A) SQL> SELECT o_id, item_desc 2 FROM order_line ol, inventory i, item it 3 WHERE it.item_id = i.item_id 4 AND i.inv_id = ol.inv_id 5 AND o_id = 1; O_ID ITEM_DESC ---------- ------------------------------ 1 3-Season Tent 1 Women's Fleece Pullover SQL> SQL> ---#1(B) SQL> SELECT o_id, item_desc 2 FROM order_line 3 NATURAL JOIN inventory 4 NATURAL JOIN item 5 WHERE o_id = 1; O_ID ITEM_DESC ---------- ------------------------------ 1 3-Season Tent 1 Women's Fleece Pullover SQL> SQL> --************************************************ 2 SQL> SQL> ---#2 (A) SQL> SELECT c_first, c_last, TO_CHAR(sum(inv_price * ol_quantity), '$99,999.99') "Order Total" 2 FROM customer, orders, order_line, inventory 3 WHERE orders.o_id = 1 4 AND customer.c_id = orders.c_id 5 AND orders.o_id = order_line.o_id 6 AND order_line.inv_id = inventory.inv_id 7 GROUP BY c_first, c_last;
Background image of page 1

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

View Full DocumentRight Arrow Icon
C_FIRST C_LAST Order Total --------- ---------- ----------- Neal Graham $379.89 SQL> SQL> SQL> ---#2 (B) SQL> SELECT c_first, c_last, TO_CHAR(sum(inv_price * ol_quantity), '$99,999.99') "Order Total" 2 FROM item 3 NATURAL JOIN inventory 4 NATURAL JOIN order_line 5 NATURAL JOIN orders 6 NATURAL JOIN customer 7 WHERE o_id = 1 8 GROUP BY c_first, c_last; C_FIRST C_LAST Order Total --------- ---------- ----------- Neal Graham $379.89 SQL> SQL> SQL> --************************************************ 3
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/26/2010 for the course ITS 26 taught by Professor Jack during the Spring '10 term at Staten Island.

Page1 / 6

Oracle3C_Spool_Chen_Jason - SQL> SQL> SQL> SQL>...

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

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