Our experts have gathered these MySQL MCQs through research, and we hope that you will be able to see how much knowledge base you have for the subject of MySQL by answering these multiple-choice questions.
Get started now by scrolling down!
A. Regular Key
B. Main Key
C. Primary Key
D. Foreign Key
A. bit_or()
B. binary
C. bit_count()
D. bit_and()
A. pseudofile
B. trigger
C. None of the above is correct.
D. embedded SELECT statement
A. COMMIT and UNDO
B. SAVE and ROLLBACK
C. COMMIT and ROLLBACK
D. SAVE and UNDO
A. Prevents Restrictions Limitations
B. Constraints
A. SELECT * FROM Persons WHERE FirstName<>'Peter' AND LastName<>'Jackson'
B. SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson'
C. SELECT FirstName='Peter', LastName='Jackson' FROM Persons
A. SAVE
B. MODIFY
C. SAVE AS
D. UPDATE
A. Simplified Query Language
B. Structured Query Language
A. Structured Question Language
B. Structured Query Language
C. Strong Question Language
A. SELECT * FROM Persons
B. SELECT *.Persons
C. SELECT Persons
D. SELECT [all] FROM Persons
A. false
B. true
A. DELETE FROM Persons WHERE FirstName = 'Peter'
B. DELETE ROW FirstName='Peter' FROM Persons
C. DELETE FirstName='Peter' FROM Persons
A. ADD NEW
B. INSERT INTO
C. ADD RECORD
D. INSERT NEW
A. false
B. true
A. False
B. True
A. COUNT
B. MAX
C. COMPUTE
D. MIN
A. INSERT ('Jimmy', 'Jackson') INTO Persons
B. INSERT VALUES ('Jimmy', 'Jackson') INTO Persons
C. INSERT INTO Persons VALUES ('Jimmy', 'Jackson')
A. GET
B. EXTRACT
C. OPEN
D. SELECT
A. Nothing
B. Multiply
C. Select All
D. Group By
E. Assign a Pointer
A. REMOVE
B. ERASE
C. COLLAPSE
D. DELETE
A. Before Insert
B. After Delete
C. All
D. Before Update
A. EXTRACT FirstName FROM Persons
B. SELECT Persons.FirstName
C. SELECT FirstName 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'
A. develope websites
B. manage users
C. make Apps
D. store data
E. Store and manipulate data
A. REMOVE TABLE
B. DESTROY TABLE
C. DELETE TABLE
D. DROP TABLE
A. They can provide a common set of database operations to multiple applications
B. They allow you to store libraries of functions inside the database server
C. They can improve security by limiting users to specific approved queries
D. All of these
A. INSERT INTO Persons ('Olsen') INTO LastName
B. INSERT ('Olsen') INTO Persons (LastName)
C. INSERT INTO Persons (LastName) VALUES ('Olsen')
A. SELECT * FROM Persons ORDER BY FirstName DESC
B. SELECT * FROM Persons ORDER FirstName DESC
C. SELECT * FROM Persons SORT 'FirstName' DESC
D. SELECT * FROM Persons SORT BY 'FirstName' DESC
A. SELECT * FROM teams WHERE team_won like (2, 4, 6, 8);
B. SELECT * FROM teams WHERE team_won IN (2, 4, 6, 8);
C. SELECT * FROM teams WHERE team_won join (2, 4, 6, 8);
D. SELECT * FROM teams WHERE team_won on (2, 4, 6, 8);
A. An error, because a SELECT statement is invalid without a WHERE clause.
B. All of the rows from a table.
C. All of the rows from a table that match the previous WHERE clause.
D. Nothing.
A. False
B. True
A. 60
B. 66
C. 64
D. 62
A. SELECT COUNT(*) FROM Persons
B. SELECT COUNT() FROM Persons
C. SELECT COLUMNS(*) FROM Persons
D. SELECT COLUMNS() FROM Persons
A. The ROLLUP modifier can only be used with the GROUP BY clause
B. The WITH ROLLUP modifier will add an extra row to the results of a query.
C. All of these
A. Atomicity
B. Analysis Allow Alter
A. REDUCE
B. PRIMARY
C. DISTINCT
D. UNIQUE
A. Write
B. Print
C. Read and Print
D. Read and Write
A. '1'
B. 1
C. "1"
A. SELECT * FROM table WHERE name LIKE 'S%';
B. None of these
C. SELECT * FROM table WHERE name = 'S%';
D. SELECT * FROM table WHERE name LIKE = 'S*';
A. ORDER
B. ORDER BY
C. SORT
D. SORT BY
A. PRIMARY KEY
B. FIRST KEY
C. FOREIGN KEY
D. REFERENCE KEY
E. UNIQUE KEY
A. MERGE
B. COMBINE
C. UNION
D. None of these
A. MTRIM()
B. None of these
C. STRIP()
D. LTRIM()
E. TRIM()
A. UPDATE
B. CHANGE
C. ALTER
D. INSERT
E. DELETE
A. restart mysql service init 0 reboot
B. /etc/init.d/mysql restart service mysqld restart
A. That the database is organized in a way to reduce data redundancy. 1NF, 2NF, and 3NF forms are used as common guidelines.
B. That the data returned within any given row is converted to a single object type as most appropriate (string, int, etc.).
C. That the MySQL "strict" mode is invoked to avoid incompatibilities with legacy SQL.
D. That common queries assigned to functions to simplify statements.
E. That non-common characters are stripped from values to ensure compatibility with given character set.
A. Alter
B. Insert
C. Add
D. Update
A. SELECT DATE_FORMAT(btimestamp,'%d/%m/%Y') AS bdate FROM ...
B. SELECT FORMAT_DATE(btimestamp,'%d/%m/%Y') AS bdate FROM ...
A. Far
B. From
C. Near
D. Under
A. Transactional Control Language
B. Truncate Command Language
C. Traffic Control Language
A. False-True
B. True
C. True-False
D. False
A. All of these
B. WHERE last_name IS ALPHABETICAL
C. SELECT BY last_name
D. ORDER BY last_name
A. If GROUP BY is not used, the HAVING and WHERE clauses will be merged
B. Each table Index is queried, and the best Index is used.
C. All of these
D. Constant expressions used with Indexes are only evaluated once
A. True
B. False
A. Table
B. Column
C. Row
D. Database
A. %h
B. %H
C. %k
D. %K
A. INNODB
B. A
C. ISYAM
A. APPEND
B. ALTER
C. NEW
D. UPDATE
E. CREATE
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%'
A. A key that acts as a substitution to other natural keys
B. Same as Natural key
C. Same as Primary key
D. a type of join
A. UPDATE tab SET f1=1 AND f2=2;
B. UPDATE tab SET f1=1 , f2=2;
C. UPDATE tab.f1=1 AND tab.f2=2;
D. UPDATE tab.f1=1 , tab.f2=2;
A. GROUP BY
B. WHERE
C. FROM
D. SELECT
A. SELECT AVERAGE(values) FROM foo
B. SELECT AVG(values) FROM foo
C. SELECT values.AVERAGE FROM foo
D. SELECT AVERAGE OF values FROM foo
A. SELECT * FROM orders WHERE LIMIT item_count (3, 5, 7, 9);
B. SELECT * FROM orders WHERE item_count IN (3, 5, 7, 9);
C. SELECT * FROM orders WHERE item_count LIKE (3, 5, 7, 9);
D. SELECT * FROM orders WHERE item_count = (3, 5, 7, 9);
A. select employee_name, company_name from employee and company
B. select e.name, c.name from employee e left join company c
C. This is not possible
D. select e.name, c.name from employee e left join company c on c.id = e.company
E. select e.name, c.name from employee e, company c
A. False
B. True
A. 24MB
B. 1GB No Default Size 500MB
A. NULL
B. UNSPEC
C. UNSPECIFIED
D. ()
E. ANY
A. Binary List Object
B. None of these
C. Big List Object
D. Binary Large Object
A. SHOW COLUMNS
B. SHOW OPEN TABLES
C. SHOW DATABASE
D. SHOW TABLES
A. SELECT * FROM TableA WHERE ColumnX IS DISTINCT;
B. SELECT UNIQUE * FROM TableA WHERE ColumnX="SomeValue";
C. SELECT DISTINCT * FROM TableA WHERE ColumnX="SomeValue";
D. SELECT * FROM TableA WHERE ColumnX=UNIQUE("SomeValue");
E. SELECT * FROM TableA WHERE ColumnX IS UNIQUE;
A. Data Control Language
B. Data Context Language
C. Define Context Language
D. Define Control Language
A. SELECT LAST_INSERT_ID();
B. You can't; the row creation would have failed with a Key Constraint error.
C. GET_AUTO_ID();
D. SELECT LAST_KEY_INC();
A. SELECT user_name FROM users WHERE user_phonenumber;
B. SELECT user_name FROM users WHERE user_phonenumber IS NULL;
C. Any of these three statements may work, depending on the version of MySQL being used.
D. SELECT user_name FROM users WHERE user_phonenumber = NULL;
A. bdb_max_lock
B. bdb_logdir
C. bdb_home
D. bdb_cache_size
A. Drop Table
B. Truncate Table
C. Delete Table
D. Alter Table
A. Inner join returns only rows from the first table; outer join returns rows from both tables
B. Inner join deletes rows that don't match; outer join does not delete any rows
C. Inner join returns only rows from both tables that match on the given conditional expression
A. FORMAT_DATE(NOW(), '%Y-%m-%d %T')
B. UNIX_TIMESTAMP(NOW())
C. DATE_FORMAT(NOW(), '%Y-%m-%d %T');
D. GET_FORMAT(NOW(), '%Y-%m-%d %T')
A. False
B. True
A. mysqlshow
B. mysqladmin
C. mysqldump
D. mysqlcheck
A. SELECT test;
B. CALL test;
C. SELECT test FROM procedures;
D. Set @variable = test;
A. ON REPEAT VALUE UPDATE
B. ON DUPLICATE VALUE UPDATE
C. ON DUPLICATE KEY UPDATE
D. ON REPEAT KEY UPDATE
A. SELECT * FROM UNION TableA, TableB
B. SELECT * FROM TableA UNION SELECT * FROM TableB
C. SELECT * FROM Table A UNION TableB
D. SELECT UNION * FROM TableA, TableB
A. False
B. True
A. Values from the left table are preserved for NULL values in the right table
B. Values from the right table are preserved for NULL values in the right table
C. The join will delete rows which contain a NULL value in the left table and preserve all other rows
D. The join will delete rows which contain a NULL value in the right table and preserve all other rows
A. 16 byte
B. 64 byte
C. 32 byte
D. 4 byte
A. InnoDB tables can have relationship constraints, MyISAM tables do not
B. All of these are true
C. Both MyISAM and InnoDB can use full-text index searches
D. You can have both types of tables in one database
A. POINTER
B. CURSOR
C. STORE
D. KEY
E. UNIQUE
A. CREATE TABLE test ( name(20) );
B. CREATE TABLE test (VARCHAR(20));
C. CREATE TABLE test (column: name, type:CHAR(20));
D. CREATE TABLE test (name CHAR(20));
A. You do not need to turn this on, delay_key_write is enabled by default after the installation of MySQL.
B. Because turning delay_key_write on ensures that the database will not flush the MyISAM key file after every single write.
C. Turning delay_key_write on is actually a bad idea since it would delay everything whenever a new key is automatically generated.
A. SET $foo= 'bar';
B. $foo = 'bar';
C. VAR $foo ='bar';
D. VAR @foo = 'bar';
E. SET @foo = 'bar';
A. Delete all records in table 'xpto' but does not reset the AUTO_INCREMENT sequence
B. Delete all records in table 'xpto' and reset the AUTO_INCREMENT value to 0;
C. Throw an error depending on sql mode
D. Delete all records in table 'xpto' and resets the AUTO_INCREMENT sequence
A. BETWEEN 1 AND 10
B. IN INTERVAL(1, 10)
C. IN INTERVAL(0, 11)
D. BETWEEN 0 AND 11
A. None of these
B. It stops incrementing, producing a duplicate key error.
C. The value "wraps around" to the lowest value and continues incrementing.
D. Further rows will be inserted with the same value.
A. Cardinality
B. Seq-in-index
C. Collation
D. Sub-part
A. DELETE USER user;
B. DROP USER user;
C. None of these
D. REVOKE USER user;
A. count(*)
B. count(all)
C. count(
D. count(distinct)
A. CIRCLE
B. GEOMETRY CIRCLE POINT POLYGON
A. None are correct
B. Indexes can only be done on columns containing numerical data
C. Indexes can only be done on primary key columns
D. Indexes will slow down selects, but speed up inserts
E. Indexes will slow down inserts, but speed up selects
A. alter table inventory modify price decimal(10,2)
B. Both are correct.
C. alter table inventory change column price decimal(10,2)
D. This is not possible.