0% found this document useful (0 votes)
15 views4 pages

MCQ Mysql (Swapnil)

The document contains a series of multiple-choice questions related to MySQL, covering topics such as table creation syntax, constraints, data types, and subqueries. It includes questions about the correct commands and definitions used in MySQL, as well as logical errors in code snippets. The document is likely intended for an assessment or examination format, with a total score of 14 out of 20 marks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views4 pages

MCQ Mysql (Swapnil)

The document contains a series of multiple-choice questions related to MySQL, covering topics such as table creation syntax, constraints, data types, and subqueries. It includes questions about the correct commands and definitions used in MySQL, as well as logical errors in code snippets. The document is likely intended for an assessment or examination format, with a total score of 14 out of 20 marks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

MYSQL Faculty: Asfa Shaikh

Marks: 14/20

Date: 04-08-2025

Aptech, Andheri

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

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

3. 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

4. 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

5. 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

6 . Which data type character merges the “Check Constraint” into a data
type definition?
a) ENUM
b) ENUM1
c) ENUM2
d) None of the mentioned
7. 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

8.Which key declares that an index in one table is related to that in


another?
a) primary
b) secondary
c) foreign
d) cross

9. What default value gets stored in columns of the table?


a) NULL
b) 0
c) 1
d) -1

10. Which subquery returns a single value?


a) scalar
b) column
c) row
d) table

11. The facility that allows nesting one select statement into another is
called __________
a) nesting
b) binding
c) subquerying
d) encapsulating

12. Which operators are used when a subquery returns multiple rows
to be evaluated in comparison to the outer query?
a) IN and NOT IN
b) EXISTS and NOT EXISTS
c) OUTER JOIN and INNER JOIN
d) LEFT JOIN and RIGHT JOIN

13. The ALL subquery performs which operation?


a) row
b) column
c) table
d) database

14. Which of these operators perform similar operations like ALL and
ANY?
a) SOME
b) MANY
c) SELECT
d) GROUP

15. Which of these operators does not perform relative-value


comparisons?
a) =
b) ==
c) <=
d) >=

16. In which language MYSQL is written?

a) PYTHON
b) C/C+
c) JAVA
d) COBOL

17. To see the list of options provided by MYSQL which of the following
command is used?

HELP

–HELP

-- HELP

ELP-
18. What do you mean by HOST in MYSQL?

HOST is the user name.

HOST is the representation of where the MYSQL server is running.

HOST is the administration’s machine name.

19. Is a semicolon necessary after every query?

a) TRUE
b) FALSE

20. To know your MYSQL version and current date which of the following
command you should use?

a) VERSION, CURRENT_DATE();
b) SELECT VERSION, CURRENTDATE();
c) SELECT VERSION(), CURRENT_DATE;
d) SELECT VERSON(),CURRENT_DATE();

You might also like