ExamVeda
Login
Home
This question belongs to MySQL MySQL Miscellaneous
MySQL Miscellaneous
?

Which among the following is the correct syntax for defining "ENUM" in Mysql?

Answer & Solution
Correct Answer: Option A
This question is about ENUM in MySQL, which is a special data type used to define a column that can only hold a specific set of values. Imagine you have a column called "gender," and you only want it to contain either "Male" or "Female." This is where ENUM comes in handy. Here's the breakdown of the options: * Option A: gender ENUM ('M', 'F')
This is the correct syntax. It defines a column named "gender" as an ENUM type, and it allows only two values: 'M' and 'F'. * Option B: gender ENUM
This is incorrect. It's missing the values within the parentheses. You need to specify the allowed values for your ENUM column. * Option C: gender ENUM ( )
This is also incorrect. The parentheses should contain the specific values you want to allow. * Option D: none of the mentioned
This is incorrect because Option A is the correct syntax. Therefore, the correct answer is Option A.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.