1USE WorldofWarcraft;
2
3CREATE TABLE [users]
4(
5 ID INT NOT NULL IDENTITY(1,1) PRIMARY KEY,
6 username nvarchar(255),
7 password nvarchar(255),
8 mail nvarchar (255),
9 [rank] nvarchar (255) NOT NULL CHECK ([rank] IN('Fresh meat', 'Intern','Janitor','Lieutenant','Supreme being')) DEFAULT 'Fresh meat'
10);
11
12
1Copied CREATE TABLE shirts (
2 name VARCHAR(40),
3 size ENUM('x-small', 'small', 'medium', 'large', 'x-large')
4);
5INSERT INTO shirts (name, size) VALUES ('dress shirt','large'), ('t-shirt','medium'),
6 ('polo shirt','small');
7SELECT name, size FROM shirts WHERE size = 'medium';
8+---------+--------+
9| name | size |
10+---------+--------+
11| t-shirt | medium |
12+---------+--------+
13UPDATE shirts SET size = 'small' WHERE size = 'large';
14COMMIT;