Oracle3B_odd_nos_Spool_Chen_Jason

Oracle3B_odd_nos_Spool_Chen_Jason - INV_SIZE ='XL I COUNT 2...

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

View Full Document Right Arrow Icon
SQL> -- script to create part of NORTHWOODS database structure SQL> -- BMIS441 SQL> --File name: Ch3BCase.sql (for odd nos) SQL> --created 9/11/2006 Jason Chen, Row:1 SQL> SQL> SET linesize 100 SQL> set pagesize 25 SQL> SQL> --#1 SQL> SELECT INV_PRICE FROM INVENTORY WHERE INV_ID = '1'; S INV_PRICE ---------- 259.99 SQL> SQL> --#3 SQL> SELECT COUNT(*) FROM CATEGORY; S COUNT(*) ---------- 4 SQL> SQL> SQL> --#5 SQL> SELECT SUM(INV_QOH) FROM INVENTORY GROUP BY ITEM_ID; S SUM(INV_QOH) ------------ 143 28 688 726 1008 250 300 7 rows selected. 7 SQL> SQL> --#7 SQL> SELECT COUNT(*) FROM ORDERS WHERE O_DATE = TO_DATE('May 31, 2006','Month dd,
Background image of page 1

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

View Full DocumentRight Arrow Icon
yyyy') AND O_METHPMT = 'CC'; y COUNT(*) ---------- 1 SQL> SQL> --#9 SQL> SELECT * FROM INVENTORY WHERE INV_SIZE IS NULL; S INV_ID ITEM_ID COLOR INV_SIZE INV_PRICE INV_QOH ---------- ---------- -------------------- ---------- ---------- ---------- 1 2 Sky Blue 259.99 16 2 2 Light Grey 259.99 12 SQL> SQL> SQL> --#11 SQL> SELECT COUNT(*) FROM INVENTORY WHERE INV_PRICE > '60' AND (INV_SIZE = 'L' OR
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: INV_SIZE = 'XL'); I COUNT(*) ---------- 2 SQL> SQL> --#13 SQL> SELECT COUNT(DISTINCT INV_SIZE) FROM INVENTORY WHERE ITEM_ID = '5'; S COUNT(DISTINCTINV_SIZE) ----------------------- 4 SQL> SQL> --#15 (Note that fm is not required) SQL> SELECT SHIP_ID, TO_CHAR(SHIP_DATE_EXPECTED,'fmMONTH DD, YYYY') FROM SHIPMENT; S SHIP_ID TO_CHAR(SHIP_DATE_ ---------- ------------------ 1 SEPTEMBER 15, 2006 2 NOVEMBER 15, 2006 3 JUNE 25, 2006 4 JUNE 25, 2006 5 AUGUST 15, 2006 SQL> SQL> --#17 SQL> SELECT * FROM INVENTORY WHERE INV_QOH > 0 AND (INV_SIZE = 'M' OR INV_SIZE = 'L') AND (COLOR IN ('Royal', 'Bright Pink', 'Spruce')); ' INV_ID ITEM_ID COLOR INV_SIZE INV_PRICE INV_QOH ---------- ---------- -------------------- ---------- ---------- ---------- 13 4 Royal M 59.95 124 14 4 Royal L 59.95 112 24 1 Spruce M 199.95 17 SQL> SQL> --#19 SQL> SELECT COUNT(*) FROM ITEM WHERE CAT_ID NOT IN (2, 4); S COUNT(*) ---------- 3 SQL>...
View Full 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 / 3

Oracle3B_odd_nos_Spool_Chen_Jason - INV_SIZE ='XL I COUNT 2...

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