[SPOILER] Script SQL AVIONS
Page 1 sur 1
[SPOILER] Script SQL AVIONS
create database AirVince
go
USE AirVince
GO
create type TypeDate from datetime not null
create type TypeHoraire from smalldatetime not null
create type TypeNom from varchar(50) not null
create type TypePrenom from varchar(30) null
create type TypeAvion from varchar(20) not null
create type TypeIdConstructeur from smallint not null
create type TypeIdAeroport from char(3) not null
create type TypeIdPilote from smallint not null
create type TypeNumVol from char(5) not null
create type TypeVille from varchar(50) null
Go
create table AEROPORT
(
IdAeroport TypeIdAeroport primary key,
NomAeroport varchar(50) not null,
NomVilleDesservie TypeVille
)
Go
create table PILOTE
(
IdPilote TypeIdPilote primary key,
NomPilote TypeNom,
PrenomPilote TypePrenom
)
go
create table CONSTRUCTEUR
(
IdConstructeur TypeIdConstructeur primary key,
NomConstructeur TypeNom
)
go
create table TYPE
(
TypeAvion TypeAvion,
Capacité smallint,
IdConstructeur smallint REFERENCES CONSTRUCTEUR(IdConstructeur)
)
Create table AVION
(
NumAvion TypeNumVol primary key,
TypeAvion TypeAvion,
BaseAeroport char(3) REFERENCES AEROPORT(IdAeroport)
)
Create table VOL
(
NumVol TypenumVol primary key,
AeroportDept varchar(50) not null,
HDépart datetime not null,
AeroportArr varchar(50) not null,
HArrivée datetime not null
)
create table AFFECTATION
(
NumVol char(5) REFERENCES VOL(NumVol),
DateVol TypeDate,
NumAvion char(5) REFERENCES AVION(NumAvion),
IdPilote smallint REFERENCES PILOTE(IdPilote)
)
Use publi
go
USE AirVince
GO
create type TypeDate from datetime not null
create type TypeHoraire from smalldatetime not null
create type TypeNom from varchar(50) not null
create type TypePrenom from varchar(30) null
create type TypeAvion from varchar(20) not null
create type TypeIdConstructeur from smallint not null
create type TypeIdAeroport from char(3) not null
create type TypeIdPilote from smallint not null
create type TypeNumVol from char(5) not null
create type TypeVille from varchar(50) null
Go
create table AEROPORT
(
IdAeroport TypeIdAeroport primary key,
NomAeroport varchar(50) not null,
NomVilleDesservie TypeVille
)
Go
create table PILOTE
(
IdPilote TypeIdPilote primary key,
NomPilote TypeNom,
PrenomPilote TypePrenom
)
go
create table CONSTRUCTEUR
(
IdConstructeur TypeIdConstructeur primary key,
NomConstructeur TypeNom
)
go
create table TYPE
(
TypeAvion TypeAvion,
Capacité smallint,
IdConstructeur smallint REFERENCES CONSTRUCTEUR(IdConstructeur)
)
Create table AVION
(
NumAvion TypeNumVol primary key,
TypeAvion TypeAvion,
BaseAeroport char(3) REFERENCES AEROPORT(IdAeroport)
)
Create table VOL
(
NumVol TypenumVol primary key,
AeroportDept varchar(50) not null,
HDépart datetime not null,
AeroportArr varchar(50) not null,
HArrivée datetime not null
)
create table AFFECTATION
(
NumVol char(5) REFERENCES VOL(NumVol),
DateVol TypeDate,
NumAvion char(5) REFERENCES AVION(NumAvion),
IdPilote smallint REFERENCES PILOTE(IdPilote)
)
Use publi
Page 1 sur 1
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum
|
|