Code for table:
[code]/*
Navicat MySQL Data Transfer
Source Server : bdihmi
Source Server Version : 50137
Source Host : srv-bdihmi:3306
Source Database : TestDB
Target Server Type : MYSQL
Target Server Version : 50137
File Encoding : 65001
Date: 2011-06-01 13:47:02
*/
SET FOREIGN_KEY_CHECKS=0;
– Table structure for tbl_invtransactions
DROP TABLE IF EXISTS tbl_invtransactions
;
CREATE TABLE tbl_invtransactions
(
id_invtransaction
int(11) NOT NULL AUTO_INCREMENT,
id_employee
int(11) NOT NULL,
id_invtranstype
int(11) NOT NULL,
id_ourmaterial
int(11) NOT NULL,
id_location
int(11) NOT NULL,
qty
int(11) NOT NULL,
date
datetime NOT NULL,
PRIMARY KEY (id_invtransaction
),
KEY fk_locations_invtransactions
(id_location
),
KEY fk_ourmaterials_invtransactions
(id_ourmaterial
),
KEY fk_employees_invtransactions
(id_employee
),
KEY fk_invtranstypes_invtransactions
(id_invtranstype
),
CONSTRAINT fk_employees_invtransactions
FOREIGN KEY (id_employee
) REFERENCES tbl_employees
(id_employee
) ON UPDATE CASCADE,
CONSTRAINT fk_invtranstypes_invtransactions
FOREIGN KEY (id_invtranstype
) REFERENCES tbl_invtranstypes
(id_invtranstype
) ON UPDATE CASCADE,
CONSTRAINT fk_locations_invtransactions
FOREIGN KEY (id_location
) REFERENCES tbl_locations
(id_location
) ON UPDATE CASCADE,
CONSTRAINT fk_ourmaterials_invtransactions
FOREIGN KEY (id_ourmaterial
) REFERENCES tbl_ourmaterials
(id_ourmaterial
) ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=77 DEFAULT CHARSET=latin1;
– Records of tbl_invtransactions
INSERT INTO tbl_invtransactions
VALUES (‘64’, ‘464’, ‘3’, ‘38’, ‘15’, ‘100’, ‘2011-05-26 14:45:16’);
INSERT INTO tbl_invtransactions
VALUES (‘65’, ‘464’, ‘2’, ‘38’, ‘15’, ‘10’, ‘2011-05-26 14:46:19’);
INSERT INTO tbl_invtransactions
VALUES (‘66’, ‘464’, ‘2’, ‘38’, ‘15’, ‘10’, ‘2011-05-26 14:46:37’);
INSERT INTO tbl_invtransactions
VALUES (‘67’, ‘464’, ‘2’, ‘38’, ‘15’, ‘10’, ‘2011-05-26 14:47:00’);
INSERT INTO tbl_invtransactions
VALUES (‘68’, ‘464’, ‘1’, ‘38’, ‘15’, ‘15’, ‘2011-05-26 14:47:19’);
INSERT INTO tbl_invtransactions
VALUES (‘69’, ‘464’, ‘3’, ‘38’, ‘12’, ‘200’, ‘2011-05-27 11:24:27’);
INSERT INTO tbl_invtransactions
VALUES (‘70’, ‘464’, ‘2’, ‘38’, ‘12’, ‘10’, ‘2011-05-27 11:25:34’);
INSERT INTO tbl_invtransactions
VALUES (‘71’, ‘464’, ‘2’, ‘38’, ‘12’, ‘7’, ‘2011-05-27 11:26:45’);
INSERT INTO tbl_invtransactions
VALUES (‘72’, ‘464’, ‘1’, ‘38’, ‘12’, ‘2’, ‘2011-05-27 11:27:00’);
INSERT INTO tbl_invtransactions
VALUES (‘73’, ‘464’, ‘3’, ‘38’, ‘15’, ‘300’, ‘2011-05-27 11:30:08’);
INSERT INTO tbl_invtransactions
VALUES (‘74’, ‘464’, ‘2’, ‘38’, ‘15’, ‘73’, ‘2011-05-27 11:30:36’);
INSERT INTO tbl_invtransactions
VALUES (‘75’, ‘464’, ‘2’, ‘38’, ‘15’, ‘23’, ‘2011-05-27 11:30:58’);
INSERT INTO tbl_invtransactions
VALUES (‘76’, ‘464’, ‘1’, ‘38’, ‘15’, ‘6’, ‘2011-05-27 11:31:09’);
[/code]