Computer Science, asked by nandhandamera, 2 months ago

When we attempt to create the salary table with this command:
1.CREATE TABLE salary
2.(employee_id NUMBER(9)
3.CONSTRAINT salary_pk PRIMARY KEY,
4.1995_salaryNUMBER(8.2),
5.manager_name VARCHAR2(25)
6.CONSTRAINT mgr_name_nn NOT NULL,
7.Ssalary_96NUMBER(8,2));
Which two lines of this statement will return errors?​

Answers

Answered by ankhidassarma9
1

Answer:

1. 1995_salaryNUMBER(8.2),

2. Ssalary_96NUMBER(8,2)

These  lines will give error .

Explanation:

  • Column Names or Attribute name can contain only alphanumeric characters and must begin with an alphabetic character or an underscore (_). Hence, 1995_salaryNUMBER(8.2) will give an error.
  • Ssalary_96NUMBER(8,2) will give an error as there is no gap between attribute name and data type Number.

The actual error-free command will be like this:

CREATE TABLE salary

(employee_id NUMBER(9)

CONSTRAINT salary_pk PRIMARY KEY,

salary_1995 NUMBER(8.2),

manager_name VARCHAR2(25)

CONSTRAINT mgr_name_nn NOT NULL,

Ssalary_96 NUMBER(8,2));

#SPJ3

Answered by anusha195sl
1

Answer:

The correct answer is option 1 & 7.

Explanation:

From the above statements, we know that,

1995_salaryNUMBER

Here, the attribute name and column name will only support the alphanumerical characters. They are represented by underscore(_) and alphabetic character.

Therefore, it will show error.

Ssalary_96NUMBER(8,2)

When there is no spaces between a data type number and attribute name it will show error.

Syntax for the following is as follows:

CREATE TABLE salary

(employee_id NUMBER(9)

CONSTRAINT salary_pk PRIMARY KEY,

salary_1995 NUMBER(8.2),

manager_name VARCHAR2(25)

CONSTRAINT mgr_name_nn NOT NULL,

Ssalary_96 NUMBER(8,2));

Therefore, from the above syntax we can conclude that, the syntax will give correct salary table in the data.

#SPJ3

Similar questions