250+ TOP MCQs on Table Creation and Answers

MySQL Multiple Choice Questions on “Table Creation”.

1. Which among the following is the correct syntax for creating table?
a) CREATE TABLE name;
b) CREATE name;
c) CREATE TABLE
d) All of the mentioned

Answer: a
Clarification: None.

2. What is the role of “CONSTRAINS” in defining a table in Mysql?
a) Declaring primary key
b) Declaring Foreign Key
c) Restrictions on columns
d) All of the mentioned

Answer: d
Clarification: None.

3. Which command is used for the table definition in Mysql?
a) DESC table_name;
b) DESC table_name
c) DESC
d) None of the mentioned

Answer: a
Clarification: None.

4. Which among the following is the correct syntax for defining “Constraint Check” in Mysql?
a) gender char(1) check( gender IN (‘M’, ‘F’)),
b) gender char (1) check,
c) gender char (1) check ( gender ),
d) none of the mentioned

Answer: a
Clarification: Check constraint constrains the allowable values for a particular column.

5. Which data type character merges the “Check Constraint” into a data type definition?
a) ENUM
b) ENUM1
c) ENUM2
d) None of the mentioned

Answer: a
Clarification: None.

6. Which among the following is the correct syntax for defining “ENUM” in Mysql?
a) gender ENUM (‘M’, ‘F’),
b) gender ENUM,
c) gender ENUM ( ),
d) none of the mentioned

Answer: a
Clarification: None.

7. Which among the following are the correct definitions for “NULL” in Mysql?
a) Absence of value
b) Unknown
c) Empty set
d) All of the mentioned

Answer: d
Clarification: None.

8. Find out the logical error in the following MySQL code snippet?

   CREATE TABLE person
   ( person_id VARCHAR(20),
    Name VARCHAR (20),
    Address VARCHAR (20),
    Mobile_no  SMALLINT 
    );

a) Lesser number of columns
b) Incorrect definition
c) Primary key is missing
d) None of the mentioned

  250+ TOP MCQs on Handling Errors and Processing Command Options

Answer: c
Clarification: Primary key is an essential attribute for each table declared in Mysql.

9. What is the meaning of “REFERENCES” in table definition?
a) Primary key
b) NULL
c) Foreign Key
d) A ”foreign Key” belong to this particular table

Answer: d
Clarification: When “Foreign Key” declared in a table then it necessary to define the name of the table to which it belong with help of constraint “REFERENCES”.

10. What default value gets stored in columns of the table?
a) NULL
b) 0
c) 1
d) -1

Answer: a
Clarification: NULL is the default value as it stands for “Absence of value”.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top