CREATE TABLE gly (
usename VARCHAR(10) NOT NULL,
password VARCHAR(10) NOT NULL,
PRIMARY KEY (usename)
);
INSERT INTO gly (usename, password) VALUES
('admin', 'admin123'),
('manager', 'manager123');
CREATE TABLE cgxx (
ID INT AUTO_INCREMENT,
username VARCHAR(20),
password VARCHAR(20),
name VARCHAR(10),
nn DATETIME,
xb VARCHAR(50),
dh CHAR(11),
dz CHAR(50),
PRIMARY KEY (ID)
);
INSERT INTO cgxx (username, password, name, nn, xb, dh, dz) VALUES
('cg001', 'cg123', '张三', '1980-01-01', '男', '13800138000', '北京市'),
('cg002', 'cg456', '李四', '1985-02-02', '女', '13800138001', '上海市');
CREATE TABLE hp (
hpid CHAR(50) NOT NULL,
dj CHAR(50),
glyid CHAR(50),
rq DATETIME,
lx VARCHAR(50),
PRIMARY KEY (hpid)
);
INSERT INTO hp (hpid, dj, glyid, rq, lx) VALUES
('HP001', '100', 'GYS001', '2023-01-01', '电子产品'),
('HP002', '200', 'GYS002', '2023-02-01', '办公用品');
CREATE TABLE gys (
gyid CHAR(10) NOT NULL,
gys VARCHAR(50),
dh CHAR(11),
yx VARCHAR(14),
dz CHAR(50),
fzr VARCHAR(10),
fzrdh CHAR(11),
yhkzh CHAR(19),
PRIMARY KEY (gyid)
);
INSERT INTO gys (gyid, gys, dh, yx, dz, fzr, fzrdh, yhkzh) VALUES
('GYS001', '供应商A', '13800138002', 'supplierA@example.com', '广州市', '王五', '13800138003', '1234567890123456789');
CREATE TABLE cgjh (
hpid CHAR(20),
mc VARCHAR(20),
dj VARCHAR(20),
sm INT,
rq DATE,
PRIMARY KEY (hpid)
);
INSERT INTO cgjh (hpid, mc, dj, sm, rq) VALUES
('HP001', '产品A', '100', 100, '2023-01-01');