Задавайте вопросы, мы ответим
Вы не зашли.
CREATE DATABASE IF NOT EXISTS baza1;
use baza1;
SET NAMES utf8;
CREATE TABLE IF NOT EXISTS categories
(
id_category INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(45)
);
CREATE TABLE IF NOT EXISTS clients
(
id_client INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
surname VARCHAR(45),
name VARCHAR(45),
telephone integer(45),
userstatus varchar(45)
);
CREATE TABLE IF NOT EXISTS products
(
id_product INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(45),
price double,
description varchar(45),
id_category INT(10),
FOREIGN KEY (id_category)REFERENCES categories (id_category)ON DELETE CASCADE ON UPDATE CASCADE
);
CREATE TABLE IF NOT EXISTS orders
(
id_order INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
id_client INT(45),
oderdate DATE,
number INT(45),
id_product INT(45),
FOREIGN KEY (id_client)REFERENCES clients (id_client)ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (id_product)REFERENCES products (id_product)ON DELETE CASCADE ON UPDATE CASCADE
);
LOAD DATA LOCAL INFILE 'F:/Dist/categories.txt' INTO TABLE categories;
SELECT * FROM categories ;
LOAD DATA LOCAL INFILE 'F:/Dist/clients.txt' INTO TABLE clients LINES TERMINATED BY '\r\n' ;
SELECT * FROM clients ;
LOAD DATA LOCAL INFILE 'F:/Dist/products.txt' INTO TABLE products;
SELECT * FROM products ;
LOAD DATA LOCAL INFILE 'F:/Dist/orders.txt' INTO TABLE orders;
SELECT * FROM orders ;
Есть база надо придумать 2 процедуры или функции можно и то и другое 1) C использованием if 2)C использованием курсоров.
Плз помогите по хранимым процедурам была всего 1 пара. Ниже бэкап заполненая база. Зарание спс.
Неактивен