Directions (Q96–100): A university database has the tables EMPLOYEE (EID, NAME, SALARY, DEPTNO, HODEID …; PRIMARY KEY EID; HODEID references EMPLOYEE(EID); DEPTNO references DEPARTMENT(DID)), DEPARTMENT (DID, DNAME, HODID; PRIMARY KEY DID; UNIQUE DNAME; HODID references EMPLOYEE(EID)) and PROJECTWORK (EMPID, PROJNO; PRIMARY KEY (EMPID, PROJNO); EMPID references EMPLOYEE(EID)).
In reference to the above given table
structures, which of the following
query/queries will drop the 'SALARY'
column from 'EMPLOYEE' table?
(A) ALTER TABLE EMPLOYEE DROP
SALARY CASCADE;
(B) ALTER TABLE EMPLOYEE DROP
SALARY RESTRICT;
(C) ALTER EMPLOYEE DROP SALARY;
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: A. (A) and (B) only
Explanation
ALTER TABLE EMPLOYEE DROP SALARY with CASCADE or RESTRICT is valid SQL; ALTER EMPLOYEE (without TABLE) is not.
More Database Management Systems questions
- Refer table, structures given above. The university decided to give all employees in the 'SCIENCE' department a 20% rise in salary. Which o…
- Which of the component module of DBMS does rearrangement and possible ordering of operations, eliminate redundancy in query and use efficie…
- Given two tables R1(x,y) and R2(y,z) with 50 and 30 numbers of tuples respectively. Find the maximum number of tuples in the output of natu…
- Given two tables EMPLOYEE (EID, ENAME, DEPTNO) DEPARTMENT (DEPTNO, DEPTNAME) Find the most appropriate statement of the given query : Selec…
- Find the minimum number of tables required for converting the following entity relationship diagram into a relational database.
- Two concurrent executing transactions 1 and T 2 are allowed to update same stock item say ' A ' in an uncontrolled manner. In such scenario…