1 зад. DDL- https://judge.softuni.org/Contests/Practice/Index/2866#0
Имам проблем с тази база. Дава ми грешки в таблици: Reports, Categories, Employees. В judge имам резултат от 22/30.
Някой може ли да погледне?
Благодаря!!!
CREATE DATABASE [Service]
USE [Service]
GO
CREATE TABLE Users (
Id INT PRIMARY KEY IDENTITY NOT NULL,
Username VARCHAR(30) NOT NULL UNIQUE,
[Password] VARCHAR(50) NOT NULL,
[Name] VARCHAR(50),
Birthdate DATETIME2,
Age INT NOT NULL
CHECK(LEN(Age) > 14 AND LEN(Age) <= 110),
Email VARCHAR(50) NOT NULL
);
CREATE TABLE Departments (
Id INT PRIMARY KEY IDENTITY NOT NULL,
[Name] VARCHAR(50) NOT NULL,
);
CREATE TABLE Employees (
Id INT PRIMARY KEY IDENTITY NOT NULL,
FirstName VARCHAR(25),
LastName VARCHAR(25),
Birthdate DATETIME2,
Age INT NOT NULL
CHECK(LEN(Age) > 18 AND LEN(Age) <= 110),
DepartmentId INT FOREIGN KEY REFERENCES Departments(Id)
);
CREATE TABLE Categories (
Id INT PRIMARY KEY IDENTITY NOT NULL,
[Name] VARCHAR(50) NOT NULL,
DepartmentId INT FOREIGN KEY REFERENCES Departments(Id) NOT NULL
);
CREATE TABLE [Status] (
Id INT PRIMARY KEY IDENTITY NOT NULL,
[Label] VARCHAR(30) NOT NULL
);
CREATE TABLE Reports (
Id INT PRIMARY KEY IDENTITY NOT NULL,
CategoryId INT FOREIGN KEY REFERENCES Categories(Id) NOT NULL,
StatusId INT FOREIGN KEY REFERENCES [Status](Id) NOT NULL,
OpenDate DATETIME2 NOT NULL,
CloseDate DATETIME2,
[Description] VARCHAR(200) NOT NULL,
UserId INT FOREIGN KEY REFERENCES Users(Id) NOT NULL,
EmployeeId INT FOREIGN KEY REFERENCES Employees(Id)
);
Здеавей отново,
Оправих го, благодаря много