21 lines
529 B
MySQL
21 lines
529 B
MySQL
|
CREATE SCHEMA task03;
|
||
|
USE task03;
|
||
|
|
||
|
CREATE TABLE Colors (
|
||
|
colorName SET ('red', 'green', 'blue')
|
||
|
);
|
||
|
|
||
|
/* can have multiple values at once and be empty */
|
||
|
INSERT INTO Colors VALUES ('red');
|
||
|
INSERT INTO Colors VALUES ('green');
|
||
|
INSERT INTO Colors VALUES ('blue,green');
|
||
|
INSERT INTO Colors VALUES ('');
|
||
|
|
||
|
CREATE TABLE Animals (
|
||
|
name ENUM ('Dog', 'Cat', 'Bird')
|
||
|
);
|
||
|
|
||
|
/* cannot be empty or multiple variants at once */
|
||
|
INSERT INTO Animals VALUES ('Dog');
|
||
|
INSERT INTO Animals VALUES ('Cat');
|
||
|
INSERT INTO Animals VALUES ('Bird');
|