[Homework Data Definition and Data Types] Problem 7. Къде греша
Колкото и теста да и правих, при мен всичко си работи (а си играх много, в момента е 01:15ч.). В Judge-a обаче не минава.
CREATE TABLE Users
(
Id INT UNIQUE IDENTITY(1,1),
Name NVARCHAR(200) NOT NULL,
Picture VARBINARY(MAX),
Height DECIMAL(38,2),
Weight DECIMAL(38,2),
Gender VARCHAR(1) NOT NULL,
Birthdate DATE NOT NULL,
Biography NVARCHAR(MAX)
)
ALTER TABLE Users ADD PRIMARY KEY(Id)
ALTER TABLE Users
ADD CONSTRAINT CH_Picture CHECK(DATALENGTH(Picture) < 2000 * 1024)
ALTER TABLE Users
ADD CONSTRAINT CH_Biography CHECK(DATALENGTH(Biography) < 1000000 * 1024)
ALTER TABLE Users
ADD CONSTRAINT CH_Gender CHECK(Gender = 'm' or Gender = 'f')
INSERT INTO Users (Name, Picture, Height, Weight, Gender, Birthdate, Biography) VALUES ('Minka', NULL, 212.326, 32.12, 'm', '1982-02-22', NULL)
INSERT INTO Users (Name, Picture, Height, Weight, Gender, Birthdate, Biography) VALUES ('Ginka', NULL, 23.21, 32.12, 'f', '1223-12-12', 'DFGDFGDG')
INSERT INTO Users (Name, Picture, Height, Weight, Gender, Birthdate, Biography) VALUES ('Pesho', NULL, 53.45, NULL, 'm', '1982-02-22', 'FTHTHFH')
INSERT INTO Users (Name, Picture, Height, Weight, Gender, Birthdate, Biography) VALUES ('Gosho', NULL, 54.32, 827.678, 'f', '1982-02-22', 'AEWQWEWDE')
INSERT INTO Users (Name, Picture, Height, Weight, Gender, Birthdate, Biography) VALUES ('Misho', NULL, 32.12, NULL, 'm', '1982-02-22', 'RGEDGDGDG')
Благодаря, задачата мина само с тази поправка.