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

26 lines
889 B
MySQL
Raw Permalink Normal View History

2023-11-03 11:36:40 +00:00
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';