Skip to content

Instantly share code, notes, and snippets.

@m1irka
Created May 15, 2026 08:10
Show Gist options
  • Select an option

  • Save m1irka/c897b370449b8f82e3812696c7a5afa1 to your computer and use it in GitHub Desktop.

Select an option

Save m1irka/c897b370449b8f82e3812696c7a5afa1 to your computer and use it in GitHub Desktop.
Create Table Groups
(
Id int Identity(1,1) Primary Key,
Name nvarchar(10) not null unique check (Name <> ''),
Rating int not null check (Rating between 0 and 5),
Year int not null check (Year between 1 and 5)
)
Create Table Departments
(
Id int Identity(1,1) Primary Key,
Financing money not null default 0 check (Financing >= 0),
Name nvarchar(100) not null unique check (Name <> '')
)
Create Table Faculties
(
Id int Identity(1,1) Primary Key,
Name nvarchar(100) not null unique check (Name <> '')
)
Create Table Teachers
(
Id int Identity(1,1) Primary Key,
EmploymentDate date not null check (EmploymentDate >= '1990-01-01'),
Name nvarchar(max) not null check (Name <> ''),
Premium money not null default 0 check (Premium >= 0),
Salary money not null check (Salary > 0),
Surname nvarchar(max) not null check (Surname <> '')
)
Insert into Groups (Name, Rating, Year)
Values ('KN-D-241', 2, 1)
Insert into Departments (Financing, Name)
Values (4355, 'Computers nauki')
Insert into Faculties (Name)
Values ('It step academy')
Insert into Teachers (EmploymentDate, Name, Premium, Salary, Surname)
Values ('2020-05-06', 'Ivan', 24445, 432, 'Ivanovits')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment