SQL script for database

drop table Actions;
drop table Logs;
drop table Teams;
Create table Teams(
	ID int not null,
	TName nvarchar(12) not null,
	TLeader nvarchar(40),
	TStatus nvarchar(100),
	TMission nvarchar(400),
	Constraint TeamPK Primary Key (ID)
);

create table Logs(
	ID int identity(1,1) not null,
	TeamID int,
	TimeLogged int,
	Msg nvarchar(1000),
	Constraint LogsPK Primary Key (ID),
	Constraint FKTeam Foreign Key (TeamID) references Teams (ID) On delete set null
);

create table Actions(
	ID int identity(1,1) not null,
	TeamID int,
	ActionTime int,
	ActionMsg nvarchar(100),
	Constraint ActionPK Primary Key (ID),
	Constraint FKAction Foreign Key (TeamID) references Teams (ID) On delete set null
);

Author: DizzyBadger

SQL Server DBA, Cluster expert, Principal Analyst

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.