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.

  1. A.

    I : Drop table R; II : Delete from R

  2. B.

    I : Delete from R; II : Drop table R

  3. C.

    I : Delete table R; II : Drop from R

  4. 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'.

Explore the full course: Hpsc Pgt Computer Science