MCQs > IT & Programming > MySQL MCQs > Basic MySQL MCQs

Basic MySQL MCQ

1. By default, all print jobs have a priority of ____.

Answer

Correct Answer: 50

Note: This Question is unanswered, help us to find answer for this one

2. The like conditional operator is used by the _____ operand1.

Answer

Correct Answer: V_CONTACT

Note: This Question is unanswered, help us to find answer for this one

3. Which choice is an example of an aggregate function?Which choice is an example of an aggregate function?

Answer

Correct Answer: COUNT()

Note: This Question is unanswered, help us to find answer for this one

4. The mysqldump command cannot generate output in _.

Answer

Correct Answer: JSON

Note: This Question is unanswered, help us to find answer for this one

5. What is the correct usage of ENUM in MySQL?

Answer

Correct Answer: Create table size (name ENUM('Small','Medium','Large'));

Note: This Question is unanswered, help us to find answer for this one

6. What function finds the current time or date in MySQL?

Answer

Correct Answer: CURDATE()

Note: This Question is unanswered, help us to find answer for this one

7. Inside a transaction, several operations need to be performed. What would you do if an exception happens during that transaction?

Answer

Correct Answer: ROLLBACK

Note: This Question is unanswered, help us to find answer for this one

8. How are permissions implemented in MySQL?

Answer

Correct Answer: Access control lists

Note: This Question is unanswered, help us to find answer for this one

9. What is the valid way to create a database view in MySQL?

Answer

Correct Answer: CREATE VIEW v1 AS SELECT * FROM t1;

Note: This Question is unanswered, help us to find answer for this one

10. The left and right joins are also known as _.

Answer

Correct Answer: Outer Join

Note: This Question is unanswered, help us to find answer for this one

11. Which option modifier tells a program not to exit with an error if it does not recognize the option, but instead to issue a warning?

Answer

Correct Answer: --loose

Note: This Question is unanswered, help us to find answer for this one

12. Why would you use a common table expression (CTE)?

Answer

Correct Answer: To break down complex queries and allow reuse within a query.

Note: This Question is unanswered, help us to find answer for this one

13. A stored routine is a set of SQL statements stored on the server and takes form as either a procedure or a function. Which statement cannot be used inside stored routines?

Answer

Correct Answer: USE

Note: This Question is unanswered, help us to find answer for this one

14. Which choice is not an available string type for a column?

Answer

Correct Answer: BIT

Note: This Question is unanswered, help us to find answer for this one

15. How would you retrieve data on all the customers where no phone number is stored?

Answer

Correct Answer: SELECT * FROM customers WHERE PhoneNumber IS NULL;

Note: This Question is unanswered, help us to find answer for this one

16. Explain the security aspect of stored procedures

Answer

Correct Answer: Stored procedures are secure, because applications can be given access to stored procedures and not any underlying variables

Note: This Question is unanswered, help us to find answer for this one

17. What is the equivalent of the mysqladmin reload command?

Answer

Correct Answer: Mysqladmin flush-privileges

Note: This Question is unanswered, help us to find answer for this one

18. Which command will return a list of triggers in the current database?

Answer

Correct Answer: SHOW TRIGGERS;

Note: This Question is unanswered, help us to find answer for this one

19. What is the maximum number of columns that can be used by a single table index?

Answer

Correct Answer: 16

Note: This Question is unanswered, help us to find answer for this one

20. Which is a valid constructor for a class named User?

Answer

Correct Answer: Public User() {}

Note: This Question is unanswered, help us to find answer for this one

21. What is the advantage of using a temporary table instead of a heap table?

Answer

Correct Answer: The temporary table will be dropped as soon as your session disconnects.

Note: This Question is unanswered, help us to find answer for this one

22. Which choice is not a valid model for a stored procedure parameter?

Answer

Correct Answer: IN OUT

Note: This Question is unanswered, help us to find answer for this one

23. What is the product of the database designing phase?

Answer

Correct Answer: A list of entities, their relationship, constraints, data types, and cardinalities

Note: This Question is unanswered, help us to find answer for this one

24. Which query lists the databases on the current server?

Answer

Correct Answer: SHOW DATABASES;

Note: This Question is unanswered, help us to find answer for this one

25. If you want to use MyISAM instead of InnoDB, which option do you need to specify in the CREATE TABLE statement?

Answer

Correct Answer: ENGINE

Note: This Question is unanswered, help us to find answer for this one

26. You are importing data as JSON into a new table. You run CREATE TABLE json_data ( city JSON ); and insert rows into this table. What is the correct syntax to see the list of cities?

Answer

Correct Answer: SELECT city->>'$.name' city FROM json_data;

Note: This Question is unanswered, help us to find answer for this one

27. You need to restore a MySQL database from a backup file. Which command-line tool do you use for the actual data import, after re-creating the database?

Answer

Correct Answer: Mysql

Note: This Question is unanswered, help us to find answer for this one

28. Which type of backup includes all the changes made to the data since the last full backup was performed?

Answer

Correct Answer: Differential

Note: This Question is unanswered, help us to find answer for this one

29. When working with MySQL cursor, what must you also declare?

Answer

Correct Answer: NOT FOUND handler

Note: This Question is unanswered, help us to find answer for this one

30. Which statement about the TRUNCATE TABLE statement is true?

Answer

Correct Answer: It always first drops, then re-creates a new table.
It does not invoke the DELETE triggers associated with the table.

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

31. You are loading data into a table. Which command can you use to make sure that all data is inserted and duplicates rows are discarded?

Answer

Correct Answer: INSERT IGNORE

Note: This Question is unanswered, help us to find answer for this one

32. What is one reason to introduce data redundancy into a normalized database design?

Answer

Correct Answer: To reduce corruption in data

Note: This Question is unanswered, help us to find answer for this one

33. In recent versions of MySQL (8.0+), what's the correct syntax to declare a CTE (Common Table Expression)?

Answer

Correct Answer: WITH cte as (SELECT id FROM users) SELECT ...

Note: This Question is unanswered, help us to find answer for this one

34. Management has requested that you build an employee database. You need to include each employee's current position and salary, as well as all prior positions and salaries with the company. You decide to use a one-to-many structure: an employee table with the main information such as name and address, and an employment table with position and salary history. You can use the employeeID field to connect them. What is employment.employeeID an example of?

Answer

Correct Answer: Foreign key;

Note: This Question is unanswered, help us to find answer for this one

35. In which table does MySQL store passwords for user accounts?

Answer

Correct Answer: Mysql.user;

Note: This Question is unanswered, help us to find answer for this one

36. Which choice is not one of the table maintenance statements?

Answer

Correct Answer: CREATE TABLE;

Note: This Question is unanswered, help us to find answer for this one

37. How would you list the full set of tables in the currently selected database?

Answer

Correct Answer: SHOW TABLES;

Note: This Question is unanswered, help us to find answer for this one

38. How can you list all columns for a given table?

Answer

Correct Answer: SHOW COLUMNS FROM table;

Note: This Question is unanswered, help us to find answer for this one

39. What is the MySQL perror command-line utility used for?

Answer

Correct Answer: To display storage error codes

Note: This Question is unanswered, help us to find answer for this one

40. Which choice is not a processing algorithm for database views?

Answer

Correct Answer: Updatable

Note: This Question is unanswered, help us to find answer for this one

41. You need to run a complex query with recursive subqueries, but without creating a stored procedure or a function. Which command or clause do you use?

Answer

Correct Answer: WITH

Note: This Question is unanswered, help us to find answer for this one

42. You manage a database with a table "customers". You created a temporary table also called "customers" with which you are working for the duration of your session. You need to recreate the temporary table with different specs. Which command do you need to run first?

Answer

Correct Answer: Drop temporary table customers;

Note: This Question is unanswered, help us to find answer for this one

43. You need to make your mysql system secure against attackers. What are you not supposed to do?

Answer

Correct Answer: Run MySQL server as the unix root user.

Note: This Question is unanswered, help us to find answer for this one

44. You need to make an exact copy of a table, with all columns and indexes. How can you get all of the information needed to accomplish this?

Answer

Correct Answer: Show create table

Note: This Question is unanswered, help us to find answer for this one

45. Which is the correct syntax of an extended insert statement?

Answer

Correct Answer: Insert into cars (make, model, year) values ('Ford', 'Mustang', 2002), ('Mercedes', 'C', 2003)

Note: This Question is unanswered, help us to find answer for this one

46. Which statement can you use to load data from a file into the table?

Answer

Correct Answer: Load data infile (correct if the file is already on the server)

Note: This Question is unanswered, help us to find answer for this one

47. Later versions of mysql support the native json data type for storing json documents. What is a drawback of json columns?

Answer

Correct Answer: Cannot be indexed directly

Note: This Question is unanswered, help us to find answer for this one

48. What table cannot have a trigger associated with it?

Answer

Correct Answer: System

Note: This Question is unanswered, help us to find answer for this one

49. What mysql statement is used to check which accounts have specific privileges?

Answer

Correct Answer: Show grants (displays the privileges and roles that are assigned to a MySQL user account or role)

Note: This Question is unanswered, help us to find answer for this one

50. Each time MySQL is upgraded, it is best to execute mysql_upgrade, which looks for incompatibilities with the upgraded MySQL server. What does this command do, upon finding a table with a possible incompatibility?

Answer

Correct Answer: It performs a table check and, if problems are found, attempts a table repair.

Note: This Question is unanswered, help us to find answer for this one

51. What is the requirement for using a subquery in the SELECT clause?

Answer

Correct Answer: The subquery must return a single value.

Note: This Question is unanswered, help us to find answer for this one

52. One form of backup, replication, enables you to maintain identical data on multiple servers, as a _ configuration.

Answer

Correct Answer: Master-slave

Note: This Question is unanswered, help us to find answer for this one

53. You need to export the data in the customers table into a CSV file, with columns headers in the first row. Which clause do you add to your MySQL command?

Answer

Correct Answer: UNION

Note: This Question is unanswered, help us to find answer for this one

54. After installing MySQL, it may be necessary to initialize the _ which may be done automatically with some MySQL installation methods.

Answer

Correct Answer: Data directory

Note: This Question is unanswered, help us to find answer for this one

55. MySQL option files provide a way to specify commonly used options so that they need not be entered on the command line each time you run a program. What is another name for the option files?

Answer

Correct Answer: Configuration files

Note: This Question is unanswered, help us to find answer for this one

56. In an efficiently designed relational database, what does every table have?

Answer

Correct Answer: Primary key

Note: This Question is unanswered, help us to find answer for this one

57. How do you select every row in a given table named "inventory"?

Answer

Correct Answer: SELECT * FROM inventory;

Note: This Question is unanswered, help us to find answer for this one

58. What is the difference between DROP and TRUNCATE?

Answer

Correct Answer: DROP deletes table completely, removing its definition as well. TRUNCATE clears the table but does not delete the definition.

Note: This Question is unanswered, help us to find answer for this one

59. How can you filter duplicate data while retrieving records from a table?

Answer

Correct Answer: DISTINCT

Note: This Question is unanswered, help us to find answer for this one

60. A trigger is a database object that is associated with a table, and that activates when a particular event occurs for the table. Which three events are these?

Answer

Correct Answer: INSERT, UPDATE, DELETE

Note: This Question is unanswered, help us to find answer for this one

61. If you need to order a table of movies by name, which query will work?

Answer

Correct Answer: SELECT * FROM movies ORDER BY name

Note: This Question is unanswered, help us to find answer for this one

62. How does MySQL differ from SQL?

Answer

Correct Answer: SQL is a standard language for retrieving and manipulating data from structured databases. MySQL is a relational database management system that is used to manage SQL databases.

Note: This Question is unanswered, help us to find answer for this one

63. In SELECT * FROM clients; what does clients represent?

Answer

Correct Answer: A table

Note: This Question is unanswered, help us to find answer for this one

64. How can you remove a record using MySQL?

Answer

Correct Answer: DELETE FROM

Note: This Question is unanswered, help us to find answer for this one

65. In MySQL, queries are always followed by what character?

Answer

Correct Answer: Semicolon

Note: This Question is unanswered, help us to find answer for this one

66. What is the best type of query for validating the format of an email address in a MySQL table?

Answer

Correct Answer: A SQL query using a regular expression

Note: This Question is unanswered, help us to find answer for this one

67. Which MySQL command modifies data records in a table?

Answer

Correct Answer: UPDATE

Note: This Question is unanswered, help us to find answer for this one

68. MySQL uses security based on _ for all connections, queries, and other operations that users can attempt to perform.

Answer

Correct Answer: Access control lists

Note: This Question is unanswered, help us to find answer for this one

69. Which MySQL command shows the structure of a table?

Answer

Correct Answer: DESCRIBE table;

Note: This Question is unanswered, help us to find answer for this one

70. MySQL programs are a set of command-line utilities that are provided with typical MySQL distributions. MySQL is designed to be a database.

Answer

Correct Answer: Client and server

Note: This Question is unanswered, help us to find answer for this one

71. MySQL server can operate in different SQL modes, depending on the value of the sql_mode system variable. Which mode changes syntax and behavior to conform more closely to standard SQL?

Answer

Correct Answer: ANSI

Note: This Question is unanswered, help us to find answer for this one

72. Which query would NOT be used to administer a MySQL server?

Answer

Correct Answer: SELECT column FROM tbl

Note: This Question is unanswered, help us to find answer for this one

73. If you were building a table schema to store student grades as a letter (A, B, C, D, or F) which column type would be the best choice?

Answer

Correct Answer: ENUM

Note: This Question is unanswered, help us to find answer for this one

74. MySQL uses environment variables in some of the programs and command-line operations. Which variable is used by the shell to find MySQL programs?

Answer

Correct Answer: PATH

Note: This Question is unanswered, help us to find answer for this one

75. Which option of most MySQL command-line programs can be used to get a description of the program's different options?

Answer

Correct Answer: --help

Note: This Question is unanswered, help us to find answer for this one

76. You must ensure the accuracy and reliability of the data in your database. You assign some constraints to limit the type of data that can go into a table. What type of constraints are you assigning?

Answer

Correct Answer: Column level

Note: This Question is unanswered, help us to find answer for this one

77. You need to export the entire database, including the database objects, in addition to the data. Which command-line tool do you use?

Answer

Correct Answer: Mysqldump

Note: This Question is unanswered, help us to find answer for this one

78. When you have a subquery inside of the main query, which query is executed first?

Answer

Correct Answer: The subquery

Note: This Question is unanswered, help us to find answer for this one

79. If there is no index, the dbms will perform a _____ scan.

Answer

Correct Answer: Full table

Note: This Question is unanswered, help us to find answer for this one

80. If an error occurs, each of the numeric functions returns a/an ____________ value.

Answer

Correct Answer: Null

Note: This Question is unanswered, help us to find answer for this one

81. Databases are stored in ______ so that they are available when needed.

Answer

Correct Answer: Data warehouses

Note: This Question is unanswered, help us to find answer for this one

82. Attributes may share a ____.

Answer

Correct Answer: Domain

Note: This Question is unanswered, help us to find answer for this one

83. A distributed database is composed of several parts known as database _____.

Answer

Correct Answer: Fragments

Note: This Question is unanswered, help us to find answer for this one

84. A centralized database management is subject to a problem such as _____.

Answer

Correct Answer: Growing numbers of remote locations

Note: This Question is unanswered, help us to find answer for this one

85. Which of the following operators have the same precedence as the <= operator?

Answer

Correct Answer: <=>, >=, >, <=, <
<=>

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

86. Which of the following data types can have an additional attribute AUTO_iNCREMENT?

Answer

Correct Answer: lNT
FLOAT

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

87. Which of the following values do logical operators evaluate to in MySQL?

Answer

Correct Answer: 0
TRUE
FALSE

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

88.

What will be the result of the following query?

SELECT ExtractValue()

Answer

Correct Answer:

AB 


Note: This Question is unanswered, help us to find answer for this one

89.

What will be the result of the following query?

SELECT STRCMP()

Answer

Correct Answer:



Note: This Question is unanswered, help us to find answer for this one

90.

What will be the result of the following query?

SELECT(This Is four lines)

Answer

Correct Answer:

 This

Is

Four

Lines  



Note: This Question is unanswered, help us to find answer for this one

91. Which of the following correctly describes the RLIKE operator?

Answer

Correct Answer: It is a synonym for the REGEXP Operator.

Note: This Question is unanswered, help us to find answer for this one

92. For the COERCIBILITYO function. what does coercibility value of 0 mean?

Answer

Correct Answer: Explicit collation

Note: This Question is unanswered, help us to find answer for this one

93.

What will be the result of the following two queries?

1. SELECT POW(2.2):

2. SELECT POWER(2.3):


Answer

Correct Answer:

Query 1 will return 4. while query 2 will return 8.


Note: This Question is unanswered, help us to find answer for this one

94. Which of the following operators are supported by boolean full-text search?

Answer

Correct Answer: +
-
()
u

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

95. Invalid year data type values are converted to which of the following?

Answer

Correct Answer: 0000

Note: This Question is unanswered, help us to find answer for this one

96. In MySQL 5.6.5. how many bytes are required to store the DATETIME data type?

Answer

Correct Answer: 0 5 bytes + fractional seconds storage

Note: This Question is unanswered, help us to find answer for this one

97.

What will be the result of the following query?

SELECT lNSERT()

Answer

Correct Answer:

EquWherer 


Note: This Question is unanswered, help us to find answer for this one

98.

Which of the following holds correct while optimizing the query?

1) Use ((a AND D) AND c OR (((a AND D) AND (c AND d)))) instead of

(a AND D AND c) on (3 AND b AND c AND d)

2)Use b>5 AND b=c AND 825 instead of (a

3}Use (8>=5 AND 8:5) OR (8:6 AND 5:5) 0R (8:7 AND 5:6) instead of B=5 OR 8=6


Answer

Correct Answer:

2 and 3


Note: This Question is unanswered, help us to find answer for this one

99. Which of the following can be done using the ALTER TABLE statement?

Answer

Correct Answer: Add or delete columns of a table.
Create or destroy indexes.
Change the type of existing columns.

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

100. Which Of the following statements are correct in the context of the lNSERT statement?

Answer

Correct Answer: All of the above.

Note: This Question is unanswered, help us to find answer for this one

101. Which of the following should be done for optimizing SELECT statements?

Answer

Correct Answer: All of the above.

Note: This Question is unanswered, help us to find answer for this one

102. Which of the following queries will return 2010-02-02 as the result?

Answer

Correct Answer: All of the above.

Note: This Question is unanswered, help us to find answer for this one

103. Which of the following queries will return ONE as the result?

Answer

Correct Answer: SELECT CASE 1 WHEN 1>O THEN 'ONE‘ WHEN 2 THEN 'TWO' ELSE 'MORE' END:
SELECT CASE 1 WHEN 1 THEN 'ONE' WHEN 2 THEN 'TWO' ELSE 'MORE' END;

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

104. Which of the following Bit functions is used to invert all bits?

Answer

Correct Answer: ~

Note: This Question is unanswered, help us to find answer for this one

105. Which of the following is an integer division operator?

Answer

Correct Answer: DIV

Note: This Question is unanswered, help us to find answer for this one

106. How many bytes are required to store the MEDIUMINT numeric data type?

Answer

Correct Answer: 3 bytes

Note: This Question is unanswered, help us to find answer for this one

107. In MySQL 5.6, if either operand has a noninteger type. the operands are converted to DECIMAL and divided using DECIMAL arithmetic before converting the result to BIGINT.

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

108. Which of the following statements are correct regarding the CREATE TABLE statement?

Answer

Correct Answer: CHAR, VARCHAR, TEXT data types can include the CHARACTER SET and COLLATE attributes.

Note: This Question is unanswered, help us to find answer for this one

109. For GRANT statement. which of the following is used to grant all permissions to a user?

Answer

Correct Answer: ON *.*

Note: This Question is unanswered, help us to find answer for this one

110. Which of the following constructs for flow control are supported by MySQL?

Answer

Correct Answer: IF
CASE
LOOP
lTERATE

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

111. Which of the following are valid MySQL DATETIME and TIMESTAMP value formats?

Answer

Correct Answer: 2012-12-3111:30:45
2012“12“3111+30+45
20070523091528

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

112. Which of the following statements regarding the TRUNCATE TABLE statement are correct in MySOL 5.6?

Answer

Correct Answer: All of the above.

Note: This Question is unanswered, help us to find answer for this one

113. Which of the following is NOT a constraint of the INSERT DELAYED statement?

Answer

Correct Answer: INSERT DELAYED is not supported for partitioned tables.

Note: This Question is unanswered, help us to find answer for this one

114. Which of the following relational comparison operators can be used to compare row operands as well as scalar operands?

Answer

Correct Answer: All of the above

Note: This Question is unanswered, help us to find answer for this one

115.

What will be the result of the following query?

SELECT "hello hel lo he 0"

Answer

Correct Answer:

hel‘lo ‘'hello   


Note: This Question is unanswered, help us to find answer for this one

116. Which Of the following can be used instead Of the ALTER DATABASE statement?

Answer

Correct Answer: ALTER SCHEMA

Note: This Question is unanswered, help us to find answer for this one

117. Spatial indexes have which of the following characteristics?

Answer

Correct Answer: All of the above.

Note: This Question is unanswered, help us to find answer for this one

118. Which of the following is correct regarding the ALTER PROCEDURE statement?

Answer

Correct Answer: This statement can be used to change the characteristics of a stored procedure.

Note: This Question is unanswered, help us to find answer for this one

119.

What will be the result of the following query?

SELECT 105/(1-1):


Answer

Correct Answer:

NULL 


Note: This Question is unanswered, help us to find answer for this one

120. Which of the following statements are INVALID?

Answer

Correct Answer: ALTER TABLE t1 ANALYZE PARTITION p1, ANALYZE PARTITION p2;
ALTER TABLE t1 ANALYZE PARTITION p1, CHECK PARTITION p2;

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

121. Which of the following are Fixed-Point data types?

Answer

Correct Answer: DEClMAL
NUMERIC

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

122. Which of the following statements is INCORRECT?

Answer

Correct Answer: For indexes on CHAR and VARCHAR, a pref‌ix length is required. 0.02

Note: This Question is unanswered, help us to find answer for this one

123. Which of the following are valid forms of the SHOW statement?

Answer

Correct Answer: All of the above

Note: This Question is unanswered, help us to find answer for this one

124.

What is the correct order in which the clauses of the DELETE statement are used?

1. DELETE

2. WHERE

3. ORDER BY

4. FROM

5. LIMIT


Answer

Correct Answer:

1, 4, 2, 3, 5 


Note: This Question is unanswered, help us to find answer for this one

125. Which of the following functions will return a set of comma-separated strings that have the corresponding bit in bits set?

Answer

Correct Answer: MAKE_SET()

Note: This Question is unanswered, help us to find answer for this one

126. Which of the following functions decodes to a base-64 string and returns result?

Answer

Correct Answer: FROM_BASE6()

Note: This Question is unanswered, help us to find answer for this one

127. Which of the following account management statements was added in MySQL 5.6?

Answer

Correct Answer: ALTER USER

Note: This Question is unanswered, help us to find answer for this one

128.

In the following example, what will be the return value in case str is not found?

FiELD(str.str1.str2.str3,...)


Answer

Correct Answer:



Note: This Question is unanswered, help us to find answer for this one

129. Which of the following queries will return NULL records from the table myTable?

Answer

Correct Answer: SELECT ‘ FROM myTable WHERE column1 IS NULL:

Note: This Question is unanswered, help us to find answer for this one

130. Which of the following are reserved words in MySQL 5.6?

Answer

Correct Answer: ACCESSIBLE
INNER
ONE_SHOT

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

131. Which of the following statements is INCORRECT regarding the date data type?

Answer

Correct Answer: MySQL never converts a date or time value to a number automatically.

Note: This Question is unanswered, help us to find answer for this one

132. Which of the following is correct regarding the CREATE DATABASE statement?

Answer

Correct Answer: All of the above.

Note: This Question is unanswered, help us to find answer for this one

133. Which of the following are valid INSERT statements?

Answer

Correct Answer: INSERT INTO tbl_hname (coll.col2) VALUES[15,col1'2};
INSERT INTO tbl_name (a.b,c) VALUESI1.2,3).(4,5.6].(7.8.9}:

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

134. Which of the following functions are synonyms of NOW()?

Answer

Correct Answer: LOCALTIMESTAMP()
CURRENT_TIMESTAMP()

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

135.

What will be the result of the following two queries?

1. SELECT 2+3

2. SELECT 2+(3'3)-5

Answer

Correct Answer:

Query 1 will return 6. while query 2 will return 6.  


Note: This Question is unanswered, help us to find answer for this one

136.

What is the correct order in which the clauses of the SELECT statement are used?

1. SELECT

2. LIMIT

3. WHERE

4. ORDER BY

5. HAVING

6. FROM


Answer

Correct Answer:

1.6.3.5.4.2


Note: This Question is unanswered, help us to find answer for this one

137. Prior to MySOL 5.6.1. what did the isSimpie(g) function always return?

Answer

Correct Answer: 0

Note: This Question is unanswered, help us to find answer for this one

138. Which of the following methods can speed up the INSERT statements?

Answer

Correct Answer: All of the above.

Note: This Question is unanswered, help us to find answer for this one

139. Which of the following optimization tips holds true?

Answer

Correct Answer: All of the above.

Note: This Question is unanswered, help us to find answer for this one

140. Which of the following forms of the SELECT statement writes a single row to a f‌ile without any formatting?

Answer

Correct Answer: SELECT INTO DUMPFILE

Note: This Question is unanswered, help us to find answer for this one

141. Which of the following is iNCORRECT regarding the DECIMAL data type?

Answer

Correct Answer: in a DECIMAL column declaration. the precision and scale cannot be specified.

Note: This Question is unanswered, help us to find answer for this one

142. Which of the following data types has been deprecated in MySQL 5.6?

Answer

Correct Answer: YEAR(2)

Note: This Question is unanswered, help us to find answer for this one

143.

What will be the result of the following query?

SELECT CONCAT('MY', 'S', 'QL')

Answer

Correct Answer:

 NULL MySQL 


Note: This Question is unanswered, help us to find answer for this one

144. Which of the following SQL statements will change the table default character set and all character columns (CHAR, VARCHAR, TEXT) to a new character set?

Answer

Correct Answer: ALTER TABLE tbl_name CONVERT TO CHARACTER SET charset_name;

Note: This Question is unanswered, help us to find answer for this one

145.

Consider the following table named TESTTABLE:

tbIName tbILname

FN LN

FN LN

What will be the result of the following query?

SELECT 1 FROM TESTTABLE WHERE tblName iN ()

Answer

Correct Answer:

1

1


Note: This Question is unanswered, help us to find answer for this one

146. Which of the following ALTER TABLE partition options have been added in MySQL 5.6?

Answer

Correct Answer: DROP PARTITION

Note: This Question is unanswered, help us to find answer for this one

147. in which of the following types can the CONVERT() function return the results?

Answer

Correct Answer: All Of the above

Note: This Question is unanswered, help us to find answer for this one

148. Which of the following functions return the smallest integer value not less than the argument specif‌ied?

Answer

Correct Answer: CEIL()
CEILING()

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

149.

What will be the output of the following query?

SELECT ELT(5,'dev', 'developer', 'develop'. 'dev')

Answer

Correct Answer:

NULL 


Note: This Question is unanswered, help us to find answer for this one

150. Which of the following is NOT a valid comment style in MySQL?

Answer

Correct Answer: Select1 /# this Is an In-iine comment #/ +2;

Note: This Question is unanswered, help us to find answer for this one

151. Which of the following functions were introduced in MySQL 5.6.3?

Answer

Correct Answer: E] lS_lPV6(expr)
Il lS_lPV4_COMPATO() 1-4

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

152. Which of the following are properties of MySQL Cursors?

Answer

Correct Answer: All of the above.

Note: This Question is unanswered, help us to find answer for this one

153. Which of the following escape sequences represents the backslash ("\") character?

Answer

Correct Answer: \\

Note: This Question is unanswered, help us to find answer for this one

154. What is the default value of locale for the FORMAT(X,D[locale])D function?

Answer

Correct Answer: en_US

Note: This Question is unanswered, help us to find answer for this one

155. What will be the output if you try to perform an arithmetic operation on a column containing NULL values?

Answer

Correct Answer: NULL

Note: This Question is unanswered, help us to find answer for this one

156. In MySOL 5.6, you can write triggers containing direct references to tables by name.

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

157.

What will be the result of the following query?

SELECT 5 <=> 5, NULL <=> NULL, 5 <=> NULL


Answer

Correct Answer:

1 1 0   


Note: This Question is unanswered, help us to find answer for this one

158.

What will be the output of the following query?

SELECT DATE_FORMAT(‘2006-06-00'. '%d')

Answer

Correct Answer:



Note: This Question is unanswered, help us to find answer for this one

159. Which of the following numeric data types has a storage value of 8 bytes?

Answer

Correct Answer: BIGINT

Note: This Question is unanswered, help us to find answer for this one

160.

Which of the following are correct about HEAP tables? Check all that apply.

Answer

Correct Answer: HEAP tables are in-memory.

Note: This Question is unanswered, help us to find answer for this one

161.

How many Triggers are possible in MySQL?

Answer

Correct Answer: 6

Note: This Question is unanswered, help us to find answer for this one

162.

What are the properties of transactions?

Answer

Correct Answer: Atomicity, Consistency, Durability, Isolation

Note: This Question is unanswered, help us to find answer for this one

163.

What is the full form of ACL?

Answer

Correct Answer: Access Control List

Note: This Question is unanswered, help us to find answer for this one

164.

Which of the following command is used to create a stored routine?

Answer

Correct Answer: CREATE PROCEDURE

Note: This Question is unanswered, help us to find answer for this one

165.

What is the correct command to check if MySql service is running or not in RedHat?

Answer

Correct Answer: service mysqld status

Note: This Question is unanswered, help us to find answer for this one

166.

What is the correct syntax to create a new user in MySQL?

Answer

Correct Answer: CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';

Note: This Question is unanswered, help us to find answer for this one

167.

What happens to privileges for a table when you delete the table in MySQL?

Answer

Correct Answer: As the table has been deleted, you cannot explicitly issue a REVOKE statement to revoke privileges for that table

Note: This Question is unanswered, help us to find answer for this one

168.

What is the correct syntax to view the global event scheduler’s status in MySQL process list?

Answer

Correct Answer: SHOW PROCESSLIST\G;

Note: This Question is unanswered, help us to find answer for this one

169.

What is the syntax to backup a database from command line?

Answer

Correct Answer: mysqldump [options] database_name > database_name.sql

Note: This Question is unanswered, help us to find answer for this one

170.

What is the correct syntax to turn on the global event scheduler?

Answer

Correct Answer: SET GLOBAL event_scheduler = ON;

Note: This Question is unanswered, help us to find answer for this one

171.

What is the correct syntax to get the MySQL Version?

Answer

Correct Answer: SELECT VERSION();

Note: This Question is unanswered, help us to find answer for this one

172.

What is the correct syntax to create a view?

Answer

Correct Answer: CREATE VIEW view_name AS SELECT column_name(s) FROM table_name WHERE condition

Note: This Question is unanswered, help us to find answer for this one

173.

What is the default port for MySQL Server?

Answer

Correct Answer: 3306

Note: This Question is unanswered, help us to find answer for this one

174.

Which of the following are valid Scalar Functions? Check all that apply.

Answer

Correct Answer: UPPER()

Note: This Question is unanswered, help us to find answer for this one

175.

How do you control the max size of a HEAP table?

Answer

Correct Answer: MySQL config variable called max_heap_table_size.

Note: This Question is unanswered, help us to find answer for this one

176.

What is the correct syntax for updating a table using LEFT OUTER JOIN? 

Answer

Correct Answer: UPDATE T1 LEFT JOIN T2 ON T2.ID = T1.ID SET T1.COL1 = NEWVALUE WHERE T2.ID IS NULL

Note: This Question is unanswered, help us to find answer for this one

177.

Which of the statements are true for user-defined variables? 

Answer

Correct Answer: User variables are written as $var_name, where the variable name var_name consists of alphanumeric characters, “.”, “_”, and “@”.

Note: This Question is unanswered, help us to find answer for this one

178.

What are the valid types of table present in MySQL? Check all that apply.

Answer

Correct Answer: MyISAM

Note: This Question is unanswered, help us to find answer for this one

179.

Which of the following are valid MySQL functions? Check all that apply.

Answer

Correct Answer: FORMAT()

Note: This Question is unanswered, help us to find answer for this one

180.

Which of the following will truncate all tables in a MySQL database?

Answer

Correct Answer: SELECT Concat('TRUNCATE TABLE ', TABLE_NAME) FROM INFORMATION_SCHEMA.TABLES

Note: This Question is unanswered, help us to find answer for this one

181.

What are the valid modes of parameters in stored routines? Check all that apply.

Answer

Correct Answer: IN

Note: This Question is unanswered, help us to find answer for this one

182.

Which SQL statement is used to return only different values?

Answer

Correct Answer: SELECT DISTINCT

Note: This Question is unanswered, help us to find answer for this one

183.

Which of the following is NOT a valid Aggregation Function?

Answer

Correct Answer: LAST()

Note: This Question is unanswered, help us to find answer for this one

184.

How do you return fifty events starting from 40th? Assume table name is events and you need to select only the column event_title.

Answer

Correct Answer: SELECT event_title FROM events LIMIT 39, 50;

Note: This Question is unanswered, help us to find answer for this one

185.

Which of the following statement is valid for % and _ in the LIKE clause in a mysql query?

Answer

Correct Answer: % corresponds to 0 or more characters; _ is exactly one character

Note: This Question is unanswered, help us to find answer for this one

186.

Which of the following is correct about CHAR_LENGTH and LENGTH?

Answer

Correct Answer: CHAR_LENGTH is character count whereas the LENGTH is byte count.

Note: This Question is unanswered, help us to find answer for this one

187.

What is the correct syntax to switch to a new database in MySQL?

Answer

Correct Answer: use database_name;

Note: This Question is unanswered, help us to find answer for this one

188.

How do you get the field names and associated type of a MySQL table?

Answer

Correct Answer: describe table_name;

Note: This Question is unanswered, help us to find answer for this one

189.

What is the syntax to list all databases in mysql?

Answer

Correct Answer: show databases;

Note: This Question is unanswered, help us to find answer for this one

190.

Which command converts Unix Timestamp to Mysql Timestamp and vice versa?

Answer

Correct Answer: FROM_UNIXTIME; UNIX_TIMESTAMP

Note: This Question is unanswered, help us to find answer for this one

191.

What is the correct syntax to grant all privileges on all databases to a user?

Answer

Correct Answer: GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';

Note: This Question is unanswered, help us to find answer for this one

192.

The correct syntax to call a stored routine country_hos with a parameter of type VARCHAR is

Answer

Correct Answer: CALL country_hos('Europe');

Note: This Question is unanswered, help us to find answer for this one

193.

What is the correct syntax to restore a database from command line?

Answer

Correct Answer: mysql -u username -p database_name<database_name.sql

Note: This Question is unanswered, help us to find answer for this one

194.

Which of the following will restore a MySQL DB from a .dump file?

Answer

Correct Answer: mysql -u<user> -p <db_backup.dump

Note: This Question is unanswered, help us to find answer for this one

195.

Which of the following is correct syntax for selecting all rows from a table 'PERSONS', with strings in the column 'LASTNAME' starting with 'JOH'?

Answer

Correct Answer: SELECT * from PERSONS where LASTNAME LIKE 'JOH%';

Note: This Question is unanswered, help us to find answer for this one

196.

Which of the following is the best way to update multiple rows? Example: Name id Col1 Col2 name1 1 6 1 name2 2 2 3 name3 3 9 5 name4 4 16 8 Update Col1= 1 where id = 1 Update Col1= 2 where id = 2 Update Col2= 3 where id = 3 Update Col1= 10 and col2= 12 where id = 4

Answer

Correct Answer: INSERT INTO table_name (id,Col1,Col2) VALUES (1,1,1),(2,2,3),(3,9,3),(4,10,12) ON DUPLICATE KEY UPDATE Col1=VALUES(Col1),Col2=VALUES(Col2);

Note: This Question is unanswered, help us to find answer for this one

197.
Which of the following will check whether a MySQL database exists or not?

 

Answer

Correct Answer: SHOW DATABASES LIKE 'DBname';

Note: This Question is unanswered, help us to find answer for this one

198.

Select examples with a valid comment syntax:

Answer

Correct Answer: SELECT 1+1 /* Comment */;

Note: This Question is unanswered, help us to find answer for this one

199.

InnoDB prevents which of the following operations when innodb_force_recovery is greater than 0?

Answer

Correct Answer: INSERT

Note: This Question is unanswered, help us to find answer for this one

200.

Which of the following are valid encryption functions?

Answer

Correct Answer: MD5

Note: This Question is unanswered, help us to find answer for this one

201.

With which of the following you can not associate a Trigger?

Answer

Correct Answer: Permanent tabe

Note: This Question is unanswered, help us to find answer for this one

202.

Consider the following Table EMP: --------------- empId empName empSalary empJoinDate Which SQL is incorrect for finding out the count of records on EMP table where empJoinDate is between 2012-10-01 and 2012-12-30?

Answer

Correct Answer: Select count(*) from EMP where empJoinDate between '2012-10-01' and 2012-12-30' group by EXTRACT(YEAR_MONTH from empJoinDate );

Note: This Question is unanswered, help us to find answer for this one

203.

Which of the following statements is correct in regards to the syntax of the code below? SELECT table1.this, table2.that, table2.somethingelse FROM table1 INNER JOIN table2 ON table1.foreignkey = table2.primarykey WHERE (some other conditions)

Answer

Correct Answer: All of the Above

Note: This Question is unanswered, help us to find answer for this one

204.

Which of the following is not a valid Bit operator?

Answer

Correct Answer: &&

Note: This Question is unanswered, help us to find answer for this one

205.

How can the following error be solved in MySQL? ERROR 1153: Got a packet bigger than 'max_allowed_packet' bytes

Answer

Correct Answer: By specifying on the command line: mysql --max_allowed_packet=100M -u root
By specifying on the command line: mysql --max_allowed_packet=100M -u root -p database < dump.sql and updating the my.cnf or my.ini files with the following lines: set global net_buffer_length=1000000; set global max_allowed_packet=1000000000;

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

206.

Is there any function in MySQL that allows for replace through a regular expression?

Answer

Correct Answer: None of the Above

Note: This Question is unanswered, help us to find answer for this one

207.

What is the most common use of the mysql EXPLAIN statement?

Answer

Correct Answer: To analyze the execution of a query.

Note: This Question is unanswered, help us to find answer for this one

208.

Which of the following is the correct way to change the character set to UTF8?

Answer

Correct Answer: Add the following lines in my.cnf: [mysqld] init_connect='SET collation_connection = utf8_unicode_ci' character-set-server = utf8 collation-server = utf8_unicode_ci [client] default-character-set = utf8

Note: This Question is unanswered, help us to find answer for this one

209.

When running the following SELECT query: SELECT ID FROM ( SELECT ID, name FROM ( SELECT * FROM employee ) ); The error message 'Every derived table must have its own alias' appears. Which of the following is the best solution for this error?

Answer

Correct Answer: SELECT ID FROM ( SELECT ID, name FROM ( SELECT * FROM employee ) AS T ) AS T;

Note: This Question is unanswered, help us to find answer for this one

210.

Which function is used to get the higher of two values, a and b, in MySQL?

Answer

Correct Answer: GREATEST(a,b)

Note: This Question is unanswered, help us to find answer for this one

211.

Suppose a table has the following records:

+--------------+-------------+----------------+

| Item | Price | Brand |

+--------------+-------------+----------------+

| Watch | 100 | abc | | Watch | 200 | xyz |

| Glasses | 300 | bcd | | Watch | 500 | def |

| Glasses | 600 | fgh |

+--------------+-------------+----------------+

Which of the following will select the highest-priced record per item?

Answer

Correct Answer: select item, brand, max(price) from items group by item

Note: This Question is unanswered, help us to find answer for this one

212.

Examine the code given below: SELECT employee_id FROM employees WHERE commission_pct=.5 OR salary > 23000 Which of the following statements is correct with regard to this code?

Answer

Correct Answer: It returns employees who have 50% commission rate or salary greater than $23,000

Note: This Question is unanswered, help us to find answer for this one

213.

Which approach can be used to find all occurrences of text ‘’owner’’ in all fields of all tables in a MySQL, database?

search
MySQL Subjects