---
# System prepended metadata

title: ORACLE CHAPETER.5
tags: [Ming, ORACLE]

---

# ORACLE CHAPETER.5
###### tags `Ming` `ORACLE`

{%hackmd BJrTq20hE %}

Question.5-1

SELECT CUSTOMER_NAME AS NAME, PHONE, ADDRESS FROM CUSTOMER; 
SELECT * FROM CUSTOMER;


Question.5-2

SELECT * FROM CUSTOMER
WHERE CUSTOMER_ID = 'C001';

SELECT * FROM BOOK
WHERE PUBLICATION_DATE > TO_DATE('2016/01/01', 'yyyy-mm-dd');

SELECT * FROM CUSTOMER
WHERE UPPER(ADDRESS) LIKE UPPER('%TAIPEI%');


Question.5-3

ALTER SESSION SET NLS_DATE_FORMAT = 'yyyy-mm-dd';
SELECT * FROM BOOK
WHERE PUBLICATION_DATE BETWEEN '2016/01/01' AND '2016/12/31'
ORDER BY PRICE DESC;

SELECT * FROM CUSTOMER
WHERE UPPER(ADDRESS) LIKE UPPER('%TAIPEI%') OR  UPPER(ADDRESS) LIKE UPPER('%TAOYUAN%');

Question.5-4

SELECT COUNT(ADDRESS) FROM CUSTOMER
WHERE UPPER(ADDRESS) LIKE UPPER('%TAIPEI%');

SELECT SUM(QUANTITY) FROM ORDER_DETAIL
WHERE ORDER_ID IN (1,2);

ALTER SESSION SET NLS_DATE_FORMAT = 'yyyy-mm-dd';
SELECT AVG(PRICE) FROM BOOK
WHERE PUBLICATION_DATE BETWEEN '2016/01/01' AND '2016/12/31';

