Question 5

This question is based on following table : TABLE : DELIVERY

This question is based on following table : TABLE : DELIVERY SNO | DBOY | ITEM | STAR | AMOUNT 1001 | AMAN | FOOD | 5 | 3000 1005 | JONES | MEDICINE | 3 | 5000 1008 | AMAN | MEDICINE | 2 | 4000 1009 | RAZID | FOOD | 4 | 4500 1010 | JONES | GIFT | 5 | 5000 1018 | AMAN | FOOD | 5 | 3000 1022 | RAZID | MEDICINE | 4 | 5000 Which of the following SQL commands will remove the rows, which have column value of STAR less than 5 ?
  1. AREMOVE FROM DELIVERY WHERE STAR < 5;
  2. BDROP TABLE DELIVERY WHERE STAR < 5;
  3. CDELETE FROM DELIVERY WHERE STAR < 5;
  4. DDELETE * FROM DELIVERY WHERE STAR < 5;
Show answerHide answer

Correct answer: (C) DELETE FROM DELIVERY WHERE STAR < 5;

Explanation

DELETE FROM table WHERE condition removes matching rows. There is no REMOVE command, DROP removes the whole table, and DELETE * is not valid standard SQL.

From DSSSB TGT Computer Science Practice Set 2

This is question 5 of DSSSB TGT Computer Science Practice Set 2. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.