DataBase Creation


SUBMITTED BY: Guest

DATE: Nov. 21, 2013, 12:13 a.m.

FORMAT: Text only

SIZE: 2.0 kB

HITS: 670

  1. create database VolAvion2
  2. --fichier données
  3. on primary (
  4. name='VolAvion2_Data',
  5. filename='C:\Users\EL ABOUSSI\Desktop\Projects\My Projects\Les Base De Donnees\DB_VolAvion2.mdf',
  6. size=10MB,
  7. maxsize=50MB,
  8. filegrowth=5%)
  9. --fichier journal
  10. log on(
  11. name='VolAvion2_Log',
  12. filename='C:\Users\EL ABOUSSI\Desktop\Projects\My Projects\Les Base De Donnees\DB_VolAvion2.ldf',
  13. size=10MB,
  14. maxsize=50MB,
  15. filegrowth=5%)
  16. use volavion2
  17. create table AffectVol(
  18. NumPas smallint not null,
  19. vol smallint not null,
  20. Datevol datetime not null,
  21. NumPlace smallint not null,
  22. Prix money,
  23. constraint pk_affectvol primary key(NumPas,vol)
  24. );
  25. create table Avion(
  26. NumAv smallint not null,
  27. Marque varchar(20)not null,
  28. TypeAvion varchar(20)not null,
  29. Capacite smallint not null,
  30. Localisation varchar(20)not null,
  31. DateMiseEnService datetime,
  32. constraint pk_avion primary key (NumAv)
  33. );
  34. create table Passager(
  35. NumPas int not null,
  36. Nom varchar(20)not null,
  37. Prenom varchar(20)not null,
  38. Ville varchar(20) not null,
  39. constraint pk_passager primary key (NumPas)
  40. );
  41. create table Pilote(
  42. NumPil smallint not null,
  43. Nompil varchar(20)not null,
  44. CodePostal char(5)not null,
  45. Villepil varchar(20)not null,
  46. DateDeNaiss datetime,
  47. DateDbActivite datetime,
  48. DateFinActivite datetime,
  49. SalaireBrut money,
  50. constraint pk_pilote primary key (NumPil)
  51. );
  52. create table Vol(
  53. NumVol smallint not null,
  54. NumAv smallint not null,
  55. NumPil smallint not null,
  56. VilleDepart varchar(20)not null,
  57. VilleArrivee varchar(20) not null,
  58. HeureDprt decimal(5,2)not null,
  59. HeureArrivee decimal(5,2) not null,
  60. constraint pk_vol primary key (NumVol),
  61. constraint fk_vol_avion foreign key (NumAv)references Avion(NumAv),
  62. constraint fk_vol_pilote foreign key (NumPil)references Pilote(NumPil)
  63. );

comments powered by Disqus