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 VARCHAR2(20) NOT NULL, MIDDLE_NAME VARCHAR2(20), ST_ADDRESS VARCHAR2(30) NOT NULL, CITY VARCHAR2(20) NOT NULL, STATE CHAR(2) NOT NULL, ZIP NUMBER(5) NOT NULL, DATE_HIRED DATE ) STORAGE (INITIAL 3k NEXT 1k); The following needs to be done:
|
2: | Can you drop a column from a table? |
A2: | Yes. However, even though it is an ANSI standard, you must check your particular implementation to see if it has been accepted. |
3: | What happens if you do not include the STORAGE clause in the CREATE TABLE statement? |
A3: | The CREATE TABLE statement should process, barring any syntax errors of course; however, most implementations have a default sizing. Check your particular implementation for the sizing. |