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?
