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. How is PHP written into a webpage?

  • Just like other html tags: <php> </php>
  • Only in a separate file which is linked to the html page
  • Using curled brackets {php} {/php}
  • A PHP script starts with <?php and ends with ?>

2. What does DML stand for?

  • Data Manipulation Language
  • Data Modeling Language
  • Data Markup Language
  • Data Migration Language

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

  • Select
  • Top
  • Group
  • Insert

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

  • COUNT
  • MIN
  • COMPUTE
  • MAX

5. SQL is not case sensitive. SELECT is the same as select.

  • TRUE
  • FALSE

6. The _________ statement is used to delete a table.

  • DROP TABLE
  • DELETE TABLE
  • DEL TABLE
  • REMOVE TABLE

7. The SQL statement that queries or reads data from a table is __________ .

  • USE
  • SELECT
  • READ
  • QUERY

8. Which SQL statement is used to return only different values?

  • SELECT DISTINCT
  • SELECT UNIQUE
  • SELECT DIFF
  • SELECT DIFFERENT

9. 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 ??????

10. Which SQL statement is used to update data in a database?

  • MODIFY
  • ALTER
  • SAVE
  • UPDATE

11. The SQL keyword BETWEEN is used:

  • For ranges.
  • To limit the columns displayed.
  • As a wildcard.
  • None of the above

12. Which statement is used to delete an existing row from the table?

  • DELETE
  • WHERE
  • MODIFY
  • None of these

13. Which of the following functions returns the position of a substring in a given string?

  • MID
  • INSTR
  • SUBSTR
  • CHAR

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

  • 7
  • 6
  • 8
  • 9

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

  • 2
  • 3
  • -2
  • -3

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

  • 153.6
  • 153.66
  • 153.67
  • 153.7

17. What will be returned by the given query?SELECT truncate(15.79, -1), truncate(15.79, 0), truncate(15.79, 1);

  • 15 15 15.7
  • 10 15.7 15.9
  • 10 15 15.7
  • 10 10 15.9

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

  • 59999
  • 59900
  • 60000
  • 59990

19. Which operator test the column for absence of data?

  • Not operator
  • and operator
  • is null operator
  • None of these

20. Which of the following is not a DML command?

  • Update
  • Insert into
  • Delete
  • Create Table

21. Which SQL keyword is used to sort the result-set?

  • Sort by
  • order by
  • sort
  • none of these

22. Which SQL command is used to remove rows from the table customer?

  • Drop from customer ;
  • Update from customer;
  • remove from customer ;
  • Delete from customer where condition ;

23. Which of the following must be enclosed in double quotes?

  • Date
  • Column alias
  • String
  • All of the above

24. An organized collection of data stored in a central location is known as?

  • database
  • flat file
  • csv
  • none of these

25. Which type of database management system represents relations using tables?

  • Network DBMS
  • Relational DBMS
  • Object Oriented DBMS
  • Hierarchical DBMS

26. 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;

27. SELECT * FROM sales WHERE amount > 200.

  • the query will display all the sales records with amounts starting from 200 and above
  • the query will display all the sales records with amounts less than 200
  • the query will display all the sales records with amounts greater than 200
  • the query will output sales records with the amount equal to 200.

28. Correct command to create database school

  • use school ;
  • make database school ;
  • create school;
  • Create database school;

29. What does PHP stands for?

  • PHP: Hypertext Preprocessor
  • Private Home Page
  • Personal Hypertext Processor

30. Which among the following is the correct delimiters that surround PHP server scripts?

  • <?php>...</?>
  • <script>...</script>
  • <?php...?>
  • <&>...</&>

31. How do you create an array in PHP?

  • $cars = "Volvo", "BMW", "Toyota";
  • $cars = array["Volvo", "BMW", "Toyota"];
  • $cars = array("Volvo", "BMW", "Toyota");

32. The if statement is used to execute some code only if a specified condition is true

  • True
  • False

33. 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')

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

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

  • FROM
  • SELECT
  • ORDER BY
  • WHERE

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

37. What does SQL stand for?

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

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

  • True
  • False

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

  • Row functions
  • Single Row Functions
  • Scalar functions

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

  • True
  • False

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

  • 5
  • 11
  • May
  • November

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

  • 1
  • -1
  • 0
  • none

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

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

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

  • MID
  • INSTR
  • SUBSTR
  • MID & SUBSTR

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

  • Month
  • Year
  • Now
  • Pow

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

  • MOD
  • SIGN
  • MID
  • POW

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

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

48. 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;

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

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

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

  • MySQL
  • mysql
  • mysqli
  • mysqly

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.