The following workshop is composed of a series of quiz questions and practical exercises. The quiz questions are designed to test your overall understanding of the current material. The practical exercises are intended to afford you the opportunity to apply the concepts discussed during the current hour, as well as build upon the knowledge acquired in previous hours of study. Please take time to complete tthe quiz questions and exercises before continuing. Refer to Appendix C, "Answers to Quizzes and Exercises," for answers.
1: | Is the syntax correct for the following compound queries? If not, what would correct the syntax? Use the EMPLOYEE_TBL and the EMPLOYEE_PAY_TBL shown as follows:
CONSTRAINT EMP_PK PRIMARY KEY (EMP_ID)
CONSTRAINT EMP_FK FOREIGN KEY (EMP_ID) REFERENCES EMPLOYEE_TBL (EMP_ID)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2: | Match the correct operator to the following statements.
|
Use the CUSTOMER_TBL and the ORDERS_TBL as listed:
CUSTOMER_TBL | |||
---|---|---|---|
CUST_IN | VARCHAR2(10) | NOT NULL | PRIMARY KEY, |
CUST_NAME | VARCHAR2(30) | NOT NULL, | |
CUST_ADDRESS | VARCHAR2(20) | NOT NULL, | |
CUST_CITY | VARCHAR2(15) | NOT NULL, | |
CUST_STATE | CHAR(2) | NOT NULL, | |
CUST_ZIP | NUMBER(5) | NOT NULL, | |
CUST_PHONE | NUMBER(10), | ||
CUST_FAX | NUMBER(10) |
ORDERS_TBL | |||
---|---|---|---|
ORD_NUM | VARCHAR2(10) | NOT NULL | PRIMARY KEY, |
CUST_ID | VARCHAR2(10) | NOT NULL, | |
PROD_ID | VARCHAR2(10) | NOT NULL, | |
QTY | NUMBER(6) | NOT NULL, | |
ORD_DATE | DATE |
1: | Write a compound query to find the customers that have placed an order. |
2: | Write a compound query to find the customers that have not placed an order. |