Which is the correct syntax to create this table?

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 ‘ACTIVE’ 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?

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 ‘ACTIVE’ 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.
CREATE TABLE EMP_1
(emp_id NUMBER(4),
emp_name VARCHAR2(25),
start_date DATE,
e_status VARCHAR2(10) DEFAULT ‘ACTIVE’,
resume CLOB(200));

B.
CREATE TABLE 1_EMP
(emp_id NUMBER(4),
emp_name VARCHAR2(25),
start_date DATE,
emp_status VARCHAR2(10) DEFAULT ‘ACTIVE’,
resume CLOB);

C.
CREATE TABLE EMP_1
(emp_id NUMBER(4),
emp_name VARCHAR2(25),
start_date DATE,
emp_status VARCHAR2(10) DEFAULT “ACTIVE”,
resume CLOB);

D.
CREATE TABLE EMP_1
(emp_id NUMBER,
emp_name VARCHAR2(25),
start_date DATE,
emp_status VARCHAR2(10) DEFAULT ‘ACTIVE’,
resume CLOB);

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.)



Leave a Reply 7

Your email address will not be published. Required fields are marked *


freddy

freddy

both B and D are correct.

freddy

freddy

only D is correct

B is wrong since the table name must begin with a letter

Eamon

Eamon

Each of A, C and D will work.
B wont as mentioned by Freddy above.

However C is better as it allows you to insert cvs that are larger than 200 chars. (probably important)
D is slightly better as it allows you to insert larger emp_id’s (not so important)

Dmitry

Dmitry

There are incorrect quotes in C. A, B ore correct

Dmitry

Dmitry

A, D are correct, sorry)

Dilruba

Dilruba

A is wrong because for Clob columns declaration has to be WITHOUT precision or scale.