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.)
Correct answers B and D.
SQL does not restrict creating Number column with precision alone.
SQL> desc emp_1;
Name Null? Type
—————————————– ——– ————————–
EMP_ID NUMBER(4)
EMP_NAME VARCHAR2(25 CHAR)
START_DATE DATE
EMP_STATUS VARCHAR2(10 CHAR)
RESUME CLOB
SQL> desc emp_2;
Name Null? Type
—————————————– ——– ————————–
EMP_ID NUMBER
EMP_NAME VARCHAR2(25 CHAR)
START_DATE DATE
EMP_STATUS VARCHAR2(10 CHAR)
RESUME CLOB
B is not correct because table name must begin with letter!
D is correct.
create table 1_emp(
emp_id number(4),
emp_name varchar2(25),
start_date date,
emp_status varchar2(10) default ‘ACTIVE’,
resume clob
);
Error report –
ORA-00903: invalid table name
00903. 00000 – “invalid table name”
*Cause:
*Action:
Agree With Shape
Only D is correct. On option B table name is not valid because can not start with a number. In C option the name ACTIVE must be in single quotes and not in double quotes.
in A we dont have specify the scale of CLOB data type.
D is correct