Upload
diego-castanares-yapur
View
212
Download
0
Embed Size (px)
DESCRIPTION
Probando
Citation preview
BASE DE DATOS TABLA RESPONSABLE
create table responsable(
idr serial primary key not null,
ci character varying(10) unique not null,
ap_paterno character varying(50) not null,
ap_materno character varying(50) null,
nombres character varying(50) not null,
cargo character varying(50) not null,
estado character varying(10) not null
);
alter table responsable alter column ap_paterno set default 'SIN-APELLIDO';
select * from responsable;
alter table responsable
add constraint ck_ci check
(
cast(ci as Integer) between 0 and 9999999999 and length(ci)<=10
);
alter table responsable
add constraint ck_cargo check
(
cargo in ('jefe','encargado sistemas','encargado base de datos','encargado
mantenimiento','help desk')
);
alter table responsable
add constraint ck_estado check
(
estado in ('activo','bloqueado')
);
alter table responsable drop constraint ck_estado;
alter table responsable drop constraint ck_cargo;
select * from responsable;
insert into responsable(ci,ap_paterno,ap_materno,nombres,cargo,estado)
values('8553314','castañares','yapur','diego','help desk','bloqueado');
insert into responsable(ci,ap_paterno,ap_materno,nombres,cargo,estado)
values('1234567','perez','calle','jose','encargado mantenimiento','bloqueado');
insert into responsable(ci,ap_paterno,ap_materno,nombres,cargo,estado)
values('72434113','trigo','paredes','carla','encargado base de datos','bloqueado');