Top 50 MySQL Multiple Choice Questions
1. The “father” of MySQL is
A. Michael Widenius
B. Bill Joy
C. Bill Gates
D. Stephanie Wall
E. Sigmund Velin
Ans: A
2: To use MySQL on your computer, you’ll need
A. Perl, PHP or Java
B. Some sort of client program to access the databases
C. A Browser
D. FTP and Telnet
Ans: B
3: MySQL comes with as standard with client libraries for:
A. C only
B. Java only
C. Java and C
D. Perl, PHP and C
E. C, C# and the .NET environment, Java and Python
Ans: A
4. What kind of replication is supported by the MySQL server?
A. Multiple-master replication
B. Master to slave replication
C. Single file based clustering
D. MySQL doesn’t support replication
Ans: B
5: Internally information is held in tables. Which of these is NOT a valid format:
A. BDB
B. Isam99
C. MyIsam
D. Hash
E. Isam
F. InnoDb
Ans: B
6: Commands passed to the MySQL daemon are written in
A. Your choice from Perl, PHP, Java or some other languages
B. English
C. the Structured Query Language
D. Swedish
Ans: C
7: MySQL supports the complete SQL99 standard
A. true
B. false
Ans: B
8: Which of these is not a valid name for a column
A. Far
B. Near
C. To
D. From
Ans: B
9: In a LIKE clause, you can could ask for any value ending in “ton” by writing
A. LIKE ton$
B. LIKE ^.*ton$
C. LIKE %ton
D. LIKE *ton
E. LIKE .*ton
Ans: C
10: Which of the following can add a row to a table?
A. Alter
B. Add
C. Insert
D. Create
E. Update
F. Commit
Ans: C
11: Which of these commands will delete a table called XXX if you have appropriate authority:
A. DROP XXX
B. DELETE XXX WHERE confirm = “YES”
C. DROP XXX WHERE confirm = “YES”
D. DROP TABLE XXX
E. DELETE XXX
F. DELETE TABLE XXX
Ans: D
12: The USE command
A. Is a pseudonym for the SELECT command
B. Has been deprecated and should be avoided for security reasons
C. Should be used to choose the database you want to use once you’ve connected to MySQL
D. Is used to load code from another file
Ans: C
13: In a LIKE clause, you can ask for any 6 letter value by writing:
A. LIKE ??????
B. LIKE .{6}
C. LIKE ^.{6}$
D. LIKE …… (that’s six dots)
E. LIKE ______ (that’s six underscore characters)
Ans: E
14: MySQL runs on which operating systems?
A. Unix and Linux only
B. Linux and Mac OS-X only
C. Unix, Linux, Windows and others
D. Any operating system at all
Ans: C
15: MySQL Access security is controlled through
A. MySQL login accounts, and priveliges set for each account
B. The ID that the user logged into the server through, and priveliges set up for that account.
C. A table of valid IP addresses, and priveliges set up for each IP address
D. The normal login security is sufficient for MySQL, and it does not have any extra controls of its own.
Ans: A
16: Which of the following is NOT supported by MySQL
A. Temporary (Hash) Tables
B. Table Joining
C. Stored Procedures
D. Regular Expression Matching
Ans: C
17: One of the early proponents of relational database who laid down many of the principles we use to this day was:
A. Xigang Koi
B. Mahatma Coate
C. Edgar Codd
D. William Crawford
E. Robert Langton
Ans: C
18: You are required to buy a license for MySQL if
A. If you use it for longer than 30 days
B. You use MySQL in a live application and not just for evaluation
C. You incorporate it into a product that you sell
D. You use it on a publicly accessible site
E. You are never required to buy a license
Ans: C
19: Which of these is a valid call to a function (watch the spaces carefully!)
A. CONCAT( A , B )
B. CONCAT ( A , B )
C. CONCAT( “A” , “B” )
D. CONCAT ( “A” , “B” )
E. CONCAT (A, B)
F. CONCAT (“A”, “B”)
Ans: C
20: If you want to undo a GRANT, you should use
A. REVOKE
B. UNDO
C. UNGRANT
D. DELETE
E. WITHDRAW
F. ROLLBACK
Ans: A
21: How many distinct, different values can you hold in an enum field?
A. 255
B. 7
C. 65535
D. 2 (True and False)
Ans: C
22: Which of the following is NOT available in MySQL:
A. REVOKE
B. FETCH
C. LIKE
D. JOIN
E. SELECT
Ans: B
23: Which of these field types would be best to hold a film title?
A. longblob
B. tinytext
C. mediumtext
D. longtext
E. tinyblob
Ans: B
24: The program called mysql is
A. There isn’t a program just called mysql
B. A wrapper through which Java clients must connect to the databases
C. A client program that lets you send SQL commands to the database engine
D. The database engine
E. A program that starts up and shuts down the database engine
Ans: C
25: In a LIKE clause, you can ask for any 6 letter value by writing:
A. LIKE ______ (that’s six underscore characters)
B. LIKE .{6}
C. LIKE ??????
D. LIKE ^.{6}$
E. LIKE …… (that’s six dots)
Ans: A
26: Which of the following is available in MySQL:
A. CREATE VIEW
B. CREATE SCHEMA
C. CREATE TRIGGER
D. CREATE DATABASE
E. CREATE FAIRYLIGHTS
Ans: D
27: Which of these field types would be best to hold a .jpg image?
A. char binary
B. nchar binary
C. text
D. blob
Ans: D
28: If you’re writing a client using the C language API, your source code should include the following line at the top:
A. use mysql;
B. include (“mysql.h”);
C. #include
D. import com.mysql.*;
Ans: C
29: A user with RELOAD priveliges can
A. Can reset passwords for any mysql user account
B. Perform certain “admin type” operations such as flush table and logs from memory to disc, but can’t normally do anything “dangerous”
C. Can repopulate the databases and tables from a backup
D. Can restart the MySQL daemon in addition to any other priveliges he might also have
Ans: B
30: What’s the difference between the DESCRIBE and SHOW FIELDS FROM commands?
A. Only SHOW FIELDS FROM can take a LIKE clause
B. Nothing – they’re the same thing
C. Only DESCRIBE can take a LIKE clause
Ans: B
31: Which of these is not a valid name for a column
A. To
B. From
C. Far
D. Near
Ans: B
32: Commands passed to the MySQL daemon are written in
A. English
B. Your choice from Perl, PHP, Java or some other languages
C. the Structured Query Language
D. Swedish
Ans: C
33: Which of the following is available in MySQL:
A. CREATE TRIGGER
B. CREATE SCHEMA
C. CREATE FAIRYLIGHTS
D. CREATE DATABASE
E. CREATE VIEW
Ans: D
34: One of the early proponents of relational database who laid down many of the principles we use to this day was:
A. Edgar Codd
B. Xigang Koi
C. Robert Langton
D. Mahatma Coate
E. William Crawford
Ans: A
35. In PHP in order to access MySQL database you will use:
A) mysqlconnect() function
B) mysql-connect() function
C) mysql_connect() function
D) sql_connect() function
ANSWER : C
36. To remove duplicate rows from the result set of a SELECT use the following keyword:
a) NO DUPLICATE
b) UNIQUE
c) DISTINCT
d) None of the above
ANSWER: c
37. In a LIKE clause, you can could ask for any value ending in “qpt” by writing
a) LIKE %qpt
b) LIKE *ton
c) LIKE ton$
d) LIKE ^.*ton$
ANSWER: a
38. Which of the following is used to delete an entire MYSQL database?
a) mysql_drop_database
b) mysql_drop_entiredb
c) mysql_drop_db
d) mysql_drop_dbase
ANSWER: c
39. Primary Key does allow the Null Values. where as in Unique key doesn’t accept the Null values.
Question:
True or False ?
a) False
b) True
ANSWER: a
40. How much character are allowed to create database name?
a) 55
b) 72
c) 64
d) 40
ANSWER: c
41. In a SELECT with a GROUP BY clause, a WHERE clause, and a HAVING clause, the WHERE conditions are applied before the HAVING conditions.
a) True
b) Fasle
c) Either True or False
d) None of the above
ANSWER: a
42. In a LIKE clause, you can could ask for any value ending in “ton” by writing?
A. LIKE ton$
B. LIKE ^.*ton$
C. LIKE %ton
D. LIKE *ton
E. LIKE .*ton
Ans: C
43. Which of these commands will delete a table called XXX if you have appropriate authority?
A. DROP XXX
B. DELETE XXX WHERE confirm = “YES”
C. DROP XXX WHERE confirm = “YES”
D. DROP TABLE XXX
E. DELETE XXX
F. DELETE TABLE XXX
Ans: D
44. Which of the following is NOT available in MySQL?
A. REVOKE
B. FETCH
C. LIKE
D. JOIN
E. SELECT
Ans: B
45. Which statement is used to count number of rows in table?
A. SELECT COUNT(*) FROM table_name;
B. SELECT COUNT ALL(*) FROM table_name;
C. SELECT ROWS(*) FROM table_name;
D. All the above
Answer : A
46. Which command returns current version on MySQL?
A. SELECT MySQLVERSION();
B. SELECT VERSION(“MySQL”);
C. SELECT VERSION();
D. All the above
Answer : C
47. Which clause is used to sort the result of SELECT statement?
A. SORT BY
B. ORDER BY
C. ARRENGE BY
D. None of the above
Answer : B
48. Which datatypes are treaded as arrays
A. Integer
B. Float
C. String
D. Booleans
Ans: c. String
49. In order to add a new column to an existing table in SQL, we can use the command
A. MODIFY TABLE
B. EDIT TABLE
C. ALTER TABLE
D. ALTER COLUMNS
Answer : C
50. Which of the following ways below are the correct way to get the current date?
A. SELECT CURTIME();
B. SELECT CURDATE();
C. SLELCT CURRRENT_TIME()
D. All of the above
Answer: D