Sql E Comando Dml
Dissertações: Sql E Comando Dml. Pesquise 862.000+ trabalhos acadêmicosPor: fabianolima • 4/4/2014 • 309 Palavras (2 Páginas) • 420 Visualizações
create table tb_conc_peda
(
id_conc_peda integer not null,
ds_conc_peda varchar(200) not null,
cd_cnpj varchar(14) not null,
nm_tipo_logr varchar(50) null,
nm_logr varchar(80) null,
nm_bair varchar(20) null,
nm_mun varchar(35) null,
sg_uf varchar(2) null,
nr_cep varchar(9) null,
cd_ddd_cont integer null,
nr_tele_cont varchar(11) null,
dt_acao integer not null,
primary key (id_conc_peda),
)
select * from tb_conc_peda
delete tb_conc_peda
where id_conc_peda=3
update "tb_conc_peda"
set ds_conc_peda ='ATPS-LPBD2014'
where id_conc_peda =1
insert tb_conc_peda(id_conc_peda,ds_conc_peda,cd_cnpj,nm_tipo_logr,nm_logr,nm_bair,nm_mun,sg_uf,nr_cep,cd_ddd_cont,nr_tele_cont,dt_acao)
values
(1,'ccr','123457891/0001','rodovia','raposo tavares','metalurgicos','osasco','sp','05574300', 11, '3781-8923',25042014)
insert tb_conc_peda(id_conc_peda,ds_conc_peda,cd_cnpj,nm_tipo_logr,nm_logr,nm_bair,nm_mun,sg_uf,nr_cep,cd_ddd_cont,nr_tele_cont,dt_acao)
values
(2,'autoban','123456789/0001','rodovia','rod. anhanguera','anahnguera','jundiai','sp','03265-300', 11, '3974-3593',25042014)
insert tb_conc_peda(id_conc_peda,ds_conc_peda,cd_cnpj,nm_tipo_logr,nm_logr,nm_bair,nm_mun,sg_uf,nr_cep,cd_ddd_cont,nr_tele_cont,dt_acao)
values
(3,'ecovias','934470402/0001','rodovia','rod. achieta','riacho grande','são bernado do campo','sp','02391-300', 11, '4539-387',25042014)
insert tb_conc_peda(id_conc_peda,ds_conc_peda,cd_cnpj,nm_tipo_logr,nm_logr,nm_bair,nm_mun,sg_uf,nr_cep,cd_ddd_cont,nr_tele_cont,dt_acao)
values
(4,'viaoeste','573270402/0001','rodovia','rod. castelo branco','alphaville','barueiri','sp','07316-300', 11, '4354_2601',25042014)
insert tb_conc_peda(id_conc_peda,ds_conc_peda,cd_cnpj,nm_tipo_logr,nm_logr,nm_bair,nm_mun,sg_uf,nr_cep,cd_ddd_cont,nr_tele_cont,dt_acao)
values
(5,'autopista','085430402/0001','rodovia','rod. regis bittencourt','fazenda vitoria','são lourenço da serra','sp','09543-002', 11, '4701-5343',25042014)
create table tb_prac_peda
(
id_prac_peda integer not null,
ds_prac_peda varchar(200) not null,
nm_mun varchar(25) not null,
sg_uf varchar(2)not null,
id_conc_peda numeric not null,
dt_acao integer not null,
primary key (id_conc_peda)
)
insert tb_prac_peda(id_prac_peda,ds_prac_peda,nm_mun,sg_uf,id_conc_peda,dt_acao)
values
(1,'ATPS-LPBD2014','osasco','sp',1,25042014)
insert tb_prac_peda(id_prac_peda,ds_prac_peda,nm_mun,sg_uf,id_conc_peda,dt_acao)
values
(2,'autoban','jundiai','sp',2,25042014)
insert tb_prac_peda(id_prac_peda,ds_prac_peda,nm_mun,sg_uf,id_conc_peda,dt_acao)
values
(3,'ecovias','são bernado do campo','sp',3,25042014)
insert tb_prac_peda(id_prac_peda,ds_prac_peda,nm_mun,sg_uf,id_conc_peda,dt_acao)
values
(4,'viaoeste','barueiri','sp',4,25042014)
insert tb_prac_peda(id_prac_peda,ds_prac_peda,nm_mun,sg_uf,id_conc_peda,dt_acao)
values
(5,'autopista','são lourenço da serra','sp',5,25042014)
delete tb_prac_peda
where id_prac_peda=1
select * from tb_prac_peda
create table cate_veic_peda
(
id_cate_veic_peda numeric not null,
ds_cate_veic_peda varchar(200) not null,
nr_eixo_veic numeric not null,
dt_acao integer not null,
primary key (id_cate_veic_peda)
)
insert cate_veic_peda(id_cate_veic_peda,ds_cate_veic_peda,nr_eixo_veic,dt_acao)
values
(1,'carreta',5,25042014)
...