MySQL/tasks/task-6-1-2.sql

26 lines
889 B
SQL

CREATE SCHEMA shirt_shop;
CREATE TABLE shirt_shop.shirts (
name VARCHAR(40) NOT NULL PRIMARY KEY ,
size ENUM('small', 'medium', 'large') NOT NULL,
color SET('blue', 'black', 'white') NOT NULL
);
INSERT INTO shirt_shop.shirts SET
name = 'large dress shirt',
size = 'large',
color = 'black';
INSERT INTO shirt_shop.shirts SET
name = 'medium t-shirt',
size = 'medium',
color = 'white,blue';
INSERT INTO shirt_shop.shirts SET
name = 'small polo shirt',
size = 'small',
color = 'blue';
SELECT name, color FROM shirt_shop.shirts WHERE color = 'black' AND size = 'large';