0% found this document useful (0 votes)
36 views1 page

Crear Tabla de Clientes

The document contains SQL commands to create four database tables: clientes, vendedor, articulos, and orden_de_compra. It also shows examples of inserting data into the vendedor table and updating a phone number in the vendedor table.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views1 page

Crear Tabla de Clientes

The document contains SQL commands to create four database tables: clientes, vendedor, articulos, and orden_de_compra. It also shows examples of inserting data into the vendedor table and updating a phone number in the vendedor table.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

CREAR TABLA DE CLIENTES -> f_ord date not null,

create table clientes ( -> vendedor int not null,

-> nit_clie varchar(20) not null primary key, -> cod_clie varchar(20) not null,

-> nom_clie varchar(50) not null, -> articulo varchar(20) not null,

-> dir_clie varchar(30) not null, -> can_art int not null,

-> tel_clie int not null, -> vr_total int not null,

-> email_clie varchar(40) not null); -> foreign key (vendedor) references
vendedor(cod_ven) on update cascade on

delete cascade,
CREAR TABLA VENDEDOR
-> foreign key (cod_clie) references
create table vendedor( clientes(nit_clie) on update cascade on
-> cod_ven int not null primary key, delete cascade,
-> nom_ven varchar(50) not null, -> foreign key (articulo) references
-> ape_ven varchar(50) not null, articulos(cod_art) on update cascade on

-> dir_ven varchar(30) not null, delete cascade);

-> tel_ven int not null);


INSERTAR DATOS A UNA TABLA (Ejemplo)

CREAR TBLA ARTICULOS mysql> insert into vendedor(cod_ven,


nom_ven, ape_ven, dir_ven, tel_ven) values
create table articulos(
('3379573', 'Wilmer', 'Vasquez', 'Bello',
-> cod_art varchar(20) not null primary key, '3113669454');

-> des_art varchar(50) not null,

-> vr_art int not null); ACTUALIZAR DATOS DE UN CAMPO EN UNA


TABLA

mysql> update vendedor set


CREAR TABLA ORDEN DE COMPRA
tel_ven="4566635" where cod_ven=3379573;
create table orden_de_compra(

-> N_ord int primary key not null


auto_increment,

You might also like