English

code snippet. CREATE TABLE student( name CHAR(30) student_id INT, gender CHAR(1), PRIMARY KEY (student_id) ); In the following query how many rows will be deleted? DELETE student WHERE student_id=109;

Advertisements
Advertisements

Question

Choose the appropriate answer with respect to the following code snippet.

code snippet.
CREATE TABLE student(
name CHAR(30)
student_id INT,
gender CHAR(1),
PRIMARY KEY (student_id)
);

In the following query how many rows will be deleted? 

DELETE student
WHERE student_id=109;

Options

  • 1 row

  • All the rows where student ID is equal to 109

  • No row will be deleted

  • 2 rows

MCQ
Advertisements

Solution

1 row

Explanation:

student_id is a PRIMARY KEY, so each ID is unique. Therefore, only 1 row with student_id = 109 will be deleted.

shaalaa.com
  Is there an error in this question or solution?
Chapter 8: Introduction to Structured Query Language (SQL) - Exercise [Page 170]

APPEARS IN

NCERT Informatics Practices [English] Class 11
Chapter 8 Introduction to Structured Query Language (SQL)
Exercise | Q 2. e) | Page 170
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×