Skip to content

Instantly share code, notes, and snippets.

@nishanc

nishanc/Script.sql

Created May 3, 2021
Embed
What would you like to do?
CREATE TABLE [TPTUsers] (
[Id] int NOT NULL IDENTITY,
[Username] nvarchar(max) NULL,
[Email] nvarchar(max) NULL,
CONSTRAINT [PK_TPTUsers] PRIMARY KEY ([Id])
);
GO
CREATE TABLE [TPTStudents] (
[Id] int NOT NULL,
[CGPA] nvarchar(max) NULL,
[Major] nvarchar(max) NULL,
CONSTRAINT [PK_TPTStudents] PRIMARY KEY ([Id]),
CONSTRAINT [FK_TPTStudents_TPTUsers_Id] FOREIGN KEY ([Id]) REFERENCES [TPTUsers] ([Id]) ON DELETE NO ACTION
);
GO
CREATE TABLE [TPTTeachers] (
[Id] int NOT NULL,
[Designation] nvarchar(max) NULL,
[Speciality] nvarchar(max) NULL,
CONSTRAINT [PK_TPTTeachers] PRIMARY KEY ([Id]),
CONSTRAINT [FK_TPTTeachers_TPTUsers_Id] FOREIGN KEY ([Id]) REFERENCES [TPTUsers] ([Id]) ON DELETE NO ACTION
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment