हिंदी

code snippet. CREATE TABLE student( name CHAR(30) student_id INT, gender CHAR(1), PRIMARY KEY (student_id) ); What will be the output of following query? INSERT INTO student

Advertisements
Advertisements

प्रश्न

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)
);

What will be the output of following query?
INSERT INTO student

VALUES (“Suhana”,109,’F’),
VALUES (“Rivaan”,102,’M’),
VALUES (“Atharv”,103,’M’),
VALUES (“Rishika”,105,’F’),
VALUES (“Garvit”,104,’M’),
VALUES (“Shaurya”,109,’M’);

विकल्प

  • Error

  • No Error

  • Depends on compiler

  • Successful completion of the query

MCQ
Advertisements

उत्तर

Error

Explanation:

INSERT INTO should use one VALUES keyword followed by multiple rows. Also, it student_id = 109 is repeated, but it is a PRIMARY KEY, so duplicate values are not allowed.

shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 8: Introduction to Structured Query Language (SQL) - Exercise [पृष्ठ १७०]

APPEARS IN

एनसीईआरटी Informatics Practices [English] Class 11
अध्याय 8 Introduction to Structured Query Language (SQL)
Exercise | Q 2. d) | पृष्ठ १७०
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×