About MYSQL

Following are some of the multiple choice questions on the MYSQL with answers that will help the students in developing their knowledge.

MYSQL MCQ

1. MySQL is

  • A Programming language
  • A technique for writing reliable programs
  •  A Relational Database Management System
  • None of the Above

2. Which type of database management system is MySQL?

  • Object-oriented
  • Hierarchical
  • Relational
  • Network

3. What is the full form of SQL?

  • Structured Query Language
  • Structured Query List
  • Simple QueryLanguage
  • None of these

4. What will be the output of the following query:Select round(59999.99,-2);

  • 59999
  • 59900
  • 60000
  • 59990

5. Which of the following scripts will run successfully?

  • SELECT customer name FROM customers;
  • SELECT FROM `customers` 'customer name';
  • SELECT `customer name` FROM customers ORDER BY zone WHERE cat_id = 12;
  • SELECT `customer name` FROM customers WHERE cat_id = 12 ORDER BY cat_id;

6. Which of the following can add a row to a table?

  • Add
  • Insert
  • Update
  • Alter

7. What will be returned by the given query? SELECT INSTR("INDIA", "DI");

  • 2
  • 3
  • -2
  • -3

8. What will be printed by the given query? SELECT LENGTH("WINNER");

  • 7
  • 6
  • 8
  • 9

9. What will be returned by the given query? SELECT round(153.669, 2);

  • 153.6
  • 153.66
  • 153.67
  • 153.7

10. Which of the following is not a numeric function?

  • MOD
  • SIGN
  • MID
  • POW

11. With SQL, how do you select all the columns from a table named "Persons"?

  • SELECT * FROM Persons
  • SELECT Persons
  • SELECT [all] FROM Persons
  • SELECT *.Persons

12. Which of the following is not a date function?

  • Month
  • Year
  • Now
  • Pow

13. What will be returned by the given query? SELECT concat("It", "was", "ok");

  • "It was ok"
  • "Itwasok"
  • "Itwas ok"
  • "Tt wasok"

14. Which of the following is not a relational operator?

  • &&
  • >=
  • !=
  • =

15. In a LIKE clause, you can ask for any 6 letter value by writing

  • LIKE ______ (that's six underscore characters)
  • LIKE ...... (that's six dots)
  • LIKE .{6}
  • LIKE ??????

16. Which of the following is not a valid aggregate function?

  • COUNT
  • MIN
  • COMPUTE
  • MAX

17. Which of the following are valid column names?

  • Marks Eng
  • 66_Marks
  • Marks_Eng
  • #Eng_Marks

18. What will be returned by the given query? SELECT month('2020-05-11');

  • 5
  • 11
  • May
  • November

19. What will be returned by the given query? SELECT sign(26);

  • 1
  • -1
  • 0
  • none

20. Which of the following is not a text function?

  • TRIM()
  • TRUNCATE()
  • LEFT()
  • MID()

21. Which of the following is not a keyword of MYSQL?

  • Select
  • Top
  • Group
  • Insert

22. Which one of the following sorts rows in SQL?

  • SORT BY
  • ALIGN BY
  • GROUP BY
  • ORDER BY

23. Which SQL function is used to find the average value of any column?

  • Mean()
  • Avg()
  • Average()
  • Sum()

24. Which is not an aggregate function?

  • SUM()
  • POW()
  • AVG()
  • COUNT()

25. Which operator is used to match column values against a list of values?

  • between
  • IN
  • Like
  • Is Null

26. Write a query to display first_name and last_name of all employees who have their first_name starting with 'A'.

  • Select first_name from employess where first_name LIKE '%A';
  • Select first_name from employess where first_name LIKE "'A'%";
  • Select first_name from employess where first_name LIKE 'A%';
  • Select first_name from employess where first_name LIKE '%A%';

27. The maximum length of char data type is

  • 65535 bytes
  • 255 bytes
  • 256 bytes
  • 456 bytes

28. In MySQL, which command is used to modify the table values

  • Select
  • Update
  • Modify
  • Alter

29. Which function will be used to remove only the trailing spaces from a string?

  • ltrim()
  • rtrim()
  • trim()
  • all

30. Which is the default order of sort in ORDER BY clause?

  • Ascending
  • Descending

31. The updated MySQL extension with PHP5 is typically referred to as

  • MySQL
  • mysql
  • mysqli
  • mysqly

32. Which method returns the error code generated from the execution of the last MySQL function?

  • errno()
  • errnumber()
  • errorno()
  • errornumber()

33. Which one of the following methods can be used to diagnose and display info about a MySQL connection error?

  • connect_errno()
  • connect_error()
  • mysqli_connect_errno()
  • mysqli_connect_error()

34. The “father” of MySQL is ______.

  • Michael Widenius
  • Stephanie Wall
  • Bill Joy

35. Which of the following is not a feature of MySQL?

  • Password protected
  • Not open source software
  • Runs very fast
  • Supports many data types

36. "CREATE TABLE" statement falls to which category of comand of MYSQL?

  • DML
  • DCL
  • TCL
  • DDL

37. If I want to show all data in a MySQL table, I would use

  • SHOW * FROM table;
  • SELECT * FROM table;
  • SHOW * IN table;
  • SELECT * IN table;

38. A relational database ___________ is a data structure used to store and organize information.

  • View
  • Table
  • Report
  • Stored Procedure

39. Which of the following query is correct to get Current Date from Query?A. SELECT DATE ( NOW() ) as today;B. SELECT DATE_FORMAT( NOW( ) , '%Y-%m-%d' ) as today;

  • A. SELECT DATE ( NOW() ) as today;
  • B. SELECT DATE_FORMAT( NOW( ) , '%Y-%m-%d' ) as today;
  • Both A and B
  • None

40. Which clause is used to “Filters out unwanted data”?

  • FROM
  • SELECT
  • ORDER BY
  • WHERE

41. SQL can be used to:

  • Create database structures only.
  • Query database data only.
  • Modify database data only.
  • All of the above can be done by SQL.

42. What does SQL stand for?

  • Structured Query Language
  • Structured Question Language
  • Strong Question Language
  • None of the above

43. Function TRIM() can remove leading and trailing text from a string

  • True
  • False

44. The functions that work with one row at a time are called __________________ functions

  • Row functions
  • Single Row Functions
  • Scalar functions

45. Date() and Day() return the same thing

  • True
  • False

46. Which of the following functions returns the substring from a given string?

  • MID
  • INSTR
  • SUBSTR
  • MID & SUBSTR

47. What SQL clause is used to restrict the rows returned by a query?

  • AND
  • WHERE
  • HAVING
  • FROM

48. Which will input data into a table?

  • INSERT INTO table(name, height, weight) VALUES('strand', '6ft 2in', '165')
  • INPUT INTO table(name, height, weight) VALUES('strand', '6ft 2in', '165')
  • INSERT INTO table CATEGORIES(name, height, weight) VALUES('strand', '6ft 2in', '165')
  • INSERT INTO table CATEGORIES(name, height, weight) ('strand', '6ft 2in', '165')

49. Which statement can be used to select the database?

  • $mysqli=select_db('databasename');
  • mysqli=select_db('databasename');
  • mysqli->select_db('databasename');
  • $mysqli->select_db('databasename');

50. USE keyword is used to select a ____________________

  • Table
  • Column
  • Database
  • None of the above

Enjoyed the Quiz. Share this with friends

Comments

Add Your Review

Your email address will not be published.

Subscribe to Newsletter!

Subscribe to get latest updates and information.