Hour 3, "Managing Database Objects"

Quiz Answers

1: Will the following CREATE TABLE statement work? If not, what needs to be done to correct the problem(s)?

CREATE TABLE EMPLOYEE_TABLE AS:

   ( SSN             NUMBER(9)       NOT NULL,
    LAST_NAME        VARCHAR2(20)    NOT NULL,
    FIRST_NAME       VARCHAR2(20)    NOT NULL,
    MIDDLE_NAME      VARCHAR2(20)    NOT NULL,
    ST ADDRESS       VARCHAR2(30)    NOT NULL,
    CITY             CHAR(20)        NOT NULL,
    STATE            CHAR2)          NOT NULL,
    ZIP              NUMBER(4)       NOT NULL,
    DATE HIRED       DATE)
    STORAGE
        (INITIAL        3K,
         NEXT        1K);
A1: The CREATE TABLE statement will not work because there are several errors in the syntax. The corrected statement follows. A listing of what was incorrect follows a corrected statement.
 CREATE TABLE EMPLOYEE_TABLE ( SSN NUMBER() NOT NULL, LAST_NAME VARCHAR2(20) NOT NULL, FIRST_NAME ...

Get Sams Teach Yourself SQL in 24 Hours, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.