You need to create a table with the following column specifications:
1. Employee ID (numeric data type) for each employee
2. Employee Name (character data type) that stores the employee name
3. Hire date, which stores the date of joining the organization for each employee
4. Status (character data type), that contains the value ‘active1 if no data is entered
5. Resume (character large object [CLOB] data type), which contains the resume submitted by the employee
Which is the correct syntax to create this table?
A.
Option A
B.
Option B
C.
Option C
D.
Option D
Explanation:
CLOB Character data (up to 4 GB)
NUMBER [(p, s)] Number having precision p and scale s (Precision is the total number of decimal
digits and scale is the number of digits to the right of the decimal point; precision can range from 1
to 38, and scale can range from –84 to 127.)
Yes, D
…could be B also…
But the point on answer B is, that a table name must begin with a letter from A through Z.
“1_EMP” isn’t possible here, so B must be one of wrong answers.
For number must specify the length. The correct answer is C
C is wrong answer and for number datatype should not specify length.
And “ACTIVE” is wrong, correct is ‘ACTIVE’.
D is correct, it is tested!
Thank you sape, I could not see the error in C. Now yes ” ” and ‘ ‘.
Why is Option A) incorrect?
Table name cannot begin with a number
You cannot give a size to a CLOB datatype
C is wrong ONLY because of the double quotes, you can have a number(4) if you are so inclined.
SQL> create table sean_datatype_sqlplus (col1 number, col2 number(4), col3 number(4,1));
Table created.
SQL> desc sean_datatype_sqlplus
Name Null? Type
—————————————– ——– —————————-
COL1 NUMBER
COL2 NUMBER(4)
COL3 NUMBER(4,1)