Ev 05
use leasing
create table distrito (
cod_dist int not null primary key ,
distrito varchar(40) not null
)
create table provincia(
cod_prov int not null primary key,provincia varchar(40) not null
)
create table departamento (
cod_dep int not null primary key,
departamento varchar(40)not null
)
create table pais(
cod_pais int not null primary key,pais varchar(40)not null
)
create table proveedor(
cod_prov int not null primary key,
prod_prov varchar (20) not null,
nom_prov varchar (20) not null,
pais_prov varchar(10) not null,
monto_anual_prov decimal not null,
costo_prov money not null,
form_pago_prov varchar (10) not null
)
create table entidad (
cod_ent int not null primary key,razon_soc_ent varchar(40) not null,
ruc_ent int not null,
nom_ent varchar(40) not null,
sbs_ent varchar(40) null,
dir_ent varchar(40) not null,
cod_dist int not null foreign keyreferences distrito,
distrito varchar(40) not null,
cod_prov int not null foreign key references proveedor,
cod_dep int not null foreign key references departamento,
cod_pais int not null foreign keyreferences pais,
telf_ent char(9) not null,
fax_ent char(9) null,
web_ent varchar(40) null,
capi_soc_ent varchar(40) null,
pat_ent varchar(40) null
)
create table representante (cod_repre int not null primary key,
nom1_repre varchar(20) not null,
nom2_repre varchar(20) not null,
apepat_repre varchar(20) not null,
apemat_repre varchar(20) not null,
gene_repre varchar(1)not null,
tipodoc_repre varchar(20) not null,
numiden_repre char(8) not null,
lug_ex_repre varchar(40) null,
fech_exp_repre datetime not null,
fech_nac_repre datetime not null,lugar_nac_repre varchar(40) not null,
prof_repre varchar(20) not null,
dir_repre varchar(40) not null,
cod_dist int not null foreign key references distrito,
cod_prov int not null foreign key references...
Regístrate para leer el documento completo.