google.com, pub-6167773875660516, DIRECT, f08c47fec0942fa0 structured query language mcq | sql mcq questions and answers | sql mcq - 2nd puc computer science

structured query language mcq | sql mcq questions and answers | sql mcq

structured query language mcq,sql mcq questions and answers,sql mcq,sql mcq questions,sql mcq class 12,mysql mcq,sql question practice class 12,sql mcq questions with answers,sql mcq test,sql mcq pdf,sql mcq practice,structured query language mcq with answers pdf,sql multiple choice questions with answers pdf,structured query language mcq with answers,structured query language mcq pdf,structured query language mcq online test,structured query language mcq with answers pdf free download,structured query language mcq with answers pdf, download,sql multiple choice questions with answers pdf,

structured query language mcq

1. What does SQL stand for?





ANSWER= C) Structured Query Language

2. Which of the following is not a type of RDBMS?





ANSWER= C) MongoDB

3. SQL is case sensitive in which environment?





ANSWER= B) Linux

4. Which of the following is a correct SQL statement to create a database named Library?





ANSWER= C) CREATE DATABASE Library;

5. Which command is used to list all databases in MySQL?





ANSWER= D) SHOW DATABASES;

6. What is the purpose of the ‘USE’ command in SQL?





ANSWER= C) Select a database for use

7. Which of the following is a valid datatype for storing dates in MySQL?





ANSWER= D) All of the above

8. CHAR(n) datatype in MySQL stores data of:





ANSWER= A) Fixed length

9. Which constraint ensures uniqueness of values in a column?





ANSWER= C) UNIQUE

10. Which two constraints together can form a primary key?





ANSWER= B) NOT NULL and UNIQUE

11. What does the ALTER TABLE command do in SQL?





ANSWER= B) Changes the structure of a table

12. Which keyword is used to remove a column from a table?





ANSWER= C) DROP

13. Which command is used to view the structure of a table?





ANSWER= B) DESCRIBE tablename

14. What type of key is formed by combining multiple attributes?





ANSWER= C) Composite key

15. What happens if you run an UPDATE statement without a WHERE clause?





ANSWER= C) All records are updated

16. Which statement is used to insert data into a table?





ANSWER= B) INSERT INTO

17. In which format is the DATE stored in MySQL?





ANSWER= C) YYYY-MM-DD

18. Which operator is used to compare a value with a set of values?





ANSWER= A) IN

19. Which SQL function returns the remainder of a division operation?





ANSWER= C) MOD

20. Which function is used to calculate exponential power in SQL?





ANSWER= C) POW()

21. Which clause is used to sort records in ascending or descending order?





ANSWER= B) ORDER BY

22. Which keyword is used with ORDER BY to sort in descending order?





ANSWER= C) DESC

23. Which function returns the name of the day from a date?





ANSWER= A) DAYNAME()

24. Which clause helps in fetching only unique values from a column?





ANSWER= C) DISTINCT

25. What is the result of any arithmetic operation with NULL?





ANSWER= B) NULL

26. Which function returns current date and time in SQL?





ANSWER= B) NOW()

27. Which of the following is used for pattern matching in SQL?





ANSWER= A) LIKE

28. Which symbol is used to match any number of characters in SQL pattern matching?





ANSWER= B) %

29. Which SQL function removes leading spaces from a string?





ANSWER= B) LTRIM()

30. Which function converts string to uppercase in SQL?





ANSWER= B) UCASE()

31. Which clause is used to group rows that have the same values?





ANSWER= B) GROUP BY

32. Which function returns the number of characters in a string?





ANSWER= B) LENGTH()

33. Which clause is used to filter rows before grouping?





ANSWER= A) WHERE

34. Which clause is used to filter groups after grouping?





ANSWER= B) HAVING

35. Which aggregate function returns the highest value in a column?





ANSWER= A) MAX()

36. Which clause in SQL is used to group records that have the same values in specified columns?





ANSWER= B) GROUP BY

37. Which operator is used to test for NULL values?





ANSWER= C) IS NULL

38. What will be the result of 5 + NULL in SQL?





ANSWER= C) NULL

39. Which function extracts a substring from a string?





ANSWER= A) MID()

40. What is the output of ROUND(123.456, 1)?





ANSWER= B) 123.5

41. Which keyword is used to permanently remove a table from a database?





ANSWER= D) DROP

42. What is the output of MOD(11, 3)?





ANSWER= A) 2

43. What is the purpose of the DEFAULT constraint?





ANSWER= B) Adds a default value when no input is given

44. Which operator is used to match a value within a range?





ANSWER= C) BETWEEN

45. Which one is not a single row function?





ANSWER= C) AVG()

46. Which function is used to get the month from a date?





ANSWER= B) MONTH()

47. Which of the following is a valid constraint that can be applied to enforce referential integrity between two tables?





ANSWER= D) FOREIGN KEY

48. Which of the following conditions must be satisfied for a FOREIGN KEY to be added to a table?





ANSWER= C) The referenced column must be a PRIMARY KEY

49. Which SQL operator is used to check whether a column value falls between two values (inclusive)?





ANSWER= D) BETWEEN

50. Which keyword is used to delete a particular row in SQL?





ANSWER= C) DELETE

51. Assertion (A): SQL is used only for retrieving data from databases. Reason (R): SQL stands for Structured Query Language.





ANSWER= C) A is false, but R is true

52. Assertion (A): VARCHAR stores variable-length character strings. Reason (R): CHAR and VARCHAR allocate the same amount of memory for any string.





ANSWER= C) A is true, but R is false

53. Assertion (A): PRIMARY KEY allows duplicate values in a column. Reason (R): PRIMARY KEY is used to uniquely identify each record.





ANSWER= C) A is false, but R is true

54. Assertion (A): ALTER TABLE statement can be used to add a new column. Reason (R): ALTER TABLE can modify the structure of an existing table.





ANSWER= A) Both A and R are true, and R is the correct explanation of A

55. Assertion (A): The keyword DESC is used to sort records in descending order. Reason (R): The ORDER BY clause displays records in random order by default.





ANSWER= C) A is true, but R is false

56. Assertion (A): SQL is a case-insensitive language. Reason (R): In SQL, ‘salary’ and ‘SALARY’ are treated as the same column names.





ANSWER= A) Both A and R are true, and R is the correct explanation of A

57. Assertion (A): The CREATE TABLE command is used to define the structure of a new table. Reason (R): CREATE TABLE can define attribute names, data types, and constraints.





ANSWER= A) Both A and R are true, and R is the correct explanation of A

58. Assertion (A): DEFAULT constraint ensures that every column must have a unique value. Reason (R): DEFAULT sets a predefined value for a column when no value is provided.





ANSWER= C) A is false, but R is true

59. Assertion (A): DELETE statement removes a table from the database. Reason (R): DROP TABLE statement is used to remove a table permanently.





ANSWER= C) A is false, but R is true

60. Assertion (A): The WHERE clause in SQL is used to filter groups formed by GROUP BY. Reason (R): HAVING clause filters records before they are grouped.





ANSWER= D) Both A and R are false

61. Assertion (A): INSERT INTO command adds new records into a table. Reason (R): Records can be inserted without specifying column names if all values are provided in correct order.





ANSWER= A) Both A and R are true, and R is the correct explanation of A

62. Assertion (A): A FOREIGN KEY can reference a column that is not a primary key. Reason (R): A foreign key ensures that each value exists in another table’s primary key column.





ANSWER= C) A is false, but R is true

63. Assertion (A): ROUND() is used to round numbers to specified decimal places. Reason (R): ROUND(283.2, 0) will return 283.2.





ANSWER= C) A is true, but R is false

64. Assertion (A): The % symbol in SQL is used to match zero or more characters. Reason (R): The LIKE clause in SQL supports pattern matching using wildcards.





ANSWER= A) Both A and R are true, and R is the correct explanation of A

65. Assertion (A): The BETWEEN operator is inclusive of boundary values. Reason (R): BE- TWEEN is used to test if a value lies between a specified range.





ANSWER= A) Both A and R are true, and R is the correct explanation of A

66. Assertion (A): You can use the alias keyword AS to rename a column in the output. Reason (R): Column aliasing affects the actual table structure permanently.





ANSWER= C) A is true, but R is false

67. Assertion (A): NOW() function returns the current system date and time. Reason (R): NOW() is a date function used in MySQL.





ANSWER= A) Both A and R are true, and R is the correct explanation of A

68. Assertion (A): MID() function is used to extract a part of a string. Reason (R): MID() is a numeric function used to perform arithmetic operations.





ANSWER= C) A is true, but R is false

69. Assertion (A): The TRIM() function is used to remove trailing spaces only. Reason (R): TRIM() removes both leading and trailing spaces from a string.





ANSWER= D) A is false, but R is true

70. Assertion (A): The IS NULL operator is used to check for zero values. Reason (R): IS NULL checks whether a column has NULL as its value.





ANSWER= C) A is false, but R is true

structured query language mcq | sql mcq questions and answers | sql mcq structured query language mcq | sql mcq questions and answers | sql mcq Reviewed by Vision Academy on July 20, 2025 Rating: 5

No comments:

CheckOut

Powered by Blogger.