COMPUTER SCIENCE AND ENGINEERING
SQL
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
Which is the correct query to delete the rows of employees whose exp is less than 10.
|
DELETE * FROM EMP WHERE EXP<10;
|
|
DELETE FROM EMP;
|
|
DELETE FROM EMP WHERE EXP<10;
|
|
DELETE FROM EMP WHERE EXP>10;
|
Explanation:
Detailed explanation-1: -As we can see, the SELECT command returns an empty set as all the records from the “Employee details” table have been deleted. We can also use the TRUNCATE command to delete all the records from a table.
Detailed explanation-2: -The DELETE Statement in SQL is used to delete existing records from a table.
Detailed explanation-3: -SQL Truncate Command. SQL Truncate is a data definition language (DDL) command. It removes all rows in a table.
Detailed explanation-4: -The DELETE statement is used to delete existing records in a table.
There is 1 question to complete.