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.
Refer: Introduction to Oracle9i: SQL, Oracle University Study Guide, 9-4
Why is C wrong?
PACKAGE is a reserve word?
Yes.
So what? We can still create table with name PACKAGE, thatswhy option C is a valid statement.
CREATE TABLE PACKAGE (packid number(2));
CREATE A TABLE
C is also right.
I think PACKAGE is reserved word as you mention in below post
Actually all 4 are invalid becasue “AS” keyword cannot be used here.
the as keyword should not be there
Number 162 in this set is the same question with correct syntax:
Which is the valid CREATE [TABLE statement?
A. CREATE TABLE emp9$# (emp_no NUMBER(4));
B. CREATE TABLE 9emp$# (emp_no NUMBER(4));
C. CREATE TABLE emp*123 (emp_no NUMBER(4));
D. CREATE TABLE emp9$# (emp_no NUMBER(4). date DATE);
There is also long explanation about naming rules for objects.