Advertisement
AmbarG

Repaso parcial

Oct 29th, 2024
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. create table nivel(cod_nivel varchar(3), nom_nivel varchar(20), duracion int, primary key(cod_nivel));
  2. create table idioma(cod_idioma varchar(2), nom_idioma varchar(20), precio numeric, cod_nivel varchar(3),
  3.     primary key(cod_idioma), foreign key(cod_nivel) references nivel(cod_nivel));
  4.  
  5. create table profesor (legajo int, nombre varchar(20), primary key(legajo));
  6. create table alumno (dni int, nom_alumno varchar(20),domicilio varchar(20), primary key (dni));
  7. create table clase (dni int, cod_idioma varchar(3), legajo int, dia date, aula int, primary key(dni,cod_idioma,legajo));
  8.  
  9. insert into nivel
  10. values
  11.     ('BAS','basico',6),
  12.     ('INT','intermedio',3),
  13.     ('AVA','avanzado',2);
  14.  
  15. insert into idioma
  16. values
  17.     ('IN','ingles',1200.00,'AVA'),
  18.     ('FR','frances',1100.00,'INT'),
  19.     ('PO','portugues',1000.00,'BAS'),
  20.     ('AL','aleman',1000,'BAS');
  21.  
  22. insert into profesor
  23. values
  24.     (87,'castro'),
  25.     (88,'ferreyra'),
  26.     (89,'juarez');
  27.  
  28. insert into clase
  29. values
  30.     (111,'IN',87,'25-10-2024',13),
  31.     (222,'PO',88,'26-10-2024',11),
  32.     (111,'FR',89,'26-10-2024',12),
  33.     (444,'IN',87,'28-10-2024',11),
  34.     (333,'AL',89,'28-10-2024',13);
  35.  
  36. insert into alumno
  37. values
  38.     (111,'maria rocha','dom111'),
  39.     (222,'juan perez','dom222'),
  40.     (333,'pedro paz','dom333'),
  41.     (444,'rosa quispe','dom444');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement