Choose the SQL commands to perform following operations on a relation R: I:…
2022
Choose the SQL commands to perform following operations on a relation R: I: Retain Relation R in database, but delete all tuples in R. II: Delete all information about R in Database.
- A.
I : Drop table R; II : Delete from R
- B.
I : Delete from R; II : Drop table R
- C.
I : Delete table R; II : Drop from R
- D.
I : Alter table R; II : Alter R Drop
Attempted by 1016 students.
Show answer & explanation
Correct answer: B
Step 1: Understand the operations. Operation I requires deleting all tuples from relation R while keeping the table structure. Operation II requires removing the entire relation R, including its structure and data. Step 2: Identify correct SQL commands. 'Delete from R' removes all rows from table R but keeps the table. 'Drop table R' removes the entire table, including its structure and data. Step 3: Match commands to operations. For I, use 'Delete from R'. For II, use 'Drop table R'.