SET Data type in Mysql
SET Data type:
A SET datatype can hold any number of strings from a predefined list of strings specified during table creation. The SET datatype is similar to the ENUM datatype in that they both work with predefined sets of strings, but where the ENUM datatype restricts you to a single member of the set of predefined strings, the SET datatype allows you to store any of the values together, from none to all of them.
Example:
CREATE TABLE select_option(
rowid INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
set_option SET(’Travel’,'Sports’,'Dancing’,'Fine Dining’)
);
INSERT INTO select_option(set_option) VALUES(’Travel,Sports’);
INSERT INTO select_option(set_option) VALUES(’Sports’);
SELECT * FROM select_option WHERE FIND_IN_SET(’Travel’,set_option) > 0;
