MySQL Multiple Choice Questions on “Populating & Modifying Tables”.
1. Which statement is used for updating existing information in the table?
a) UPDATE
b) WHERE
c) MODIFY
d) ALTER
Answer: a
Clarification: None.
2. Which statement is used to delete an existing row from the table?
a) DELETE
b) WHERE
c) MODIFY
d) None of the mentioned
Answer: a
Clarification: None.
3. In the following MySQL command how many rows will be updated?
UPDATE person SET lname=’s’, Fname = ’p’, WHERE person_id = 1; /* person_id is a primary key */
a) Single row
b) Double row
c) No row
d) None of the mentioned
Answer: a
Clarification: None.
4. In the following MySQL command how many rows will be updated?
UPDATE person SET lname=’s’, Fname=’p’, WHERE person_id<10; /* person_id is a primary key */
a) 0-9
b) 1-6
c) No row
d) None of the mentioned
Answer: a
Clarification: None.
5. In the following MySQL command how many rows will be deleted?
DELETE person WHERE person_id=1; /*person_id is a primary key */
a) 1
b) 0
c) No row
d) None of the mentioned
Answer: a
Clarification: None.
6. In the following MySQL command how many rows will be deleted?
DELETE person WHERE person_id<10; /*person_id is a primary key */
a) 0-9
b) 1-7
c) No row
d) None of the mentioned
Answer: a
Clarification: None.
7. “INSERT” is same as “UPDATE”?
a) NO
b) YES
c) May be
d) None of the mentioned
Answer: a
Clarification: “INSERT “is used to entering the data in the newly created table while “UPDATE” is used to modify the data which is already inserted with help of statement “INSERT”.
8. Which clause is used to rename the existing table?
a) RENAME
b) MODIFY
c) ALTER
d) None of the mentioned
Answer: a
9. Which of the following functions are not performed by “ALTER” clause?
a) Change the name of the table
b) Change the name of the column
c) Drop a column
d) All of the mentioned
Answer: d
