Guest User

Untitled

a guest
May 20th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. create table Estudiante(
  2. cod_est varchar (11) primary key,
  3. nom_est varchar(35),
  4. apell_est varchar(35),
  5. edad smallint,
  6. estrato smallint,
  7. genero char(1),
  8. fecha_nac date
  9. );
  10.  
  11. create table matricula(
  12. cod_est varchar(11),
  13. cod_asig varchar(4),
  14. fechainc date default '1-08-2018',
  15. fechafin date default '30-11-2018',
  16. nota real check(nota>=10 and nota<=50),
  17. primary key (cod_est, cod_asig),
  18. Foreign key (cod_est) REFERENCES Estudiante(cod_est)on delete no action,
  19. foreign key (cod_asig)REFERENCES asignatura(cod_asig)on delete no action
  20. );
  21.  
  22. create table asignatura(
  23. cod_asig varchar(4) primary key not null,
  24. nom_asig varchar(35),
  25. nrocred smallint
  26. );
  27.  
  28. insert into matricula (cod_est,cod_asig,fechainc,fechafin,nota)
  29. values
  30. ('1085','2030',default,default,10),
  31. ('1453','1011',default,default,18);
Add Comment
Please, Sign In to add comment