create database teamspirit

use teamspirit

create table loginInfo (LoginId varchar(25) primary key NOT NULL , LoginPassword varchar(25) NOT NULL)

create table loginStatus (LoginName varchar (25) Primary key NOT NULL, ConnectionID int NOT NULL)

create table notice (Notice ID INT NOT NULL PRIM<ARY KEY AUTO_INCREMENT, Displayer varchar (25) not null, DatePosting DATE NOT NULL,NoticeTitle TINYTEXT NOT NULL, DateRemoving DATE NOT NULL,Filename VARCHAR (50) NOT NULL)

create table noticeRead (UserName VARCHAR (25) NOT NULL, NoticeID INT NOT NULL,DateReading Date NOT NULL, Primary Key (UserName, NoticeID))

Create table commnet (CommnetID INT NOT NULL PRIMARY KEY AUTO_INCREMENT, Author VARCHAR (25) NOT NULL ,DatePosting DATE NOT NULL, Commnet TINYTEXT NOT NULL)

Create table noticeCommnet (Cooment_ID int not null primary key, NoticeID int not null)

create table file (FileID int not null primary key AUTO_INCREMENT, Filename varchar (25) NOT NULL, PackageID int NOT NULL, Location varchar (50) not null, Owner varchar (25) not null)

create table package (PackageID int not null primary key auto_increment, PackageName varchar (25) NULL, projectID int not null)

create table project (projectID int not null primary key auto_increment , ProjectName varchar (25) not null)

create table fileRead (FileID int not null, userName varchar (25) not null, When String(20 not null, primary key (FileID, userName)))

