Advertisement
Guest User

Untitled

a guest
Nov 8th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. CREATE TABLE department_17 (
  2. no_dpto number(1) not null,
  3. id_manager number(4),
  4. primary key (no_dpto),
  5. foreign key (id_manager) references employee_17(id_empleado)
  6.  
  7. );
  8.  
  9. CREATE TABLE employee_17 (
  10. id_empleado number(4) not null,
  11. start_date date,
  12. nombre varchar(50),
  13. apellido varchar(50),
  14. puesto varchar(50),
  15. no_dpto number(1),
  16.  
  17. primary key (id_empleado),
  18. foreign key (no_dpto) references department_17(no_dpto)
  19.  
  20. );
  21.  
  22. CREATE TABLE distribuidor_17 (
  23.  
  24. id_distribuidor number(4) not null,
  25. nombre_distribuidor varchar2(50),
  26. telefono_distribuidor varchar2(50),
  27.  
  28. primary key (id_distribuidor)
  29.  
  30. );
  31.  
  32.  
  33.  
  34. CREATE TABLE productos_17 (
  35.  
  36. id_producto number(8) not null,
  37. id_distribuidor number(4),
  38.  
  39. primary key (id_producto),
  40. foreign key(id_distribuidor) references distribuidor_17(id_distribuidor)
  41.  
  42. );
  43.  
  44.  
  45.  
  46. CREATE TABLE producto_por_distribuidor (
  47.  
  48. id_distribuidor number(4) not null,
  49. nombre_producto varchar2(50),
  50. descripcion varchar2(80),
  51. precio number(6,2),
  52. fecha_de_entrega date,
  53.  
  54. primary key (id_distribuidor),
  55. foreign key(id_distribuidor) references distribuidor_17(id_distribuidor)
  56.  
  57. );
  58.  
  59.  
  60.  
  61. CREATE TABLE cliente_17(
  62.  
  63. id_cliente number(4) not null,
  64. nombre_cliente varchar2(50),
  65. apellido_cliente varchar2(50),
  66. direccion varchar2(80),
  67. correo varchar2(80),
  68. telefono varchar2(50),
  69.  
  70. primary key(id_cliente)
  71.  
  72.  
  73. );
  74.  
  75. CREATE TABLE compra (
  76.  
  77. no_orden number(10) not null,
  78. fecha_de_compra date,
  79. cantidad number(10),
  80. id_producto number(8),
  81. id_cliente number(4),
  82.  
  83. primary key (no_orden),
  84. foreign key(id_producto) references productos_17(id_producto),
  85. foreign key(id_cliente) references cliente_17(id_cliente)
  86.  
  87. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement