I need to delete the idcliente
, nombre
and apellido
of the table cliente
, but it will not let me delete it because it is related to the ubicacion
table. For that, I also want to eliminate all records of that client id in all the tables.
This is the structure of the tables:
create table cliente(
idcliente varchar(50) primary key,
nombre varchar(50),
apellido varchar(50)
)
create table ubicacion(
idubicacion varchar(50) primary key,
pais varchar(50),
ciudad varchar(50),
fkcliente varchar(50)
)
create table venta(
idproducto varchar(50),
producto varchar(50),
fkubicacion varchar(50)
)
alter table ubicacion
add constraint fkcliente_idcliente
foreign key (fkcliente) references cliente(idcliente)
alter table venta
add constraint fkubicacion_idubicacion
foreign key (fkubicacion) references ubicacion(idubicacion)