Ver Mensaje Individual
  #4 (permalink)  
Antiguo 21/07/2009, 13:11
Avatar de huesos52
huesos52
Colaborador
 
Fecha de Ingreso: febrero-2009
Ubicación: Manizales - Colombia
Mensajes: 5.980
Antigüedad: 15 años, 2 meses
Puntos: 360
Respuesta: problema con FK

Código sql:
Ver original
  1. CREATE TABLE clientes
  2. (
  3. kx_rut_cliente CHARACTER VARYING(13) NOT NULL,
  4. x_nombre_c CHARACTER VARYING(30),
  5. x_apellido_c CHARACTER VARYING(30),
  6. n_fono_c INTEGER,
  7. CONSTRAINT pk_11 PRIMARY KEY (kx_rut_cliente)
  8. )
  9.  
  10. CREATE TABLE reservas
  11. (
  12. kn_id_reserva INTEGER NOT NULL,
  13. kx_rut_cliente CHARACTER VARYING(13),
  14. n_cantidad_personas INTEGER,
  15. CONSTRAINT reservas_pkey PRIMARY KEY (kn_id_reserva),
  16. CONSTRAINT clientes_fk FOREIGN KEY (kx_rut_cliente) REFERENCES clientes(kx_rut_cliente)
  17. )
__________________
Without data, You are another person with an opinion.
W. Edwads Deming