Google News
logo
MySQL - Quiz(MCQ)
A)
Cross-platform, open-source and free
B)
A relational database management system
C)
Developed, distributed, and supported by Oracle Corporation
D)
All of the above

Correct Answer :   All of the above


Explanation :

MySQL is an open-source relational database management system (RDBMS). Its name is a combination of "My", the name of co-founder Michael Widenius's daughter, and "SQL", the abbreviation for Structured Query Language. A relational database organizes data into one or more data tables in which data may be related to each other; these relations help structure the data. 
 
SQL is a language programmers use to create, modify and extract data from the relational database, as well as control user access to the database. In addition to relational databases and SQL, an RDBMS like MySQL works with an operating system to implement a relational database in a computer's storage system, manages users, allows for network access and facilitates testing database integrity and creation of backups.

MySQL was created by a Swedish company, MySQL AB, founded by Swedes David Axmark, Allan Larsson and Finland Swede Michael "Monty" Widenius. Original development of MySQL by Widenius and Axmark began in 1994
 
The first version of MySQL appeared on 23 May 1995. It was initially created for personal usage from mSQL based on the low-level language ISAM, which the creators considered too slow and inflexible. They created a new SQL interface, while keeping the same API as mSQL. By keeping the API consistent with the mSQL system, many developers were able to use MySQL instead of the (proprietarily licensed) mSQL antecedent.

A)
23 May 1995
B)
23 May 1994
C)
23 May 1993
D)
23 May 1992

Correct Answer :   23 May 1995


Explanation :

MySQL was created by a Swedish company, MySQL AB, founded by Swedes David Axmark, Allan Larsson and Finland Swede Michael "Monty" Widenius. Original development of MySQL by Widenius and Axmark began in 1994. 
 
The first version of MySQL appeared on 23 May 1995. It was initially created for personal usage from mSQL based on the low-level language ISAM, which the creators considered too slow and inflexible. They created a new SQL interface, while keeping the same API as mSQL. By keeping the API consistent with the mSQL system, many developers were able to use MySQL instead of the (proprietarily licensed) mSQL antecedent.

A)
GET
B)
OPEN
C)
SELECT
D)
EXTRACT

Correct Answer :   SELECT

A)
SAVE
B)
UPDATE
C)
INSERT
D)
MODIFY

Correct Answer :   UPDATE

A)
REMOVE
B)
COLLAPSE
C)
DELETE
D)
None of the Above

Correct Answer :   DELETE

A)
INSERT INTO
B)
ADD NEW
C)
INSERT NEW
D)
ADD RECORD

Correct Answer :   INSERT INTO

A)
IS
B)
LIKE
C)
SAME
D)
WHERE

Correct Answer :   LIKE


Explanation : The ‘LIKE’ clause filters information that match a given pattern. ‘WHERE’ clause selects information that is specified by a condition. ‘IS’ is used to match the exact condition specified.

8 .
What column names are displayed when this SQL command is executed?
 
SHOW COLUMNS FROM tbl_name LIKE '%name';
A)
suffixed with ‘%name’
B)
prefixed with ‘name’
C)
prefixed with ‘%name’
D)
suffixed with ‘name’

Correct Answer :   suffixed with ‘name’


Explaination : The wildcard ‘%’ is used to indicate that any number of characters can replace it. All column names that end in ‘name’ are displayed. Additional information of columns like type and size are listed.

A)
mysql
B)
sampdb
C)
readme_db
D)
information_schema

Correct Answer :   information_schema


Explanation : After installation of MySQL, ‘information_schema’ is the special database that always exists. ‘mysql’ can be seen depending on access rights. It holds the grant tables. ‘sampdb’ and ‘readme_db’ do not exist by default.

10 .
In the following SQL code, InnoDB is __________
 
CREATE TABLE student (
		name CHAR(30),
		student_id INT,
		PRIMARY KEY (student_id)
	) ENGINE = InnoDB;
A)
table name
B)
storage engine
C)
database name
D)
reference engine

Correct Answer :   storage engine


Explaination : InnoDB’ is the name of the ‘storage engine’ for the above table. The ‘ENGINE’ clause is used to specify the name of the storage engine that MySQL should use to handle the table being created. MySQL has several storage engines with its own properties.

11 .
Identify the table name in the following SQL statement.
 
INSERT INTO student VALUES('Kyle','M',NULL);
A)
M
B)
Kyle
C)
Student
D)
Values

Correct Answer :   Student


Explaination : The ‘INSERT INTO’ clause here inserts a row in the table named ‘student’. The table has three fields. The first field or attribute value in the row/tuple is ‘Kyle’. The second attribute value is ‘M’ and the last attribute is set to NULL.

A)
GROUP
B)
GROUP BY
C)
ORDER
D)
ORDER BY

Correct Answer :   ORDER BY


Explanation : An ‘ORDER BY’ clause specifies the sort order. The data is sorted in ascending order by default. To sort in descending order, the keyword DESC is appended to the ‘ORDER BY’ clause. ‘GROUP BY’ is used to group the query results according to the criteria.

A)
null
B)
zero
C)
a positive value
D)
a negative value

Correct Answer :   null


Explanation : In MySQL, NULL is not comparable to other known values. It will result in a NULL when compared to any value. The following statement would result in four NULLs : ‘SELECT NULL = 0, NULL < 0, NULL <> 0, NULL > 0’.

A)
SELECT Persons.FirstName
B)
SELECT FirstName FROM Persons
C)
EXTRACT FirstName FROM Persons
D)
None of the Above

Correct Answer :   SELECT FirstName FROM Persons

A)
SELECT Persons
B)
SELECT *.Persons
C)
SELECT * FROM Persons
D)
SELECT [all] FROM Persons

Correct Answer :   SELECT * FROM Persons

A)
SELECT * FROM Persons WHERE FirstName='Peter'
B)
SELECT * FROM Persons WHERE FirstName<>'Peter'
C)
SELECT [all] FROM Persons WHERE FirstName='Peter'
D)
SELECT [all] FROM Persons WHERE FirstName LIKE 'Peter'

Correct Answer :   SELECT * FROM Persons WHERE FirstName='Peter'

A)
SELECT * FROM Persons WHERE FirstName='a'
B)
SELECT * FROM Persons WHERE FirstName LIKE 'a%'
C)
SELECT * FROM Persons WHERE FirstName='%a%'
D)
SELECT * FROM Persons WHERE FirstName LIKE '%a'

Correct Answer :   SELECT * FROM Persons WHERE FirstName LIKE 'a%'

18 .
The number of attributes in the following SQL table is _________

CREATE TABLE employee (
		emp_name CHAR(30),
		emp_id INT
	);​
A)
1
B)
2
C)
3
D)
30

Correct Answer :   2


Explaination : The name of the table created is ’employee’. It has two attributes, namely, ’emp_name’ and ’emp_id’. The attributes are the columns in a table. emp_name is of type string and emp_id is of type integer.

A)
-p
B)
-e
C)
-h
D)
-u

Correct Answer :   -p


Explanation : The command ‘mysql -p’ (alternative form: –password) prompts for the password. ‘-h’ (alternative form: –host) specifies the host where the MySQL server is running. ‘-u’ is for specifying the username.

A)
USE sampledb
B)
SELECT DATABASE()
C)
SELECT DATABASE sampledb
D)
USE DATABASE sampledb

Correct Answer :   USE sampledb


Explanation : ‘USE sampledb’ selects sampledb as the default database. Initially, ‘SELECT DATABASE();’ command displays ‘NULL’, since no database is selected by default. The other two are not valid commands.

21 .
What is ‘tamp’ in the following MySQL command?
 
mysql -h xyz.host.try.net -p -u tamp
A)
host name
B)
password
C)
table name
D)
user name

Correct Answer :   user name


Explaination : tamp’ is the name of the user. The user will be prompted for password due to the ‘-p’ option. ‘xyz.host.try’ is the host name here. The entire command specifies the host-user pair and prompts for password to establish the connection.

A)
VIEW tbl_name
B)
SELECT tbl_name
C)
DESCRIBE tbl_name
D)
SELECT TABLE tbl_name

Correct Answer :   DESCRIBE tbl_name


Explanation : The ‘DESCRIBE’ command is issued to see the structure of the table ‘tbl_name’. It shows the structure in the format: Field-Type-Null-Key-Default-Extra. The ‘VIEW’ and ‘SELECT’ commands are used to see the contents of the table.

A)
Ctrl-E
B)
Ctrl-A
C)
Ctrl-D
D)
Esc-a

Correct Answer :   Ctrl-A


Explanation : Control-A moves the cursor to the beginning of the line. Ctrl-E moves the cursor to the end of the line. Control-D deletes the character under the cursor whereas Esc-a is not valid.

A)
.history
B)
.queries
C)
.mysql_queries
D)
.mysql_history

Correct Answer :   .mysql_history


Explanation : Statements entered in ‘MySQL’ are stored in the file named ‘.mysql_history. This file is located in the home directory itself. The SQL statements can be directly pasted into this file.

A)
chmod +x run_me.sh
B)
chmod +e run_me.sh
C)
chmod +y run_me.sh
D)
chmod +a run_me.sh

Correct Answer :   chmod +x run_me.sh


Explanation : The command ‘chmod +x file_name’ makes a script file executable. mysql supports reading from a script file and executing queries from it. Before a script is run, it is necessary for it to be made executable

A)
-p
B)
-t
C)
-pf
D)
-tf

Correct Answer :   -t


Explanation : MySQL produces output in tab-delimited format when it is run in batch mode. Suppose a table-format output is desired, the -t option is used along with the mysql command. -tf is not a valid option.

A)
SELECT FirstName='Peter', LastName='Jackson' FROM Persons
B)
SELECT * FROM Persons WHERE FirstName<>'Peter' AND LastName<>'Jackson'
C)
SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson'
D)
None of the Above

Correct Answer :   SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson'

A)
SELECT LastName>'Hansen' AND LastName<'Pettersen' FROM Persons
B)
SELECT * FROM Persons WHERE LastName>'Hansen' AND LastName<'Pettersen'
C)
SELECT * FROM Persons WHERE LastName BETWEEN 'Hansen' AND 'Pettersen'
D)
None of the Above

Correct Answer :   SELECT * FROM Persons WHERE LastName BETWEEN 'Hansen' AND 'Pettersen'

A)
SELECT UNIQUE
B)
SELECT DISTINCT
C)
SELECT DIFFERENT
D)
None of the Above

Correct Answer :   SELECT DISTINCT

A)
SORT
B)
SORT BY
C)
ORDER
D)
ORDER BY

Correct Answer :   ORDER BY

A)
SELECT * FROM Persons ORDER BY FirstName DESC
B)
SELECT * FROM Persons SORT 'FirstName' DESC
C)
SELECT * FROM Persons ORDER FirstName DESC
D)
SELECT * FROM Persons SORT BY 'FirstName' DESC

Correct Answer :   SELECT * FROM Persons ORDER BY FirstName DESC

A)
INSERT INTO Persons VALUES ('Jimmy', 'Jackson')
B)
INSERT ('Jimmy', 'Jackson') INTO Persons
C)
INSERT VALUES ('Jimmy', 'Jackson') INTO Persons
D)
All of the Above

Correct Answer :   INSERT INTO Persons VALUES ('Jimmy', 'Jackson')

A)
INSERT ('Olsen') INTO Persons (LastName)
B)
INSERT INTO Persons ('Olsen') INTO LastName
C)
INSERT INTO Persons (LastName) VALUES ('Olsen')
D)
None of the Above

Correct Answer :   INSERT INTO Persons (LastName) VALUES ('Olsen')

A)
MODIFY Persons SET LastName='Hansen' INTO LastName='Nilsen
B)
UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen'
C)
UPDATE Persons SET LastName='Hansen' INTO LastName='Nilsen'
D)
MODIFY Persons SET LastName='Nilsen' WHERE LastName='Hansen'

Correct Answer :   UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen'

A)
DELETE FirstName='Peter' FROM Persons
B)
DELETE ROW FirstName='Peter'
C)
DELETE ROW FirstName='Peter' FROM Persons
D)
DELETE FROM Persons WHERE FirstName = 'Peter'

Correct Answer :   DELETE FROM Persons WHERE FirstName = 'Peter'

A)
SELECT NO(*) FROM Persons
B)
SELECT LEN(*) FROM Persons
C)
SELECT COUNT(*) FROM Persons
D)
SELECT COLUMNS(*) FROM Persons

Correct Answer :   SELECT COUNT(*) FROM Persons

A)
alias
B)
map
C)
label
D)
direct

Correct Answer :   alias


Explanation : If the shell program permits an alias, a short command can be mapped to a long command. This reduces the time taken by typing long commands frequently. An alias is defined by the keyword ‘alias’ followed by the short and long commands.

A)
.my.ini
B)
.my.cnf
C)
.my.opt
D)
.my.opc

Correct Answer :   .my.cnf


Explanation : Under Unix, an option file is set up by creating a file named ‘~/.my.cnf’ in the home directory. ‘C:\my.ini’ is the option file that is setup in Windows. An option file stores the connection parameters.

A)
SELECT * FROM `sampledb`.`member`
B)
SELECT * FROM `member.sampledb`
C)
SELECT * FROM `sampledb.member`
D)
SELECT * FROM `member`.`sampledb`

Correct Answer :   SELECT * FROM `sampledb`.`member`


Explanation : When quotes are being used to refer to a qualified name, the individual identifiers are quoted within the name separately. So, the database name `sampledb` and table name `tbl` are quoted separately.

A)
32
B)
64
C)
128
D)
256

Correct Answer :   256


Explanation : The identifiers in MySQL have a maximum length of 64 characters. However, the alias names for identifiers can have the number of characters up to 256. Aliases can also be quoted or unquoted.

A)
ANSI
B)
TRADITIONAL
C)
IGNORE_SPACE
D)
IGNORE_FUNC

Correct Answer :   IGNORE_SPACE


Explanation : The Server SQL mode value ‘IGNORE_FUNC’ is used to restrict the identifier naming conventions. When this is enabled, the names of built in functions can no longer be used as identifiers.

A)
id1
B)
123
C)
123id
D)
123_id

Correct Answer :   123


Explanation : In MySQL, the quoted and unquoted identifier names have differences in the level of restrictions imposed on them. An unquoted identifier name can’t have all digits since it would be impossible to distinguish it from an integer constant.

A)
.
B)
_
C)
$
D)
#

Correct Answer :   .


Explanation : An identifier is used to refer to a database or its elements. These elements can be entire tables or attributes. The names of these identifiers follow some set of rules, so they have a set of legal characters.

A)
INNER JOIN, OUTER JOIN, LEFT JOIN, RIGHT JOIN
B)
INNER JOIN, LEFT JOIN, RIGHT JOIN, CROSS JOIN
C)
Both (A) and (B)
D)
None of the Above

Correct Answer :   INNER JOIN, LEFT JOIN, RIGHT JOIN, CROSS JOIN

A)
IN
B)
UNION
C)
RANGE
D)
BETWEEN

Correct Answer :   BETWEEN

A)
LIKE
B)
GET
C)
FROM
D)
UPDATE

Correct Answer :   LIKE

A)
CREATE DB Customers
B)
CREATE DATABASE TAB Customers
C)
CREATE TABLE Customers
D)
CREATE DATABASE TABLE Customers

Correct Answer :   CREATE TABLE Customers

A)
info
B)
datum
C)
metadata
D)
record

Correct Answer :   metadata


Explanation : There are various ways in which MySQL facilitates the methods to obtain information about databases and the objects in them. For example, ‘SHOW’ statements and ‘INFORMATION_SCHEMA’.

A)
SHOW STATUS TABLE
B)
SHOW TABLE STATUS
C)
SHOW STATUS OF TABLE
D)
SHOW DEFAULT STATUS

Correct Answer :   SHOW TABLE STATUS


Explanation : MySQL provides a method to determine the storage engine for each table with the ‘SHOW TABLE STATUS’ statement. The output of this statement is the name of the storage engine indicator.

A)
NBD
B)
NBK
C)
NCD
D)
NDB

Correct Answer :   NDB


Explanation : The ‘INFORMATION_SCHEMA’ is a method to access information about the databases and its objects known as metadata. It has various tables that can be viewed with ‘SHOW’ statement.

A)
–keys
B)
–flag
C)
–no-data
D)
–indexes

Correct Answer :   –keys


Explanation : The ‘mysqlshow’ command has various flags to provide a lot of options on displaying tables. The ‘–keys’ flag is specifically used to show information about indexes in a table.

A)
LIST
B)
PROCESS
C)
THREADSLIST
D)
PROCESSLIST

Correct Answer :   PROCESSLIST


Explanation : The table ‘PROCESSLIST’ is responsible for storing all the information about the threads executing within the server. The other tables are not valid tables in the INFORMATION_SCHEMA.

A)
ENGINES, FILES
B)
FILES, PLUGINS
C)
ENGINES, PLUGINS
D)
PLUGINS, STATISTICS

Correct Answer :   ENGINES, PLUGINS


Explanation : The ‘INFORMATION_SCHEMA’ is a very useful in MySQL. It has many tables each serving its individual purpose. The storage engine information is stored in ENGINES and plugin information in PLUGINS.

A)
table_list
B)
select_list
C)
row_constraint
D)
grouping_columns

Correct Answer :   select_list


Explanation : Given above was a basic syntax of the SELECT statement. Everything in the syntax is optional except the ‘select_list’ option. All the others are free to be omitted, and will work fine.

A)
OUTER
B)
NATURAL
C)
CARTESIAN
D)
INNER JOIN

Correct Answer :   CARTESIAN


Explanation : In ‘cartesian product’, each row of each table is combined with each row in every other table to produce all possible combination. This produces a very large number of rows since the number is the product of rows.

A)
WHERE
B)
SORT
C)
GROUP
D)
GROUP BY

Correct Answer :   WHERE


Explanation : Sometimes the result of a join is very large and is not desirable. In these cases, the results can be filtered with the help of the ‘WHERE’ clause which is followed by a set of condition(s).

A)
OUTER JOIN
B)
NATURAL JOIN
C)
CARTESIAN JOIN
D)
INNER JOIN

Correct Answer :   INNER JOIN


Explanation : The joins ‘CROSS JOIN’ and ‘JOIN’ types are exactly similar to the ‘INNER JOIN’. The statements containing ‘INNER JOIN’ can replace it with ‘CROSS JOIN’ or ‘JOIN’ to get exactly the same result.

A)
INNER JOIN
B)
OUTER JOIN
C)
NATURAL JOIN
D)
CARTESIAN JOIN

Correct Answer :   OUTER JOIN


Explanation : The ‘inner join’ only deals with rows where a match can be found in both tables. The ‘LEFT JOIN’ and ‘RIGHT JOIN’ types are ‘OUTER JOIN’ types which differ from inner joins in this sense.

A)
RIGHT JOIN
B)
INNER JOIN
C)
CROSS JOIN
D)
CARTESIAN JOIN

Correct Answer :   RIGHT JOIN


Explanation : In a ‘RIGHT JOIN’, the output is produced for every row of the right table, even if it does not exist in the other table. This is the reason why it is called a ‘RIGHT JOIN’. ‘RIGHT JOIN’ and ‘LEFT JOIN’ are a kind of OUTER JOIN.

A)
Insert
B)
INSERT
C)
INSERT INTO
D)
None of the above

Correct Answer :   INSERT INTO

A)
FROM
B)
SELECT
C)
ALTER
D)
Modified

Correct Answer :   ALTER

A)
ALTER TABLE person
B)
ALTER TABLE person MODIFY person_id ;
C)
ALTER TABLE person person_id SMALLINT UNSIGNED AUTO_INCREMENT;
D)
ALTER TABLE person MODIFY person_id SMALLINT UNSIGNED AUTO_INCREMENT;

Correct Answer :   ALTER TABLE person MODIFY person_id SMALLINT UNSIGNED AUTO_INCREMENT;

A)
AUTO
B)
INCREMENT
C)
AUTO_INCREMENT
D)
All of the Above

Correct Answer :   AUTO_INCREMENT

64 .
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)
Primary key
B)
Super key
C)
Composite key
D)
Normal attribute of the table

Correct Answer :   Super key

A)
Use
B)
use database.name
C)
USE databasename;
D)
None of the Above

Correct Answer :   Use

A)
+-*
B)
+-|
C)
+-/
D)
+-}

Correct Answer :   +-|

A)
exit
B)
exit;
C)
exit()
D)
exit();

Correct Answer :   exit

A)
exit;
B)
quit;
C)
both exit; and quit;
D)
only exit;

Correct Answer :   both exit; and quit;

A)
SELECT
B)
select now()
C)
SELECT now()
D)
SELECT now();

Correct Answer :   SELECT now();

A)
Fixed length string
B)
Variable length string
C)
Either Fixed or Variable length string
D)
None of the above

Correct Answer :   Either Fixed or Variable length string


Explanation :

To store character data we can use two definitions :

Char(20) /*fixed length */
Varchar(20) /* variable length */

A)
Char
B)
Varchar
C)
Both Char and Varchar
D)
None of the above

Correct Answer :   Char

A)
120 bytes
B)
255 bytes
C)
360 bytes
D)
65, 535 bytes

Correct Answer :   255 bytes

A)
Upto 256 bytes
B)
Upto 65, 567 bytes
C)
Upto 65, 535 bytes
D)
None of the Above

Correct Answer :   Upto 65, 535 bytes

A)
Varchar
B)
Varchar2
C)
Varchar3
D)
None of the Above

Correct Answer :   Varchar2

A)
SHOW;
B)
CHARACTER;
C)
CHARACTER SET;
D)
SHOW CHARACTER SET;

Correct Answer :   SHOW CHARACTER SET;

A)
Long text
B)
text
C)
Tiny text
D)
Medium text

Correct Answer :   Long text


Explanation : Long text store 4, 294, 967, 295.

A)
Char
B)
Varchar
C)
Text type
D)
Both Varchar and Char

Correct Answer :   Text type

A)
Process terminate
B)
Data will be truncated
C)
Depend on the system
D)
Extra memory will be allocated

Correct Answer :   Data will be truncated


Explanation : Mysql cannot allocate dynamic memory therefore if data exceeds the memory then extra data will be truncated.

A)
Char
B)
Varchar
C)
Longtext
D)
Mediumtext

Correct Answer :   Mediumtext

A)
Varchar
B)
Longtext
C)
Mediumtext
D)
Either Varchar or Longtext

Correct Answer :   Longtext

A)
Whole numbers
B)
Natural numbers
C)
Rational numbers
D)
Both Whole and Natural numbers

Correct Answer :   Both Whole and Natural numbers

A)
Int
B)
Tinyint
C)
Smallint
D)
Mediumint

Correct Answer :   Int

A)
Total of six digits
B)
Total of five digits
C)
Total of four digits, not distributed uniformly
D)
Total of four digits, two to the left of decimal and two to the right of decimal

Correct Answer :   Total of four digits, two to the left of decimal and two to the right of decimal

A)
12345
B)
12345.1
C)
123.123
D)
12345.123

Correct Answer :   12345


Explanation : “float(5,0) says there should be total of five digit, in which no digit should be at the right of the decimal.

A)
Total of 1 digit
B)
Total of 2 digit
C)
Total of 2 digit, one digit at right of the decimal, one digit at left of the decimal
D)
None of the Above

Correct Answer :   Total of 1 digit

A)
3.402823466E+35
B)
3.402823466E+37
C)
3.402823466E+38
D)
3.402823466E+39

Correct Answer :   3.402823466E+38


Explanation : In MySQL, each datatype has its own range. Data types give an idea of the kind of values and the ranges that a variable is allowed to store. The maximum non zero value for FLOAT is 3.402823466E+38.

A)
±1.7976931348623157E+305
B)
±1.7976931348623157E+308
C)
±1.7976931348623157E+307
D)
±1.7976931348623157E+306

Correct Answer :   ±1.7976931348623157E+308


Explanation : In MySQL, all the datatypes have their own ranges. Data types give an idea of the kind of values and the ranges that a variable is allowed to store. The maximum non zero value for DOUBLE is ±1.7976931348623157E+308.

A)
1
B)
2
C)
3
D)
4

Correct Answer :   3


Explanation : The numeric datatypes used in MySQL vary over ranges. There are a variety of INT types in the type specification. TINYINT requires 1, SMALLINT requires 2 bytes and MEDIUMINT requires 3.

A)
INT
B)
BIT
C)
FLOAT
D)
DOUBLE

Correct Answer :   DOUBLE


Explanation : The REAL datatype, by default, is for the DOUBLE type. Floating point types can be defined as UNSIGNED. This eliminates the negative end of the type ranges. MySQL has a variety of default types.

A)
16
B)
32
C)
64
D)
128

Correct Answer :   64


Explanation : The SET type specification is very useful for storing a collection a ordered and distinct elements. The storage size required for this datatype is variable and dependent on the cardinality.

A)
65535
B)
65534
C)
65536
D)
65537

Correct Answer :   65535


Explanation : The allowable range of M for VARCHAR(M) syntactically is 1 to 65535, but the effective number of the maximum characters is less than 65535 since MySQL has a maximum row size of 65,535 bytes.

A)
String
B)
TIME
C)
ENUM
D)
Numeric

Correct Answer :   TIME


Explanation : In MySQL, there are different ways to handle the illegal values for different datatypes for default. For date or time columns, illegal values are converted to the appropriate “zero” value for the type.

A)
DISP WARNING
B)
SHOW WARNINGS
C)
DISP WARNINGS
D)
DISPLAY WARNINGS

Correct Answer :   SHOW WARNINGS


Explanation : In MySQL, the default value conversions are reported as warnings for INSERT, REPLACE and UPDATE statements. The SHOW WARNINGS command is used after executing one of those statements to see the warning messages.

A)
STRICT_ALL_TABLES
B)
ERROR_DIVIDE_BY_ZERO
C)
ERROR_WHEN_DIVIDE_BY_ZERO
D)
ERROR_FOR_DIVISION_BY_ZERO

Correct Answer :   ERROR_FOR_DIVISION_BY_ZERO


Explanation : To enable the check for divide by zero errors int all the storage engines, the SQL mode named ‘ERROR_FOR_DIVISION_BY_ZERO’ can be enabled. This is done by using SET sql_mode = ‘mode_name’.

A)
TRADITIONAL
B)
STRICT_ALL_TABLES
C)
ERROR_FOR_DIVISION_BY_ZERO
D)
ERROR_WHEN_DIVIDE_BY_ZERO

Correct Answer :   TRADITIONAL


Explanation : The ‘TRADITIONAL’ mode is used to enable the strict mode and all of the additional restrictions. It is done by the command SET sql_mod = ‘TRADITIONAL’; The other SQL modes have other functions.

A)
STRICT_ALL_TABLES
B)
STRICT_TRANS_TABLES
C)
TRADITIONAL
D)
ERROR_WHEN_DIVIDE_BY_ZERO

Correct Answer :   TRADITIONAL


Explanation : In MySQL, the ‘TRADITIONAL’ mode is used to enable the strict mode. It also enables all of the additional restrictions by the command ‘SET sql_mod = ‘TRADITIONAL” The other SQL modes have other functions.

A)
STOP_DATES_CHECK
B)
ALLOW_INVALID_DATES
C)
ALLOW_DATES_INVALID
D)
PREVENT_DATE_CHECK

Correct Answer :   ALLOW_INVALID_DATES


Explanation : In MySQL, it is also possible to selectively weaken the strict mode at some places. If the ALLOW_INVALID_DATES SQL mode is enabled, MySQL doesn’t perform full checking of the date parts.

A)
PREVENT
B)
SUPPRESS
C)
NO_ZERO_DATE
D)
NO_ZERO_IN_DATE

Correct Answer :   NO_ZERO_DATE


Explanation : The ‘NO_ZERO_DATE’ prevents the entry of the ‘zero’ date value in strict mode. In MySQL, to suppress errors, the IGNORE keyword is used with INSERT or UPDATE statements.

A)
INT
B)
FLOAT
C)
DOUBLE
D)
CHARACTER

Correct Answer :   INT


Explanation : The AUTO_INCREMENT is a column attribute and it is best used with the integer datatypes. It automatically assigns monotonically increasing values to the AUTO_INCREMENT columns.

A)
INT
B)
FLOAT
C)
DOUBLE
D)
DECIMAL

Correct Answer :   DECIMAL


Explanation : Currency is a numeric information. For monetary calculations, FLOAT and DOUBLE are subject to rounding error and may not be suitable. A DECIMAL(M, 2) type is best suited for it.

A)
BIGINT
B)
TINYINT
C)
SMALLINT
D)
MEDIUMINT

Correct Answer :   BIGINT


Explanation : The different numeric types used in MySQL are used to store different range of values. To store values of the order of a million, the MEDIUMINT or BIGINT datatype is sufficient.

A)
CHAR
B)
TEXT
C)
VARCHAR
D)
TINYTEXT

Correct Answer :   TEXT


Explanation : In MySQL, the different string datatypes are used to store different lenghts of the string. Here, the length would refer to the number of characters in the string. TEXT stores longer strings.

A)
0
B)
1
C)
2
D)
3

Correct Answer :   0


Explanation : In MySQL, the ‘AUTO_INCREMENT’ values are a sequence of unique values assigned to the columns such that they increase monotonically. They begin with the value 1 and increment by a unit.

A)
SMALLINT SIGNED
B)
MEDIUMINT SIGNED
C)
MEDIUMINT UNSIGNED
D)
SMALLINT UNSIGNED

Correct Answer :   MEDIUMINT UNSIGNED

A)
BIGINT
B)
TINYINT
C)
MEDIUMINT
D)
SMALLINT

Correct Answer :   SMALLINT


Explanation : In order to facilitate the use of code written for SQL implementations from other vendors, MySQL maps the data types from the other vendor types to the appropriate MySQL type.

A)
BIGINT
B)
TINYINT
C)
SMALLINT
D)
MEDIUMINT

Correct Answer :   MEDIUMINT


Explanation : In order to facilitate the use of the code written for SQL implementations (reusability of code) from other vendors, MySQL maps the data types from the other vendor types to the appropriate MySQL type.

A)
TELL
B)
EXPLAIN
C)
SHOW
D)
DISPLAY

Correct Answer :   EXPLAIN


Explanation : In MySQL, by issuing an EXPLAIN statement MySQL displays some information about how it would execute a SELECT query without actually executing it. It is prefixed with the query.

A)
ANALYZE TABLE
B)
ANALYZE KEYS
C)
PERFORM ANALYSIS
D)
PERFORM TABLE ANALYSIS

Correct Answer :   ANALYZE TABLE


Explanation : In MySQL, for the MyISAM and InnoDB tables, the server can be told to perform an analysis of key values by issuing the ANALYZE TABLE statement. It helps in knowing about query optimization.

A)
SHOW
B)
VERIFY
C)
EXPLAIN
D)
ANALYZE

Correct Answer :   EXPLAIN


Explanation : The EXPLAIN statement in MySQL can tell whether the indexes are being used or not. This information is helpful when different ways of writing a statement need to be tested.

A)
USE INDEX
B)
FORCE INDEX
C)
STRAIGHT_JOIN
D)
IGNORE INDEX

Correct Answer :   STRAIGHT_JOIN


Explanation : STRAIGHT_JOIN is used to force the optimizer to use tables in a particular order. The MySQL optimizer by default considers itself free to determine the order in which to scan tables most quickly.

A)
INT/INT
B)
INT/BIGINT
C)
BIGINT/BIGINT
D)
None of the Above

Correct Answer :   INT/BIGINT


Explanation : On comparing indexed columns, identical data types will give better performance than dissimilar types. So an INT/INT or BIGINT/BIGINT comparison is faster than an INT/BIGINT comparison.

112 .
What are the results of the following SQL commands if col is an integer column?
 
1. SELECT * FROM mytbl WHERE num_col = '4';
2. SELECT * FROM mytbl WHERE num_col = 4;
A)
same
B)
different
C)
1 is an error
D)
2 is an error

Correct Answer :   same


Explaination : The first query invokes a type conversion. The conversion operation involves some performance penalty for converting the integer and string to double to perform the comparison.

A)
optimizer_prune
B)
optimizer_search
C)
optimizer_prune_level
D)
optimizer_search_depth

Correct Answer :   optimizer_search_depth


Explanation : In MySQL, the optimizer_search_depth system variable tells how far into the “future” of each incomplete plan the optimizer should look to evaluate whether it should be expanded further.

A)
mysqldump
B)
mysqladmin
C)
mysqlimport
D)
mysqlexport

Correct Answer :   mysqldump


Explanation : In MySQL, some distributions include a set of some client programs. ‘mysqldump’ exports the table definitions and the contents. ‘mysqladmin’ performs adminisitrative tasks.

A)
mysqlimport
B)
mysqldump
C)
mysqladmin
D)
mysqlexport

Correct Answer :   mysqlimport


Explanation : ‘mysqlimport’ loads the data files into the tables. In MySQL, some distributions include a set of some client programs. ‘mysqldump’ exports the table definitions and the contents.

A)
mysqlimport
B)
mysqldump
C)
mysqladmin
D)
mysqlexport

Correct Answer :   mysqladmin


Explanation : In MySQL, some distributions include a set of some client programs. ‘mysqladmin’ performs the administrative operations. ‘mysqlimport’ loads the data files into the tables.

A)
–run
B)
–force
C)
–ensure
D)
–violent

Correct Answer :   –force


Explanation : If SQL queries in a file are run using mysql in batch mode, mysql either quits after the first error. If the –force option is specified all the queries are executed indiscriminately.

A)
mysqld_safe
B)
comp_err
C)
mysql.server
D)
mysqld_multi

Correct Answer :   comp_err


Explanation : The program ‘comp_err’ is used during the MySQL build or the MySQL installation process. This program compiles the error message files from the error source files. The others are not run during startup.

A)
mysql
B)
mysqlcheck
C)
mysqladmin
D)
mysql_upgrade

Correct Answer :   mysql_upgrade


Explanation : mysql_upgrade is used after a MySQL upgrade operation. It checks tables for incompatibilities and repairs them if necessary. It updates the grant tables with any changes that have been made in newer versions of MySQL.

A)
mysqlslap
B)
mysqldump
C)
mysqladmin
D)
mysqlimport

Correct Answer :   mysqlslap


Explanation : mysqlslap is a client program designed to emulate client load for a MySQL server. It reports the timing of each stage. It works as if multiple clients are accessing the server.

A)
mysqldump
B)
mysql_config
C)
mysqlbinlog
D)
mysqlimport

Correct Answer :   mysqlbinlog


Explanation : ‘mysqlbinlog’ is a utility program for reading statements from a binary log. The log of executed statements contained in the binary log files can be used to help recover from a crash.

122 .
How many of these languages have interfaces to bind to the C API of MySQL?

Perl, PHP, Python​
A)
B)
1
C)
2
D)
3

Correct Answer :   3


Explaination : The client library provides the means through which the MySQL bindings for other languages can be built on top of the C API. This type of interface exists for Perl, PHP, Python and others.

A)
C
B)
C++
C)
Ruby
D)
Python

Correct Answer :   C


Explanation : In order to provide application development, MySQL provides a client library written in the C programming language. It enables the access of MySQL databases from a C program.

A)
C API
B)
C++ API
C)
Java API
D)
Python API

Correct Answer :   C API


Explanation : The primary programming interface to MySQL is the C API. It is used to implement some of the standard clients in the MySQL distribution including mysql, mysqladmin and mysqldump.

A)
database id
B)
database identity
C)
database integrity
D)
database interface

Correct Answer :   database interface


Explanation : In MySQL, DBI is implemented as a Perl module. It interfaces with other modules at the DBD (Database Driver) level. Each of it provides access to a specific database engine.

A)
C
B)
PHP
C)
Perl
D)
Python

Correct Answer :   PHP


Explanation : Like DBI, PHP includes support for accessing several database engines in addition to MySQL. It has engine specific interfaces, and interfaces that are more engine independent.

A)
PHP
B)
Perl
C)
C
D)
Python

Correct Answer :   C


Explanation : The PEAR database module is specified for the language PHP. PHP is a server side scripting language and it provides an appropriate method of embedding programs in the web pages.

A)
C
B)
C++
C)
Java
D)
Python

Correct Answer :   Java


Explanation : The JDBI interface is available for the programming language Java. Java is one of the most widely popular languages in the world. It is a powerful object oriented programming language.

A)
C
B)
Perl
C)
PHP
D)
Python

Correct Answer :   C


Explanation : C is a general purpose language, so in principle it can be used for anything. C tends to be used more often for standalone programs rather than for Web programming in practice.

A)
R
B)
C
C)
PHP
D)
Python

Correct Answer :   C


Explanation : It is not as easy to perform text processing and memory management in C than it is in languages like Perl and PHP. These capabilities tend to be heavily used in the web applications.

A)
C++
B)
Perl
C)
Java
D)
Python

Correct Answer :   Perl


Explanation : Like C, Perl is also suitable for writing standalone programs. However, Perl is quite useful for Web site development. The CGI.pm module of Perl can be extensively used for it.

A)
computer gateway interface
B)
computer graphics interface
C)
common graphics interface
D)
common gateway interface

Correct Answer :   common gateway interface


Explanation : The web server ‘Apache’ uses the interpreters as some CGI programs. This means that it communicates with these programs using the popular ‘Common Gateway Interface (CGI)’ protocol.

A)
Perl, C, PHP
B)
PHP, Perl, C
C)
Perl, PHP, C
D)
C, PHP, Perl

Correct Answer :   Perl, PHP, C


Explanation : Perl has the most highly developed capabilities in terms of text manipulation, and PHP follows it in the order. C is very rudimentary by comparison. It has the least simplicity.

A)
C API
B)
Perl
C)
PHP
D)
Python

Correct Answer :   C API


Explanation : The C Application Programming Interface provides the lowest level interface to the server. It enforces the least policy. Therefore it provides the least amount of safety net.

A)
mysql_query_real()
B)
mysql_image_query()
C)
mysql_real_query()
D)
mysql_query_image()

Correct Answer :   mysql_real_query()


Explanation : The general statement-issuing routine is mysql_real_query(). The statement is provided as a counted string (a string plus a length). The length of the statement string must be kept track of.

136 .
Which of these is more restrictive?
 
mysql_query(), mysql_real_query()
A)
same
B)
mysql_query()
C)
mysql_real_query()
D)
machine dependent

Correct Answer :   mysql_query()


Explaination : The statement-issuing function other than ‘mysql_real_query()’ is ‘mysql_query()’. It is more restrictive in what it allows in the statement string although it is often easier to use.

A)
0
B)
1
C)
-1
D)
a non-zero

Correct Answer :   a non-zero


Explanation : Both of the functions named ‘mysql_query()’ and ‘mysql_real_query()’ return zero for statements that succeed. They return non zero for failure. A statement is successfully executed if the server accepts it.

A)
float
B)
pointer
C)
integer
D)
structure

Correct Answer :   pointer


Explanation : ‘mysql_fetch_row()’ returns a MYSQL_ROW value, a pointer to an array of values. If the return value is assigned to a variable named row each value within the row is accessed as row[i].

139 .
Which of these has a lower memory requirements?
 
mysql_use_result(), mysql_store_result()
A)
same
B)
mysql_store_result()
C)
mysql_use_result()
D)
machine dependent

Correct Answer :   mysql_use_result()


Explaination : The function ‘mysql_use_result()’ has lower memory requirements than ‘mysql_store_result()’ because only enough space to handle a single row at a time needs to be allocated. This can be faster.

140 .
How many of the following is considered as a special character by ‘mysql_real_escape_string()’?
 
null byte, single quote, backslash
A)
B)
1
C)
2
D)
3

Correct Answer :   3


Explaination : The characters that ‘mysql_real_escape_string()’ considers special are the null byte, single quote, double quote, ‘backslash’, ‘newline’, ‘carriage return’ and the ‘Control-Z’.

A)
methods
B)
functions
C)
programs
D)
procedures

Correct Answer :   methods


Explanation : In the DBI API, functions are called and pointers to structures are used. The functions are called ‘methods’, pointers are called ‘references’, pointer variables are called ‘handles’.

A)
$h
B)
$fh
C)
$sth
D)
$dbh

Correct Answer :   $fh


Explanation : The variable named ‘$fh’ is a handle to an open file. ‘$h’ is a generic handle and the meaning depends on context. ‘$dbh’ is a handle to a database object. ‘$sth’ is a handle to a query object.

A)
$rv
B)
$ary
C)
$rc
D)
$rows

Correct Answer :   $rc


Explanation : The Perl Non-handle variable ‘$rc’ returns code from operations that return true or false. ‘$rv’ returns value from operations that return an integer. ‘$rows’ returns value from operations that return a row count.

A)
FLUSH INDEX
B)
REMOVE INDEX
C)
DROP INDEX
D)
DELETE INDEX

Correct Answer :   DROP INDEX


Explanation : MySQL provides statements to change the structure of tables. To add or remove the indexes on the existing database tables, the ‘CREATE INDEX’ and ‘DROP INDEX’ tables are used.

A)
subquerying
B)
binding
C)
nesting
D)
encapsulating

Correct Answer :   subquerying


Explanation : The ‘subquerying’ support provided by MySQL is a capability that allows writing one ‘SELECT’ statement within parentheses and nesting within another. This allows logically selecting content from tables.

A)
cross
B)
foreign
C)
primary
D)
secondary

Correct Answer :   foreign


Explanation : In MySQL, a foreign key is the one that facilitates index relations across tables. It declares that an index in one table is related to that in another and place constraints.

A)
$a.0
B)
$a.1
C)
$a[0]
D)
$a[1]

Correct Answer :   $a[0]


Explanation : If $a represents an array with numeric indices, its elements are accessed as $x[0], $x[1], and so on. In general terms, each element at the position i is accessed and used as $a[i – 1].

A)
.
B)
*
C)
@
D)
->

Correct Answer :   ->


Explanation : If $a represents an object, the properties it has can be accessed as $a->property-name. For instance, $a->white, $a->black, $a->blue, $a->red can be the properties of $a and accessed in this way.

A)
cgi-bin
B)
cgi-inc
C)
cgi-usr
D)
cgi-perl

Correct Answer :   cgi-bin


Explanation : DBI scripts are located in a cgi-bin directory located outside of document tree. The PHP scripts are different from DBI scripts since PHP scripts are located within the web server document tree.

A)
Trigger
B)
Event
C)
Stored function
D)
Stored procedure

Correct Answer :   Event


Explanation : The MySQL version 5.1.6 and above has an event scheduler. It enables to perform time activated database operations. An event is a stored program that is associated with a schedule.

A)
event_scheduler = ON
B)
eventscheduler = ON
C)
event_scheduler_ON
D)
events_scheduler_ON

Correct Answer :   event_scheduler = ON


Explanation : The line ‘event_scheduler = ON’ is put in the option file that the server reads. The event scheduler does not run by default. It must be turned on if events are to used in the database.

A)
Table
B)
Event
C)
View
D)
Trigger

Correct Answer :   View


Explanation : When a stored program is created, an object is created that is to be executed later. This also the case when a view is defined: It sets up a SELECT statement intended for later invocation.

A)
bad
B)
good
C)
fare
D)
illegal

Correct Answer :   good


Explanation : The security context is good if it enables carefully written stored programs to be set up that provide controlled access to tables for users who are not able to access them directly.

A)
mysqlc
B)
mysqlb
C)
mysqla
D)
mysqld

Correct Answer :   mysqld


Explanation : The server, mysqld, is the hub of a MySQL installation; it performs all manipulation of databases and tables. On Unix, several related scripts are available to assist in server startup.

155 .
How many of these are for use with only MyISAM tables?
 
mysql, mysqladmin, mysqldump, mysqlisamchk
A)
1
B)
2
C)
3
D)
4

Correct Answer :   1


Explaination : ‘mysqlcheck’ and ‘mysqlisamchk’ are the programs that perform table checking, analysis, optimization and repairs when tables become damaged. ‘mysqlcheck’ works with MyISAM tables.

A)
mysql
B)
mysqlcheck
C)
mysqlisamchk
D)
mysqlhotcopy

Correct Answer :   mysqlhotcopy


Explanation : ‘mysqldump’ and ‘mysqlhotcopy’ are the tools or programs that are used for performing the backing up of the databases and copying databases from one server to the other server(s).

A)
EXPLAIN
B)
TELL
C)
SHOW
D)
DISPLAY

Correct Answer :   EXPLAIN


Explanation : In MySQL, by issuing an EXPLAIN statement MySQL displays some information about how it would execute a SELECT query without actually executing it. It is prefixed with the query.

A)
ANALYZE KEYS
B)
PERFORM ANALYSIS
C)
ANALYZE TABLE
D)
PERFORM TABLE ANALYSIS

Correct Answer :   ANALYZE TABLE


Explanation : In MySQL, for the MyISAM and InnoDB tables, the server can be told to perform an analysis of key values by issuing the ANALYZE TABLE statement. It helps in knowing about query optimization.

A)
INET_STOI()
B)
INET_NTOA()
C)
INET_ITOS()
D)
INET_ATON()

Correct Answer :   INET_NTOA()


Explanation : In MySQL, the function used to convert an integer to a string is INET_NTOA(). On the other hand, the function INET_ATON() converts a string to the corresponding integer value.

A)
INET_STOI()
B)
INET_ITOS()
C)
INET_NTOA()
D)
INET_ATON()

Correct Answer :   INET_ATON()


Explanation : In MySQL, the function used to convert a string to an integer is INET_ATON(). On the other hand, the function INET_NTOA() converts a string to the corresponding integer value.

161 .
Which of the following is more efficient?
 
LOAD DATA, INSERT
A)
INSERT
B)
LOAD DATA
C)
Indeterminate
D)
None of the Above

Correct Answer :   LOAD DATA


Explaination : In MySQL, the ‘LOAD DATA’ in all forms is more efficient than the ‘INSERT’ because it loads rows in bulk. The server first parses then interprets only one statement instead of many.

A)
more efficient
B)
arbitrary
C)
same speed
D)
less efficient

Correct Answer :   more efficient


Explanation : LOAD DATA is more efficient without LOCAL. Without LOCAL, the file must be located on the server. The FILE privilege must be given. The server can read the file directly from disk.

A)
error log
B)
binary log
C)
relay log
D)
general query log

Correct Answer :   relay log


Explanation : The Relay Log has the data changes received from a replication master server written in it. The problems encountered during the starting, running or stopping of ‘mysqld’ are written in error log.

A)
ddl log
B)
error log
C)
relay log
D)
binary log

Correct Answer :   ddl log


Explanation : The DDL log is also known as the metadata log. The metadata operations performed by the DDL statements. The Relay Log has the data changes received from a replication master server written in it.

A)
1 GB
B)
2 GB
C)
4 GB
D)
8 GB

Correct Answer :   4 GB


Explanation : The max_binlog_cache_size system variable can be used to restrict the total size used to cache a multiple-statement transaction. If transaction is larger than this it fails and rolls back.

166 .
The default scheduling property of MySQL is implemented by how many of these?
 
MyISAM, MERGE, MEMORY
A)
B)
1
C)
2
D)
3

Correct Answer :   3


Explaination : The MyISAM, MERGE and the MEMORY storage engines implement the default scheduling policy of MySQL with the help of the table locks. Whenever a client accesses a table a lock for it must be acquired first.

167 .
Which of these is faster when accessing data?
 
memory, disk
A)
disk
B)
memory
C)
same speed
D)
machine dependent

Correct Answer :   memory


Explaination : In MySQL, the administrators have more privileges since they have more control of the MySQL server or the machine on which it runs. Accessing data in memory is faster than from disk.

A)
cache_table
B)
table_cache
C)
open_cache
D)
cache_open

Correct Answer :   table_cache


Explanation : In MySQL, when the server opens table files it keeps them open to minimize the number of file-opening operations. It maintains information about open files in the table cache.

A)
mysqlimport
B)
mysqldump
C)
mysqladmin
D)
mysqlexport

Correct Answer :   mysqldump


Explanation : In MySQL, some distributions include a set of some client programs. ‘mysqldump’ exports the table definitions and the contents. ‘mysqladmin’ performs adminisitrative tasks.

A)
Automatic Control Lists
B)
Access Control Language
C)
Automatic Control Language
D)
Access Control Lists

Correct Answer :   Access Control Lists


Explanation : MySQL uses security based on Access Control Lists (ACLs) for all connections, queries and other operations that users can attempt to perform. There is support for SSL encrypted connections.

A)
Tables
B)
Views
C)
Stored routines
D)
Server administration

Correct Answer :   Server administration


Explanation : The column name associated with the privilege ‘CREATE TABLESPACE’ is ‘Create_tablespace_priv’. The context in which this privilege is being used is the server administration.

A)
C
B)
PHP
C)
Perl
D)
Python

Correct Answer :   C


Explanation : It is not as easy to perform text processing and memory management in C than it is in languages like Perl and PHP. These capabilities tend to be heavily used in web applications.

A)
-ln
B)
-lm
C)
-lp
D)
-lq

Correct Answer :   -lm


Explanation : To compile a program written in the C language, it is compiled by issuing the option ‘-lm’. The examples of some math functions found in ‘math.h’ are floor(), sqrt(), pow(), log().

A)
-a
B)
-b
C)
-o
D)
-e

Correct Answer :   -o


Explanation : When a C program is compiled with gcc, the option -o is issued in order to specify the name of the executable that is created after compilation. The default name given is ‘a.out’.

A)
–data
B)
–datadir
C)
–data-dir
D)
–data_dir

Correct Answer :   –datadir


Explanation : At the server startup the data directory location is specified by using a ‘–datadir=dir_name’ option. It is helpful for naming a location other than the compiled in default.

A)
SHOW VARIABLE
B)
DISP VARIABLES
C)
CONNECT VARIABLES
D)
SHOW VARIABLES

Correct Answer :   SHOW VARIABLES


Explanation : The data directory location is checked by the ‘datadir’ variable. It can be obtained using a ‘SHOW VARIABLES’ statement or a ‘mysqladmin’ variables command, like: SHOW VARIABLES LIKE ‘datadir’.

A)
sys
B)
mysql
C)
nbdinfo
D)
performance_schema

Correct Answer :   performance_schema


Explanation : The ‘performance_schema’ directory corresponds to the Performance Schema. It provides information used to inspect the internal execution of the server at runtime. The ‘sys’ directory maps to ‘nbdinfo’.

A)
exec_stmt_ssl
B)
exec_ssl_stmt
C)
exec_stmnt_ssl
D)
exec_ssl_stmnt

Correct Answer :   exec_stmt_ssl


Explanation : For the ‘exec_stmt_ssl’ to work properly, MySQL must have been built with SSL support, and the server must be started with the proper options that identify its certificate and key files.

A)
C++
B)
C
C)
Perl
D)
Python

Correct Answer :   C


Explanation : In MySQL, the ‘sampdb’ distribution contains a source file named ‘exec_stmt_ssl.c’ from which the client program ‘exec_stmt_ssl’ can be built. There is a procedure to build this file.

A)
–with-server-embedded
B)
–with-embedded-library
C)
–with-embedded-server
D)
–with-library-embedded

Correct Answer :   –with-embedded-server


Explanation : While building from the source, the embedded server library is enabled by using the option ‘–with-embedded-server’ while running ‘configure’. This applies equally to MySQL 5.0 and 5.1.

A)
libmysqla
B)
libmysqlc
C)
libmysqld
D)
libmysqlb

Correct Answer :   libmysqld


Explanation : MySQL includes an embedded server library, libmysqld, containing the MySQL server in a way that can be linked into applications. This enables the production of MySQL-based standalone applications.

A)
0
B)
1
C)
2
D)
3

Correct Answer :   1


Explanation : Each view and trigger object is associated with one file in the database directory of the database containing that object. A view consists of a .frm file that contains the view definition.

A)
8
B)
16
C)
32
D)
64

Correct Answer :   64


Explanation : MySQL allows the database names and the table names to be a maximum of 64 characters long. The length of these names is also bound by the length allowed by the operating system on the machine.

A)
sys
B)
mysql
C)
nbdinfo
D)
performance_schema

Correct Answer :   performance_schema


Explanation : The sys directory corresponds to the sys schema. It provides a set of objects to interpret Performance Schema information. The ‘performance_schema’ directory corresponds to the Performance Schema.

185 .
Which of these is preferred when stored procedures are not being used?
 
CLIENT_MULTI_STATEMENTS, mysql_set_server_option()
A)
mysql_set_server_option()
B)
CLIENT_MULTI_STATEMENTS
C)
any of the two
D)
Neither of the two

Correct Answer :   any of the two


Explaination : If the program does not use stored procedures anyone is suitable. If the program uses stored procedures and invokes a ‘CALL’ statement that returns a result set, the first method is better.

A)
–force
B)
–run
C)
–violent
D)
–ensure

Correct Answer :   –force


Explanation : If SQL queries in a file are run using mysql in batch mode, mysql either quits after the first error. If the –force option is specified all the queries are executed indiscriminately.

A)
CSET
B)
CHSET
C)
CHARSET
D)
CHCSET

Correct Answer :   CHARSET


Explanation : ‘CHARACTER SET’ can be abbreviated into ‘CHARSET’ and can be used in the same contexts and statements where ‘CHARACTER SET’ is used. ‘charset’ is the server-supported character set.

A)
DROP
B)
USE
C)
SCHEMA
D)
CREATE

Correct Answer :   USE


Explanation : MySQL has the facility to use various statements specifically at the database level. For selecting a default database, the keyword or clause used is the ‘USE’ statement.

A)
root
B)
leaf
C)
super
D)
prime

Correct Answer :   root


Explanation : The root accounts are superuser accounts intended for administrative purposes. The root accounts have the privileges and to delete all the databases and shutting down the server.

A)
mysql_init_db
B)
mysql_install_db
C)
mysql_init_dbm
D)
mysql_install_dbm

Correct Answer :   mysql_install_db


Explanation : The data directory is initialized during the installation by ‘mysql_install_db’. If MySQL is installed on Linux from RPM packages then ‘mysql_install_db’ is run automatically.

A)
root
B)
prime
C)
super
D)
blank

Correct Answer :   blank


Explanation : Anonymous accounts have user name left blank. The main benefit of removing the anonymous user accounts is it significantly simplifies the task of setting up non-anonymous accounts.

A)
SQL server
B)
Server SQL mode
C)
Operating system of machine
D)
Does not depend on anything

Correct Answer :   Operating system of machine


Explanation : The default case sensitivity imposes a dependency on the operating system of the machine on which the MySQL server is running. Windows does not treat database and table names as case sensitive unlike Unix.

A)
Trigger name
B)
Event name
C)
Stored function name
D)
Stored procedure name

Correct Answer :   Trigger name


Explanation : The stored functions and stored procedure names in MySQL are not case sensitive. Event names are also not case sensitive. Unlike the standard SQL, the trigger names in MySQL is case sensitive.

A)
lower_case_all
B)
lower_case_alias
C)
lower_case_aliases
D)
lower_case_table_names

Correct Answer :   lower_case_table_names


Explanation : In MySQL, by default the alias names are case sensitive. An alias can hence be specified in any letter case, upper, lower or mixed. If the variable ‘lower_case_table_names’ is non zero, the alias names of tables are not case sensitive.

A)
SORT
B)
COLLATE
C)
FILTER
D)
GROUP

Correct Answer :   COLLATE


Explanation : The ‘COLLATE’ operator can be used to sort the string values according to a specific collation. For example, ‘SELECT col FROM tbl ORDER BY col COLLATE latin1_swedish_ci’ sorts by Swedish collation.

A)
SHOW COLLATION
B)
SHOW COLLATIONS
C)
SHOW CHARACTER SETS
D)
SHOW CHARACTER SET

Correct Answer :   SHOW CHARACTER SET


Explanation : It is simple to determine the character sets and collations that are available in MySQL. ‘SHOW CHARACTER SET’ shows the character sets while ‘SHOW COLLATION’ shows the collations.

197 .
The collations this statement lists are _____
SHOW COLLATION LIKE 'utf8%'
A)
names ending with utf8
B)
names ending in utf8%
C)
names beginning with utf8
D)
names containing utf8% anywhere

Correct Answer :   names beginning with utf8


Explaination : The character set ‘utf8’ is used for the Unicode character set 8. The ‘LIKE’ keyword does the job of narrowing the search space to refer to only those names that begin with ‘utf8’.

A)
db
B)
user
C)
procs_priv
D)
tables_priv

Correct Answer :   user


Explanation : The grant table ‘user’ stores the users who can connect to the server and their global privileges. ‘db’ has the database privileges records. ‘tables_priv’ has table privileges.

A)
db
B)
user
C)
procs_priv
D)
tables_priv

Correct Answer :   procs_priv


Explanation : ‘procs_priv’ stores stored-routine privileges. The grant table ‘user’ stores the users who can connect to the server and their global privileges. ‘db’ has the database privileges records.

A)
GRANT
B)
GET
C)
NEED
D)
OBTAIN

Correct Answer :   GRANT


Explanation : If the named account exists, ‘GRANT’ modifies its privileges. If the account does not exist, ‘GRANT’ creates it with the given privileges. It is used to obtain access privileges.

A)
IN and NOT IN
B)
EXISTS and NOT EXISTS
C)
LEFT JOIN and RIGHT JOIN
D)
OUTER JOIN and INNER JOIN

Correct Answer :   IN and NOT IN


Explanation : When there is a need to evaluate multiple rows in comparison to the outer query, the ‘IN’ and ‘NOT IN’ operators are used. They are used for testing whether a comparison value is present in a set of values.

A)
STRICT
B)
ALL
C)
DISTINCT
D)
NARROW

Correct Answer :   ALL


Explanation : The keyword ‘ALL’ used along with ‘UNION’ is not synonymous with just the ‘UNION’ statement. It produces the duplicate rows, if they exist, from the combination of the two tables in the SELECT query.

A)
ALL
B)
STRICT
C)
NARROW
D)
DISTINCT

Correct Answer :   DISTINCT


Explanation : The keyword ‘DISTINCT’ used along with ‘UNION’ is synonymous with just the ‘UNION’ statement. It produces only the distinct rows from the combination of the two tables in the SELECT query.

A)
system
B)
inplace
C)
logical
D)
illogical

Correct Answer :   logical


Explanation : The in-place upgrade involves shutting down the old MySQL version, replacing the old MySQL binaries or packages with the new ones, restarting MySQL on the existing data directory, and running mysql_upgrade.

A)
logical
B)
system
C)
inplace
D)
illogical

Correct Answer :   inplace


Explanation : The logical upgrade involves exporting existing data from the old MySQL version using mysqldump, installing the new MySQL version, loading the dump file into the new MySQL version.

A)
SHOW WARNINGS
B)
DISP WARNING
C)
DISP WARNINGS
D)
DISPLAY WARNINGS

Correct Answer :   SHOW WARNINGS


Explanation : In MySQL, the default value conversions are reported as warnings for INSERT, REPLACE and UPDATE statements. The SHOW WARNINGS command is used after executing one of those statements to see the warning messages.

A)
STRICT_ALL_TABLES
B)
ERROR_FOR_DIVISION_BY_ZERO
C)
ERROR_DIVIDE_BY_ZERO
D)
ERROR_WHEN_DIVIDE_BY_ZERO

Correct Answer :   ERROR_FOR_DIVISION_BY_ZERO


Explanation : To enable the check for divide by zero errors int all the storage engines, the SQL mode named ‘ERROR_FOR_DIVISION_BY_ZERO’ can be enabled. This is done by using SET sql_mode = ‘mode_name’.

A)
PI()
B)
db.PI()
C)
MySQL.PI()
D)
sampdb.PI()

Correct Answer :   PI()


Explanation : When a stored function is defined with the same name as a built in function, the function name should be qualified with the database name when it is invoked. The function ‘PI()’ is built in.

A)
CREATE METHOD
B)
CREATE FUNCTION
C)
CREATE PROCEDURE
D)
CREATE ROUTINE

Correct Answer :   CREATE ROUTINE


Explanation : The ‘CREATE ROUTINE’ privilege must be given for the database in order to create a stored function or procedure. Stored functions and procedures always belong to a particular database.

A)
0
B)
1
C)
2
D)
3

Correct Answer :   3


Explanation : With a MySQL installation that includes SSL support the server and its clients can communicate securely. Each end of a connection uses three files to set up secure communications.

A)
transport level security
B)
transparent level security
C)
transport layer security
D)
transparent layer security

Correct Answer :   transport layer security


Explanation : MySQL supports encrypted connections between clients and the server using the TLS protocol. It is also referred to as SSL but MySQL does not actually use the SSL protocol for encrypted connections.

A)
Db
B)
Host
C)
User
D)
Password

Correct Answer :   Host


Explanation : ‘Db’ and ‘Table_name’ values are always treated as case sensitive even though treatment of database and table names in SQL statements depends on the filesystem case sensitivity of the host.

A)
have_ssl
B)
has_ssl
C)
avail_ssl
D)
ssl_avail

Correct Answer :   have_ssl


Explanation : After the SSL-capable server is started, to verify that it supports SSL, connection is established with ‘mysql’ and the following query is issued: SHOW VARIABLES LIKE ‘have_ssl’.

A)
TINYINT
B)
BIGINT
C)
SMALLINT
D)
MEDIUMINT

Correct Answer :   BIGINT


Explanation : The different numeric types used in MySQL are used to store a different range of values. To store values of the order of a million, the MEDIUMINT or BIGINT datatype is sufficient.

A)
bad
B)
fare
C)
good
D)
illegal

Correct Answer :   bad


Explanation : The security context is bad if a user creates a stored program that accesses sensitive data but forgets that other people who can invoke the object have the same access to that data as its definer.

A)
TINYTEXT
B)
VARCHAR
C)
CHAR
D)
TEXT

Correct Answer :   TEXT


Explanation : In MySQL, the different string datatypes are used to store different lenghts of the string. Here, the length would refer to the number of characters in the string. TEXT stores longer strings.

A)
SHOW STATUS
B)
SHOW LOCAL STATUS
C)
SHOW GLOBAL STATUS
D)
SHOW SESSION STATUS

Correct Answer :   SHOW GLOBAL STATUS


Explanation : The MySQL server maintains various status variables that provide information about its operations. These variables and their values can be viewed by using the SHOW [GLOBAL | SESSION] STATUS statement.

A)
LOCAL
B)
GLOBAL
C)
SESSION
D)
DEFAULT

Correct Answer :   SESSION


Explanation : The optional ‘GLOBAL’ keyword in the statement SHOW [GLOBAL | SESSION] STATUS statement aggregates the values over all connections and ‘SESSION’ shows the values for the current connection.

A)
insert_id
B)
identity
C)
sql_big_selects
D)
sql_auto_is_null

Correct Answer :   identity


Explanation : The session only system variable ‘identity’ is a synonym for the ‘last_insert_id’ session variable. Setting ‘last_insert_id’ specifies the value to be returned by the function ‘LAST_INSERT_ID()’.

A)
integer
B)
float
C)
string
D)
double

Correct Answer :   integer


Explanation : The system variable ‘Audit_log_events’ is of type integer. The variable scope if GLOBAL, that is, it can be viewed by issuing the statement ‘SHOW GLOBAL STATUS’, instead of ‘SESSION’.

221 .
How many of the following do not return rows? 
SELECT, SHOW, DESCRIBE​
A)
B)
1
C)
2
D)
3

Correct Answer :   0


Explaination : In MySQL, it is important to note that ‘SELECT’ is not the only statement that returns some rows. Statements like ‘SHOW’, ‘DESCRIBE’, ‘EXPLAIN’ and ‘CHECK TABLE’ do so as well.

A)
float
B)
integer
C)
structure
D)
pointer

Correct Answer :   pointer


Explanation : ‘mysql_fetch_row()’ returns a MYSQL_ROW value, a pointer to an array of values. If the return value is assigned to a variable named row each value within the row is accessed as row[i].

A)
big_tables
B)
basedir
C)
back_log
D)
bind_address

Correct Answer :   big_tables


Explanation : The variable ‘big_tables’ if set to 1, all temporary tables are stored on disk rather than in memory. This is a little slower but the error ‘The table tbl_name is full’ does not occur for SELECT operations that require a large temporary table.

A)
float
B)
integer
C)
string
D)
double

Correct Answer :   string


Explanation : ‘character_set_client’ is the character set for statements that arrive from the client. The session value of this variable is set using the character set requested by the client when client connects to server.

A)
INSERT()
B)
INSTR()
C)
INFSTR()
D)
INSTRING()

Correct Answer :   INSTR()


Explanation : The string funtion ‘INSTR()’ is used to return the index of the first occurrence of the substring. The function ‘INSERT()’ is used to insert a substring at the specified position up to the specified number of characters.

A)
CGI.pn
B)
CGI.pm
C)
CGI.po
D)
CGI.pem

Correct Answer :   CGI.pm


Explanation : The CGI.pm module is used to write scripts that use the ‘Common Gateway Interface’ protocol. It defines how a web server communicates with other programs. It provides an easy link.

A)
Computer Gateway Interface
B)
Computer Generated Interface
C)
Common Generated Interface
D)
Common Gateway Interface

Correct Answer :   Common Gateway Interface


Explanation : The ‘CGI.pm’ module is so called because it helps write scripts that use the ‘Common Gateway Interface’ protocol which defines how a web server communicates with other programs.

A)
use CGI
B)
put CGI
C)
include CGI
D)
use this CGI

Correct Answer :   use CGI


Explanation : In order to write a Perl script that uses the ‘CGI.pm’ module, a ‘use CGI’ statement is included near the beginning of the script that imports the function names of the module.

A)
#!
B)
!#
C)
#$
D)
$#

Correct Answer :   #!


Explanation : The Perl scripts are text files, which can be ceated using any text editor. All Perl scripts generally begin with a #! (shebang) line. A script is a file containing a sequence of commands.