Which is a valid CREATE TABLE statement?
A.
CREATE TABLE EMP9$# AS (empid number(2));
B.
CREATE TABLE EMP*123 AS (empid number(2));
C.
CREATE TABLE PACKAGE AS (packid number(2));
D.
CREATE TABLE 1EMP_TEST AS (empid number(2));
Explanation:
Table names and column names must begin with a letter and be 1-30 characters long. Characters
A-Z,a-z, 0-9, _, $ and # (legal characters but their use is discouraged).
Incorrect answer:
BNon alphanumeric character such as “*” is discourage in Oracle table name.
DTable name must begin with a letter.
Why not?
C.
CREATE TABLE PACKAGE AS (packid number(2));
C is not the correct answer for “PACKAGE” is a keyword in Oracle.
now, as they are printed, they are wrong, all of them.
create table XXXXX as (field kind_of_data)
The “as” is wrong:
PACO@DBONE12>CREATE TABLE PACKAGE (packid number(2));
Table created.
PACO@DBONE12>CREATE TABLE PACKAGE as (packid number(2));
CREATE TABLE PACKAGE as (packid number(2))
*
ERROR at line 1:
ORA-00928: missing SELECT keyword
I have used a wrong example… The table with name “package” is created but is not recommend use this name. The option “a” creating the table with name “EMP9$#” is right.