
Funciones y Procedimientos
Publicado por Jorge (4 intervenciones) el 07/02/2016 21:20:08
Por favor su ayuda no manejo muy bien el SQL sever y no puedo hacer los siguientes ejercicios.
1.- Crear una función que retorne el nombre de un cliente a partir del ingreso del código
2.- Crear un procedimiento almacenado que permita modificar los datos de un artículo
MUCHO AGRADECERÉ SU APOYO
GRACIAS.
ABAJO ESTOY ENVIANDO LA CREACION DE LAS TABLAS E INGRESO DE DATOS
1.- Crear una función que retorne el nombre de un cliente a partir del ingreso del código
2.- Crear un procedimiento almacenado que permita modificar los datos de un artículo
MUCHO AGRADECERÉ SU APOYO
GRACIAS.
ABAJO ESTOY ENVIANDO LA CREACION DE LAS TABLAS E INGRESO DE DATOS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
CREATE TABLE tblArticulo
(idArti CHAR(4) PRIMARY KEY,
DescripArti VARCHAR(25),
stockArti DECIMAL(2,0),
claseArti VARCHAR(20),
almaArti VARCHAR(1),
precioUArti DECIMAL(7,2));
CREATE TABLE tblCliente
(idClien CHAR(3) PRIMARY KEY,
NombreClien VARCHAR(35),
direcClien VARCHAR(35),
CiudadClien VARCHAR(20),
balanClien DECIMAL(8,2),
limiCreClien DECIMAL(8,2),
idVende CHAR(2),
FOREIGN KEY (idVende) REFERENCES tblVendedor(idVende));
INSERT INTO tblArticulo
(idArti,descripArti,stockArti, claseArti, almaArti, precioUArti)
VALUES
('AT94','Iron', 50,'HW','3',24.95),
('BV06','Home Gym',45,'SG','2',794.95),
('CD52','Microwave', 32,'AP','1', 165.00),
('DL71','Cordless Drill', 21,'HW', '3', 129.95),
('DR93','Gas Rang',8,'AP', '2',495.00),
('DW11', 'Washer',12,'AP','3', 399.99),
('FD21','Stand Mixer',22,'HW','3',159.95),
('KL62','Dryer', 12, 'AP','1',349.95),
('KT03', 'Dishwasher', 8,'AP', '3', 595.00),
('KV29', 'Treadmill', 9,'SG', '2',1390.00);
INSERT INTO tblCliente
(idClien, NombreClien, direcClien, CiudadClien, balanClien, limiCreClien, idVende)
VALUES
('148','Als Apppliance and Sport','2837 Greenway','Fillmore',6550.00, 7500.00 , '20'),
('282','Brookings Direct','3827 Devon','Grove',431.50, 10000.00 , '35'),
('356','Fergurson’s','382 Wildwood','Northfield',5785.00, 7500.00,'65'),
('408','The Everything Shop','1828 Raven','Crystal', 5285.25 , 5000.00, '35'),
('462','Bargains Galore','3829 Central','Grove', 3412.00 , 10000.00 , '65'),
('524','Kline’s','838 Ridgeland','Fillmore',12762.00 , 15000.00 ,'20'),
('608','Jhonson’s Department Store','372 Oxford','Sheldon',2106.00 , 10000.00 ,'65'),
('687','Lee’s Sport and Appliance','282 Evergreen','Atonville',2851.00 , 5000.00 , '35'),
('725','Deerfield’s Four Seasons','282 Columbia','Sheldon',248.00 , 7500.00 , '35'),
('842','All Season','28 Lakeview','Grove',8221.00,7500.00, '20');
Valora esta pregunta


0