-
What is the purpose of the AVG() function in MySQL?
- A) To return the maximum value of a column
- B) To return the minimum value of a column
- C) To return the average value of a column
- D) To return the total value of a column
Answer: C) To return the average value of a column
-
Which SQL command is used to create a foreign key constraint in MySQL?
- A) ADD FOREIGN KEY
- B) CREATE FOREIGN KEY
- C) FOREIGN KEY
- D) SET FOREIGN KEY
Answer: A) ADD FOREIGN KEY
-
What is the purpose of the SUBSTRING() function in MySQL?
- A) To extract a part of a string
- B) To return the length of a string
- C) To concatenate two or more strings
- D) To convert a string to uppercase
Answer: A) To extract a part of a string
-
Which SQL function is used to return the current month in MySQL?
- A) MONTH()
- B) CURRENT_MONTH()
- C) GETMONTH()
- D) CURMONTH()
Answer: A) MONTH()
-
What is the purpose of the UPPER() function in MySQL?
- A) To return the maximum value of a column
- B) To return the minimum value of a column
- C) To convert a string to uppercase
- D) To convert a string to lowercase
Answer: C) To convert a string to uppercase
-
Which SQL command is used to create a table in MySQL?
- A) ADD TABLE
- B) CREATE TABLE
- C) MAKE TABLE
- D) SET TABLE
Answer: B) CREATE TABLE
-
What is the purpose of the MIN() function in MySQL?
- A) To return the maximum value of a column
- B) To return the minimum value of a column
- C) To return the average value of a column
- D) To return the total value of a column
Answer: B) To return the minimum value of a column
-
Which SQL command is used to delete a column from a table in MySQL?
- A) DELETE COLUMN
- B) REMOVE COLUMN
- C) DROP COLUMN
- D) ERASE COLUMN
Answer: C) DROP COLUMN
-
What is the purpose of the CURRENT_TIMESTAMP() function in MySQL?
- A) To return the current date
- B) To return the current time
- C) To return the current date and time
- D) To return the difference between two dates
Answer: C) To return the current date and time
-
Which SQL function is used to return the number of rows in a table in MySQL?
- A) ROW_COUNT() - B) COUNT_ROWS() - C) NUM_ROWS() - D) COUNT()
Answer: D) COUNT()
Comments