This set of MySQL Multiple Choice Questions & Answers (MCQs) focuses on “Populating & Modifying Tables – 1”.
1. Which Statement is used to insert the values in the table?
a) INSERT INTO
b) Insert
c) INSERT
d) None of the mentioned
View Answer
Explanation: None.
2. Is it necessary to insert the value in each column of the table?
a) Yes
b) No
c) Depends on the server
d) Depends on the usage of the table
View Answer
Explanation: It is not necessary to insert the value in each column because there always a default value is inserted by the server “NULL”.
3. In the following SQL query, what does “person” stands for?
INSERT INTO person (person_id, fname, lname) VALUES (1,’S’,’P’);
a) Composite attributes
b) Multivalued attributes
c) Table name
d) None of the mentioned
View Answer
Explanation: None.
4. In the following SQL query, what does “person_id” stands for?
CREATE TABLE person (person_ id SMALLINT UNSIGNED, fname VARCHAR(20), lname VARCHAR(20), CONSTRAINT pk_person PRIMARY KEY (person_id));
a) Normal attribute of the table
b) Super key
c) Composite key
d) Primary key
View Answer
Explanation: Primary key is also termed as a super key.
5. Which statement can be used for modifying the definition for an existing table?
a) ALTER
b) Modified
c) SELECT
d) FROM
View Answer
Explanation: None.
6. Which feature is used for the automatic increment of the column?
a) AUTO_INCREMENT
b) AUTO
c) INCREMENT
d) All of the mentioned
View Answer
Explanation: None.
7. Which among the following is the correct syntax for modifying the definition of an existing table?
a) ALTER TABLE person MODIFY person_id SMALLINT UNSIGNED AUTO_INCREMENT;
b) ALTER TABLE person person_id SMALLINT UNSIGNED AUTO_INCREMENT;
c) ALTER TABLE person MODIFY person_id ;
d) ALTER TABLE person
View Answer
Explanation: None.
8. Will the following SQL command produce any error?
INSERT INTO person (person_id, fname,lname) VALUES (1,’S’,’U’), VALUES (1,’T’,’U’); /* where person_id is a primary key */
a) Error
b) No Error
c) Depends
d) None of the mentioned
View Answer
Explanation: Person_id declared as a primary key therefore it never contain same value.
9. Will the following SQL command produce any error?
INSERT INTO person (person_id, fname,lname) VALUES (1,’S’,’U’), VALUES (2,’T’,’U’); /* where person_id is a primary key */
a) Error
b) No Error
c) Depends
d) None of the mentioned
View Answer
Explanation: None.
10. What is the default value of column?
a) NULL
b) 0
c) -1
d) Undefined
View Answer
Explanation: When table is defined in Mysql then each column related to table will contain NULL Value as default.
Sanfoundry Global Education & Learning Series – MySQL Database.
To practice all areas of MySQL Database, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Apply for Programming Internship
- Check Information Technology Books
- Check MySQL Books
- Practice Programming MCQs