MySQL Set 2 (20 mcqs)

1. BLOB data type can have default column value.
A.True
B.False

2. User() function return the current user name and ___________
A.password
B.host name
C.both a and b above
D.database name associated with the user

3. Can DISTINCT command be used for more than one column?
A.No
B.Yes

4. How much storage space does DATETIME require?
A.4 bytes
B.2 bytes
C.8 bytes
D.1 bytes

5. Which of the following file extension is valid MyISAM file extension?
A..ism
B..myd
C..my
D..mys

6. –i-am-a-dummy flag is used Make the MySQL engine refuse UPDATE and which other command?
A.WHERE
B.INSERT
C.DELETE
D.TRUNCATE

7. On executing DELETE command, if you get an error “foreign key constraint” – what does it imply?
A.Foreign key not defined
B.Table is empty
C.Connectivity issue
D.Data is present in the other table

8. Can I call  a trigger directly from an application?
A.Yes
B.No

9. What is a candidate key?
A.Used to uniquely identify a row
B.Alias for primary key
C.Used to identify a column
D.Alias for foreign key

10. Which is the default order of sort in ORDER BY clause?
A.Ascending
B.Descending

11. Can I define multiple unique constraints on a table?
A.Yes
B.No

12. How can we get the number of records or rows in a table?
A.Using COUNT
B.Using NUM
C.Using NUMBER
D.Both a and c above

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

14. USE keyword is used to select a ____________________
A.Table
B.Column
C.Database
D.All of the above

15. How do I find out all databases starting with `test to which I have access to ?
A.SHOW DATABASES LIKE `%test%`;
B.SHOW DATABASES LIKE `%test;
C.SHOW DATABASES LIKE `’test’%’;
D.SHOW DATABASES LIKE `%test%’;

16. A view is nothing but a _____________ table or a stored query.
A.Dynamic
B.Real
C.Virtual
D.Static

17. When do we use a HAVING clause?
A.To limit the output of  a query
B.To limit the output of a query using an aggregate function only
C.When GROUP by is used
D.Both a and c above

18. An outer join requires each record in the two joined tables to have a matching record
A.    True
B.     False

19. Enum values are stored according to their index numbers
A.True
B.False

20. If an ENUM column is declared NOT NULL, its   default value is the first element of the list of allowed values.
A.True
B.False, ENUM column cannot be null
C.False, its default value is the last element of the list of allowed values

Answers

1.B 2.B 3.B 4.C 5.B 6.C
7.D 8.B 9.A 10.A 11.A 12.A
13.D 14.C 15.D 16.C 17.B 18.B
19.A 20.A

Sharing is caring!

Leave a Comment

Your email address will not be published. Required fields are marked *

shares