Here is the SQL script:
create table Employee(
Carnet nvarchar(15) primary key,
Name nvarchar(500),
LastName nvarchar(500)
)
create table Document(
ID nvarchar(20) primary key,
Employee nvarchar(15) foreign key references Employee(Carnet),
Project nvarchar(20) foreign key references Project(ID)
)
create table DocumentsArea(
DocumentID nvarchar(20) foreign key references Document(ID),
AreaID nvarchar(20) foreign key references Area(ID)
)
create table Area(
ID nvarchar(20) primary key,
Name nvarchar(200),
)
create table Project(
ID nvarchar(20) primary key,
Company nvarchar(500) foreign key references Company(Name),
Title nvarchar(500),
)
create table Company(
Name nvarchar(500) primary key,
CEO nvarchar(15) foreign key references Person(Carnet),
NIT nvarchar(40)
)
create table Person(
Carnet nvarchar(15) primary key,
Name nvarchar(100),
LastName nvarchar(100)
)
The database is pretty bare bones except for the bare necessities because I'm going to be told later on what information to save on Documents, etc.
I'm somewhat inexperienced with database designs so maybe I'm forgetting a couple of things. Any suggestions?