1. Which Statement is used to insert the values in the table?
a) INSERT INTO
b) Insert
c) INSERT
d) None of the mentioned
Answer
Answer: a [Reason:] 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
Answer
Answer: b [Reason:] 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 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
Answer
Answer: c [Reason:] None.
4. In the following 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
Answer
Answer: b [Reason:] 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
Answer
Answer: a [Reason:] None.
6. Which feature is used for automatic increment of the column?
a) AUTO_INCREMENT
b) AUTO
c) INCREMENT
d) All of the mentioned
Answer
Answer: a [Reason:] 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
Answer
Answer: a [Reason:] None.
8. Will this query 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
Answer
Answer: a [Reason:] Person_id declared as a primary key therefore it never contain same value.
9. Will this query 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
Answer
Answer: b [Reason:] None.
10. What is the default value of column?
a) NULL
b) 0
c) -1
d) Undefined
Answer
Answer: a [Reason:] When table is defined in Mysql then each column related to table will contain NULL Value as default.