Multiple choice

Suppose we are having relation schema as student (name, student-id, degree-level) with primary key as student-id. (i) INSERT INTO student VALUES. (“Himani”, 1928, “B.E.”) (ii) DELETE FROM student (iii) INSERT INTO student VALUES (“Hemant”, 1220, “B. Tech”) (iv) ALTER TABLE student ADD ( subject varchar(20)) (v) ALTER TABLE student DROP subject. What will be the results of the above sequence?

  1. Gives error, since we are deleting the table.

  2. In student $\theta$ table we add new attributes as subject.
  3. In student table we have one tuple with values “Hitesh”, 1220,”B.tech”.

  4. In student table we have one tuple with value “Hitesh”, 1928. an “B.E”.

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

First we insert values in student table as “Hitesh”, 1928, “B.E”. Then we delete tuple from student but table is still known to database, if it is an empty relation.After that we again inserting tuple into student having values “Hitesh”, 1220, and “B.Tech”After that by using ALTER command we add one attribute as subject.After that we again use ALTER command to drop attribute subject.So we remain with student relation having values “Hitesh”, 1220,'B.Tech”