tabla y consultas en oracle
UNIVERSIDAD NACIONAL FEDERICO VILLARREAL
TRABAJO DE SQL
PROFESOR:
ING.DARIO HUAYTA
AUTORES:CHIPANA CHAVEZ JOHN KEELER
ESCUELA ACADÉMICO-PROFESIONAL
INGENIERIA DE SISTEMAS
CICLO ADELANTO
LIMA, ENERO 27
:::::::creacion de tablas en el entorno de desarrollo oracle sqldeveloper:::::::
CREATE TABLE TB_CLIENTE(
IdCliente varchar(20) not null primary key,
NombreCliente varchar(20),
ApellidoCliente varchar(20),
Direccion varchar(30),
Distritovarchar(20),
Telefono int,
FaceBook varchar(20)
);
CREATE TABLE TB_VENTAS(
IdVentas varchar(20) not null primary key,
Fecha DATE,
serie varchar(20),
IdCliente varchar(20) not null ,descuento varchar(20),
total varchar(20),
foreign key(IdCliente) references tb_cliente(Idcliente)
);
:::::::::::::insertando valores a las tablas para hacer las consultas necesarias::::::::::INSERT INTO tb_cliente(idcliente, nombrecliente, apellidocliente, direccion, distrito, telefono, facebook)
VALUES('001','KEYLER','CHIPANA CHAVEZ','vitarte','ate',234562,'MASNA_001');
INSERTINTO tb_cliente(idcliente, nombrecliente, apellidocliente, direccion, distrito, telefono, facebook)
VALUES('002','piti','pineda pachas','san pedro','calleo',345687,'pito_002');
INSERT INTOtb_ventas(IdVentas,Fecha,serie,IdCliente,descuento,total)
values('0001','22-2-15','727389','001','0.23','234');
INSERT INTO tb_ventas(IdVentas,Fecha,serie,IdCliente,descuento,total)values('0002','20-1-14','768922','002','0.15','300');
:::::::::::::::::::::9 consultas a las tablas:::::::
1.-select * FROM tb_ventas;
2.-SELECT * FROM tb_cliente;
3.-SELECT idCliente,nombreCliente,distrito FROMtb_cliente;
4.-SELECT apellidoCliente,distrito,telefono,facebook FROM tb_cliente;
5.-select idCliente,nombreCliente as "el tigre" from tb_cliente where idCliente='001';
6.-select idVentas,fecha as...
Regístrate para leer el documento completo.