达梦8-达梦数据的示例用户和表

1、示例库说明:

创建达梦数据的示例用户和表,导入测试数据。

在完成达梦数据库的安装之后,在/opt/dmdbms/samples/instance_script目录下有用于创建示例用户的SQL文件。samples目录前的路径根据实际安装情况进行修改,本文将达梦数据库软件安装到了/opt/dmdbms目录下。

 在/opt/dmdbms/samples/instance_script目录下有两个示例库bookshop和dmhr。 

示例库 BOOKSHOP 模拟武汉代理图书的某销售公司,该公司欲建立在线购物平台来拓展其代理产品的销售渠道,该在线购物平台支持网上产品信息浏览、订购等服务(仅限同城内销售及送货)。该销售公司的雇员、部门信息、业务方案等是所有实例的基础。

示例库DMHR模拟武汉达梦数据库有限公司人力资源管理系统,该示例库创建一个模式DMHR和一个表空间DMHR,在DMHR模式下创建REGION、CITY、LOCATION、DEPARTMENT、JOB、EMPLOYEE、JOB_HISTORY等7张表,并插入数据。

在相应的示例库目录内有对应的执行sql脚本,可以直接在disql内按顺序运行即可创建和插入数据。但在这之前需要了解当前数据库的字符集。

SELECT '字符集',CASE SF_GET_UNICODE_FLAG() WHEN '0' THEN 'GBK18030' WHEN '1' then 'UTF-8' when '2' then 'EUC-KR' end

根据数据库的字符集进入相应的目录。执行相应的脚本。

进入disql交互界面,执行脚本。使用[start]命令。

使用绝对路径

start /opt/dmdbms/samples/instance_script/bookshop/UTF-8/1-CREATESCHEMA.sql

如果不想输出信息,执行一下命令:

--不显示执行的SQL
set echo off
--不显示执行脚本影响的行数
set feedback off
--不每个 SQL 语句花费的执行时间
set timing off 
--不显示标题
set heading off
--不显示行号
set lineshow off

2、示例库脚本-bookshop

该示例库包含脚本:

1-CREATESCHEMA.sql
2-CREATETABLE.sql
3-INSERTSQL.sql

2.1-CREATESCHEMA.sql

--创建表空间
CREATE TABLESPACE BOOKSHOP DATAFILE 'BOOKSHOP.DBF' size 150;
/--创建模式
CREATE SCHEMA RESOURCES;
/
CREATE SCHEMA PERSON;
/
CREATE SCHEMA SALES;
/
CREATE SCHEMA PRODUCTION;
/
CREATE SCHEMA PURCHASING;
/
CREATE SCHEMA OTHER;
/

2.2-CREATETABLE.sql

--创建表
--CREATE PERSON.ADDRESS
create table PERSON.ADDRESS
(ADDRESSID INT IDENTITY(1,1) PRIMARY KEY,ADDRESS1 VARCHAR(60) NOT NULL,ADDRESS2 VARCHAR(60),CITY VARCHAR(30) NOT NULL,POSTALCODE VARCHAR(15) NOT NULL
) STORAGE (on BOOKSHOP);--CREATE PERSON.ADDRESS_TYPE
create table PERSON.ADDRESS_TYPE
(ADDRESS_TYPEID INT IDENTITY(1,1) PRIMARY KEY,NAME VARCHAR(50) NOT NULL
) STORAGE (on BOOKSHOP);--CREATE PERSON.PERSON
CREATE TABLE PERSON.PERSON
(PERSONID  INT IDENTITY(1,1) CLUSTER PRIMARY KEY,SEX CHAR(1) NOT NULL,NAME VARCHAR(50) NOT NULL,EMAIL VARCHAR(50),PHONE VARCHAR(25)
) STORAGE (on BOOKSHOP);--create PERSON.PERSON_TYPE
create table PERSON.PERSON_TYPE
(PERSON_TYPEID INT IDENTITY(1,1) PRIMARY KEY,NAME VARCHAR(256) NOT NULL
) STORAGE (on BOOKSHOP);--create RESOURCES.DEPARTMENT
create table RESOURCES.DEPARTMENT
(DEPARTMENTID INT IDENTITY(1,1) PRIMARY KEY,NAME VARCHAR(50) NOT NULL
) STORAGE (on BOOKSHOP);--create RESOURCES.EMPLOYEE
create table RESOURCES.EMPLOYEE
(EMPLOYEEID INT IDENTITY(1,1) PRIMARY KEY ,NATIONALNO VARCHAR(18) NOT NULL,PERSONID INT NOT NULL REFERENCES PERSON.PERSON(PERSONID),LOGINID VARCHAR(256) NOT NULL,TITLE VARCHAR(50) NOT NULL,MANAGERID INT,BIRTHDATE DATE NOT NULL,MARITALSTATUS CHAR(1) NOT NULL,PHOTO IMAGE,HAIRDATE DATE NOT NULL,SALARY DEC(19,4) NOT NULL
) STORAGE (on BOOKSHOP);--create RESOURCES.EMPLOYEE_ADDRESS
create table RESOURCES.EMPLOYEE_ADDRESS
(ADDRESSID INT NOT NULL REFERENCES PERSON.ADDRESS(ADDRESSID),EMPLOYEEID INT NOT NULL REFERENCES RESOURCES.EMPLOYEE(EMPLOYEEID)
) STORAGE (on BOOKSHOP);--create RESOURCES.EMPLOYEE_DEPARTMENT
create table RESOURCES.EMPLOYEE_DEPARTMENT
(EMPLOYEEID INT NOT NULL REFERENCES RESOURCES.EMPLOYEE(EMPLOYEEID),DEPARTMENTID INT NOT NULL REFERENCES RESOURCES.DEPARTMENT(DEPARTMENTID),STARTDATE DATE NOT NULL,ENDDATE DATE
) STORAGE (on BOOKSHOP);--create SALES.CUSTOMER
create table SALES.CUSTOMER
(CUSTOMERID INT IDENTITY(1,1) PRIMARY KEY,PERSONID INT NOT NULL REFERENCES PERSON.PERSON(PERSONID)
) STORAGE (on BOOKSHOP);--create SALES.CUSTOMER_ADDRESS
create table SALES.CUSTOMER_ADDRESS
(CUSTOMERID INT REFERENCES SALES.CUSTOMER(CUSTOMERID),ADDRESSID INT REFERENCES PERSON.ADDRESS(ADDRESSID),ADDRESS_TYPEID INT NOT NULL REFERENCES PERSON.ADDRESS_TYPE(ADDRESS_TYPEID),primary key (CUSTOMERID,ADDRESSID)
) STORAGE (on BOOKSHOP);--create PRODUCTION.PRODUCT_CATEGORY
create table PRODUCTION.PRODUCT_CATEGORY
(PRODUCT_CATEGORYID INT IDENTITY(1,1) PRIMARY KEY,NAME VARCHAR(50) NOT NULL
) STORAGE (on BOOKSHOP);--create PRODUCTION.PRODUCT_SUBCATEGORY
create table PRODUCTION.PRODUCT_SUBCATEGORY
(PRODUCT_SUBCATEGORYID INT IDENTITY(1,1) PRIMARY KEY,PRODUCT_CATEGORYID INT NOT NULL ,NAME VARCHAR(50) NOT NULL
) STORAGE (on BOOKSHOP);--create PRODUCTION.PRODUCT
create table PRODUCTION.PRODUCT
(PRODUCTID INT IDENTITY(1,1) PRIMARY KEY,NAME VARCHAR(100) NOT NULL,AUTHOR VARCHAR(25) NOT NULL,PUBLISHER VARCHAR(50) NOT NULL,PUBLISHTIME DATE NOT NULL,PRODUCT_SUBCATEGORYID INT NOT NULL REFERENCES PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_SUBCATEGORYID),PRODUCTNO VARCHAR(25) NOT NULL,SATETYSTOCKLEVEL SMALLINT NOT NULL,ORIGINALPRICE DEC(19,4) NOT NULL,NOWPRICE DEC(19,4) NOT NULL,DISCOUNT DECIMAL(2,1) NOT NULL,DESCRIPTION TEXT,PHOTO IMAGE,TYPE VARCHAR(5),PAPERTOTAL INT,WORDTOTAL INT,SELLSTARTTIME DATE NOT NULL,SELLENDTIME DATE,UNIQUE(PRODUCTNO)
) STORAGE (on BOOKSHOP);--create PRODUCTION.LOCATION
create table PRODUCTION.LOCATION
(LOCATIONID INT IDENTITY(1,1) PRIMARY KEY,PRODUCT_SUBCATEGORYID INT NOT NULL REFERENCES PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_SUBCATEGORYID),NAME VARCHAR(50) NOT NULL
) STORAGE (on BOOKSHOP);--create PRODUCTION.PRODUCT_INVENTORY
create table PRODUCTION.PRODUCT_INVENTORY
(PRODUCTID INT NOT NULL REFERENCES PRODUCTION.PRODUCT(PRODUCTID),LOCATIONID INT NOT NULL REFERENCES PRODUCTION.LOCATION(LOCATIONID),QUANTITY INT NOT NULL
) STORAGE (on BOOKSHOP);--create PRODUCTION.PRODUCT_REVIEW
create table PRODUCTION.PRODUCT_REVIEW
(PRODUCT_REVIEWID INT IDENTITY(1,1) PRIMARY KEY, PRODUCTID INT NOT NULL REFERENCES PRODUCTION.PRODUCT(PRODUCTID),NAME VARCHAR(50) NOT NULL,REVIEWDATE DATE NOT NULL,EMAIL VARCHAR(50) NOT NULL,RATING INT NOT NULL CHECK(RATING IN(1,2,3,4,5)),COMMENTS TEXT
) STORAGE (on BOOKSHOP);--create PURCHASING.VENDOR
create table PURCHASING.VENDOR
(VENDORID INT IDENTITY(1,1) PRIMARY KEY,ACCOUNTNO VARCHAR(15) NOT NULL,NAME VARCHAR(50) NOT NULL,ACTIVEFLAG BIT NOT NULL,WEBURL VARCHAR(1024),CREDIT INT NOT NULL CHECK(CREDIT IN(1,2,3,4,5))
) STORAGE (on BOOKSHOP);--create PURCHASING.VENDOR_ADDRESS
create table PURCHASING.VENDOR_ADDRESS
(VENDORID INT NOT NULL REFERENCES PURCHASING.VENDOR(VENDORID),ADDRESSID INT NOT NULL REFERENCES PERSON.ADDRESS(ADDRESSID),ADDRESS_TYPEID INT NOT NULL REFERENCES PERSON.ADDRESS_TYPE(ADDRESS_TYPEID),primary key (VENDORID,ADDRESSID)
) STORAGE (on BOOKSHOP);--create PURCHASING.VENDOR_PERSON
create table PURCHASING.VENDOR_PERSON
(VENDORID INT NOT NULL REFERENCES PURCHASING.VENDOR(VENDORID), PERSONID INT NOT NULL REFERENCES PERSON.PERSON(PERSONID),PERSON_TYPEID INT NOT NULL REFERENCES PERSON.PERSON_TYPE(PERSON_TYPEID),primary key (VENDORID,PERSONID)
) STORAGE (on BOOKSHOP);--create PRODUCTION.PRODUCT_VENDOR
create table PRODUCTION.PRODUCT_VENDOR
(PRODUCTID INT REFERENCES PRODUCTION.PRODUCT(PRODUCTID),VENDORID INT REFERENCES PURCHASING.VENDOR(VENDORID),STANDARDPRICE DEC(19,4) NOT NULL,LASTPRICE DEC(19,4),LASTDATE DATE,MINQTY INT NOT NULL,MAXQTY INT NOT NULL,ONORDERQTY INT,PRIMARY KEY(PRODUCTID,VENDORID)
) STORAGE (on BOOKSHOP);--create SALES.SALESPERSON
create table SALES.SALESPERSON
(SALESPERSONID INT IDENTITY(1,1) PRIMARY KEY,EMPLOYEEID INT NOT NULL REFERENCES RESOURCES.EMPLOYEE(EMPLOYEEID),SALESTHISYEAR DEC(19,4) NOT NULL,SALESLASTYEAR DEC(19,4) NOT NULL
) STORAGE (on BOOKSHOP);--create PURCHASING.PURCHASEORDER_HEADER
create table PURCHASING.PURCHASEORDER_HEADER
(PURCHASEORDERID INT IDENTITY(1,1) PRIMARY KEY,ORDERDATE DATE NOT NULL,STATUS TINYINT NOT NULL CHECK(STATUS IN(0,1,2,3)),EMPLOYEEID INT NOT NULL REFERENCES RESOURCES.EMPLOYEE(EMPLOYEEID),VENDORID INT NOT NULL REFERENCES PURCHASING.VENDOR(VENDORID),SHIPMETHOD VARCHAR(50) NOT NULL,SUBTOTAL DEC(19,4) NOT NULL,TAX DEC(19,4) NOT NULL,FREIGHT DEC(19,4) NOT NULL,TOTAL DEC(19,4) NOT NULL
) STORAGE (on BOOKSHOP);--create PURCHASING.PURCHASEORDER_DETAIL
create table PURCHASING.PURCHASEORDER_DETAIL
(PURCHASEORDERID INT NOT NULL REFERENCES PURCHASING.PURCHASEORDER_HEADER(PURCHASEORDERID),PURCHASEORDER_DETAILID INT NOT NULL,DUEDATE DATE NOT NULL,PRODUCTID INT NOT NULL REFERENCES PRODUCTION.PRODUCT(PRODUCTID),ORDERQTY INT NOT NULL,PRICE DEC(19,4) NOT NULL,SUBTOTAL DEC(19,4) NOT NULL,RECEIVEDQTY INT NOT NULL,REJECTEDQTY INT NOT NULL,STOCKEDQTY INT NOT NULL,PRIMARY KEY(PURCHASEORDERID,PURCHASEORDER_DETAILID)
) STORAGE (on BOOKSHOP);--create SALES.SALESORDER_HEADER
create table SALES.SALESORDER_HEADER
(SALESORDERID INT IDENTITY(1,1) PRIMARY KEY,ORDERDATE DATE NOT NULL,DUEDATE DATE NOT NULL,STATUS TINYINT NOT NULL CHECK(STATUS IN(0,1,2,3,4,5)),ONLINEORDERFLAG BIT NOT NULL,CUSTOMERID INT NOT NULL REFERENCES SALES.CUSTOMER(CUSTOMERID),SALESPERSONID INT NOT NULL REFERENCES SALES.SALESPERSON(SALESPERSONID),ADDRESSID INT NOT NULL REFERENCES PERSON.ADDRESS(ADDRESSID),SHIPMETHOD BIT NOT NULL,SUBTOTAL DEC(19,4) NOT NULL,FREIGHT DEC(19,4) NOT NULL,TOTAL DEC(19,4) NOT NULL,COMMENTS TEXT
) STORAGE (on BOOKSHOP);--create SALES.SALESORDER_DETAIL
create table SALES.SALESORDER_DETAIL
(SALESORDERID INT NOT NULL REFERENCES SALES.SALESORDER_HEADER(SALESORDERID),SALESORDER_DETAILID INT NOT NULL,CARRIERNO VARCHAR(25) NOT NULL,PRODUCTID INT NOT NULL REFERENCES PRODUCTION.PRODUCT(PRODUCTID),ORDERQTY INT NOT NULL,LINETOTAL DEC(19,4) NOT NULL,PRIMARY KEY(SALESORDERID,SALESORDER_DETAILID)
) STORAGE (on BOOKSHOP);--create OTHER.DEPARTMENT
CREATE TABLE OTHER.DEPARTMENT 
(high_dep VARCHAR(50),dep_name VARCHAR(50)
) STORAGE (on BOOKSHOP);--create OTHER.EMPSALARY
CREATE TABLE OTHER.EMPSALARY
(ename char(10), empno numeric(4), sal numeric(4)
) STORAGE (on BOOKSHOP);--create OTHER.ACCOUNT
CREATE TABLE OTHER.ACCOUNT
("ACCOUNT_ID" INTEGER NOT NULL,"BAL" DEC(10,2),PRIMARY KEY("ACCOUNT_ID")
) STORAGE (on BOOKSHOP);--create OTHER.ACTIONS
CREATE TABLE OTHER.ACTIONS
("ACCOUNT_ID" INTEGER NOT NULL,"OPER_TYPE" CHAR(1),"NEW_VALUE" DEC(10,2),"STATUS" VARCHAR(50),PRIMARY KEY("ACCOUNT_ID")
) STORAGE (on BOOKSHOP);--create OTHER.READER 
CREATE TABLE OTHER.READER 
(READER_ID	INT PRIMARY KEY,NAME		VARCHAR(30),AGE		SMALLINT,GENDER		CHAR,MAJOR		VARCHAR(30)
) STORAGE (on BOOKSHOP);--create OTHER.READERAUDIT 
CREATE TABLE OTHER.READERAUDIT 
(change_type	CHAR NOT NULL,changed_by	VARCHAR(8) NOT NULL,op_timestamp	DATE NOT NULL,old_reader_id	INT,old_name	VARCHAR(30),old_age		SMALLINT,old_gender	CHAR,old_major	VARCHAR(30),new_reader_id	INT,new_name	VARCHAR(30),new_age		SMALLINT,new_gender	CHAR,new_major	VARCHAR(30)
) STORAGE (on BOOKSHOP);--create OTHER.DEPTTAB 
CREATE TABLE OTHER.DEPTTAB 
(     Deptno  INT PRIMARY KEY,Dname  VARCHAR(15),Loc  VARCHAR(25)
) STORAGE (on BOOKSHOP);--create OTHER.EMPTAB 
CREATE TABLE OTHER.EMPTAB 
(Empno  INT PRIMARY KEY,Ename  VARCHAR(15) NOT NULL,Job  VARCHAR(10),Sal  FLOAT,Deptno  INT
) STORAGE (on BOOKSHOP);--create OTHER.SALGRADE 
CREATE TABLE OTHER.SALGRADE
(Losal		   FLOAT,	Hisal		   FLOAT,	Job_classification VARCHAR(10)
) STORAGE (on BOOKSHOP);--create OTHER.COMPANYHOLIDAYS 
CREATE TABLE OTHER.COMPANYHOLIDAYS
(Holiday  DATE
) STORAGE (on BOOKSHOP);

2.3-INSERTSQL.sql 

--INSERT ADDRESS
INSERT INTO PERSON.ADDRESS(ADDRESS1,ADDRESS2,CITY,POSTALCODE) VALUES('洪山区369号金地太阳城56-1-202','','武汉市洪山区','430073');
INSERT INTO PERSON.ADDRESS(ADDRESS1,ADDRESS2,CITY,POSTALCODE) VALUES('洪山区369号金地太阳城57-2-302','','武汉市洪山区','430073');
INSERT INTO PERSON.ADDRESS(ADDRESS1,ADDRESS2,CITY,POSTALCODE) VALUES('青山区青翠苑1号','','武汉市青山区','430080');
INSERT INTO PERSON.ADDRESS(ADDRESS1,ADDRESS2,CITY,POSTALCODE) VALUES('武昌区武船新村115号','','武汉市武昌区','430063');
INSERT INTO PERSON.ADDRESS(ADDRESS1,ADDRESS2,CITY,POSTALCODE) VALUES('汉阳大道熊家湾15号','','武汉市汉阳区','430050');
INSERT INTO PERSON.ADDRESS(ADDRESS1,ADDRESS2,CITY,POSTALCODE) VALUES('洪山区保利花园50-1-304','','武汉市洪山区','430073');
INSERT INTO PERSON.ADDRESS(ADDRESS1,ADDRESS2,CITY,POSTALCODE) VALUES('洪山区保利花园51-1-702','','武汉市洪山区','430073');
INSERT INTO PERSON.ADDRESS(ADDRESS1,ADDRESS2,CITY,POSTALCODE) VALUES('洪山区关山春晓51-1-702','','武汉市洪山区','430073');
INSERT INTO PERSON.ADDRESS(ADDRESS1,ADDRESS2,CITY,POSTALCODE) VALUES('江汉区发展大道561号','','武汉市江汉区','430023');
INSERT INTO PERSON.ADDRESS(ADDRESS1,ADDRESS2,CITY,POSTALCODE) VALUES('江汉区发展大道555号','','武汉市江汉区','430023');
INSERT INTO PERSON.ADDRESS(ADDRESS1,ADDRESS2,CITY,POSTALCODE) VALUES('武昌区武船新村1号','','武汉市武昌区','430063');
INSERT INTO PERSON.ADDRESS(ADDRESS1,ADDRESS2,CITY,POSTALCODE) VALUES('江汉区发展大道423号','','武汉市江汉区','430023');
INSERT INTO PERSON.ADDRESS(ADDRESS1,ADDRESS2,CITY,POSTALCODE) VALUES('洪山区关山春晓55-1-202','','武汉市洪山区','430073');
INSERT INTO PERSON.ADDRESS(ADDRESS1,ADDRESS2,CITY,POSTALCODE) VALUES('洪山区关山春晓10-1-202','','武汉市洪山区','430073');
INSERT INTO PERSON.ADDRESS(ADDRESS1,ADDRESS2,CITY,POSTALCODE) VALUES('洪山区关山春晓11-1-202','','武汉市洪山区','430073');
INSERT INTO PERSON.ADDRESS(ADDRESS1,ADDRESS2,CITY,POSTALCODE) VALUES('洪山区光谷软件园C1_501','','武汉市洪山区','430073');--INSERT ADDRESS_TYPE
INSERT INTO PERSON.ADDRESS_TYPE(NAME) VALUES('发货地址');
INSERT INTO PERSON.ADDRESS_TYPE(NAME) VALUES('送货地址');
INSERT INTO PERSON.ADDRESS_TYPE(NAME) VALUES('家庭地址');
INSERT INTO PERSON.ADDRESS_TYPE(NAME) VALUES('公司地址');--INSERT DEPARTMENT
INSERT INTO RESOURCES.DEPARTMENT(NAME) VALUES('采购部门');
INSERT INTO RESOURCES.DEPARTMENT(NAME) VALUES('销售部门');
INSERT INTO RESOURCES.DEPARTMENT(NAME) VALUES('人力资源');
INSERT INTO RESOURCES.DEPARTMENT(NAME) VALUES('行政部门');
INSERT INTO RESOURCES.DEPARTMENT(NAME) VALUES('广告部');--INSERT PERSON
INSERT INTO PERSON.PERSON(SEX,NAME,EMAIL,PHONE) VALUES('F','李丽','lily@sina.com','02788548562');
INSERT INTO PERSON.PERSON(SEX,NAME,EMAIL,PHONE) VALUES('M','王刚','','02787584562');
INSERT INTO PERSON.PERSON(SEX,NAME,EMAIL,PHONE) VALUES('M','李勇','','02782585462');
INSERT INTO PERSON.PERSON(SEX,NAME,EMAIL,PHONE) VALUES('F','郭艳','','02787785462');
INSERT INTO PERSON.PERSON(SEX,NAME,EMAIL,PHONE) VALUES('F','孙丽','','13055173012');
INSERT INTO PERSON.PERSON(SEX,NAME,EMAIL,PHONE) VALUES('M','黄非','','13355173012');
INSERT INTO PERSON.PERSON(SEX,NAME,EMAIL,PHONE) VALUES('F','王菲','','13255173012');
INSERT INTO PERSON.PERSON(SEX,NAME,EMAIL,PHONE) VALUES('M','张平','','13455173012');
INSERT INTO PERSON.PERSON(SEX,NAME,EMAIL,PHONE) VALUES('M','张红','','13555173012');
INSERT INTO PERSON.PERSON(SEX,NAME,EMAIL,PHONE) VALUES('F','刘佳','','13955173012');
INSERT INTO PERSON.PERSON(SEX,NAME,EMAIL,PHONE) VALUES('F','王南','','15955173012');
INSERT INTO PERSON.PERSON(SEX,NAME,EMAIL,PHONE) VALUES('F','李飞','','15954173012');
INSERT INTO PERSON.PERSON(SEX,NAME,EMAIL,PHONE) VALUES('F','张大海','','15955673012');
INSERT INTO PERSON.PERSON(SEX,NAME,EMAIL,PHONE) VALUES('F','王宇轩','','15955175012');
INSERT INTO PERSON.PERSON(SEX,NAME,EMAIL,PHONE) VALUES('F','桑泽恩','','15955173024');
INSERT INTO PERSON.PERSON(SEX,NAME,EMAIL,PHONE) VALUES('F','刘青','','15955173055');
INSERT INTO PERSON.PERSON(SEX,NAME,PHONE) VALUES('F','杨凤兰','02785584662');--INSERT PERSON_TYPE
INSERT INTO PERSON.PERSON_TYPE(NAME) VALUES('采购经理');
INSERT INTO PERSON.PERSON_TYPE(NAME) VALUES('采购代表');
INSERT INTO PERSON.PERSON_TYPE(NAME) VALUES('销售经理');
INSERT INTO PERSON.PERSON_TYPE(NAME) VALUES('销售代表');--INSERT CUSTOMER
INSERT INTO SALES.CUSTOMER(PERSONID) SELECT PERSONID FROM PERSON.PERSON WHERE NAME='刘青';
INSERT INTO SALES.CUSTOMER(PERSONID) SELECT PERSONID FROM PERSON.PERSON WHERE NAME='桑泽恩';
INSERT INTO SALES.CUSTOMER(PERSONID) SELECT PERSONID FROM PERSON.PERSON WHERE NAME='王宇轩';
INSERT INTO SALES.CUSTOMER(PERSONID) SELECT PERSONID FROM PERSON.PERSON WHERE NAME='张大海';
INSERT INTO SALES.CUSTOMER(PERSONID) SELECT PERSONID FROM PERSON.PERSON WHERE NAME='李飞';
INSERT INTO SALES.CUSTOMER(PERSONID) SELECT PERSONID FROM PERSON.PERSON WHERE NAME='王南';--INSERT  CUSTOMER_ADDRESS
INSERT INTO SALES.CUSTOMER_ADDRESS(CUSTOMERID,ADDRESSID,ADDRESS_TYPEID)
SELECT CUSTOMERID,11,2 FROM SALES.CUSTOMER;
INSERT INTO SALES.CUSTOMER_ADDRESS(CUSTOMERID,ADDRESSID,ADDRESS_TYPEID)
SELECT CUSTOMERID,12,3 FROM SALES.CUSTOMER;--INSERT EMPLOYEE
INSERT INTO RESOURCES.EMPLOYEE(NATIONALNO,PERSONID,LOGINID,TITLE,MANAGERID,BIRTHDATE,MARITALSTATUS,PHOTO,HAIRDATE,SALARY)
VALUES('420921197908051523',1,'L1','总经理','','1979-08-05','S','','2002-05-02',40000);INSERT INTO RESOURCES.EMPLOYEE(NATIONALNO,PERSONID,LOGINID,TITLE,MANAGERID,BIRTHDATE,MARITALSTATUS,PHOTO,HAIRDATE,SALARY)
VALUES('420921198008051523',2,'L2','销售经理',(SELECT EMPLOYEEID FROM RESOURCES.EMPLOYEE WHERE TITLE='总经理'),'1980-08-05','S','','2002-05-02', 26000);INSERT INTO RESOURCES.EMPLOYEE(NATIONALNO,PERSONID,LOGINID,TITLE,MANAGERID,BIRTHDATE,MARITALSTATUS,PHOTO,HAIRDATE,SALARY)
VALUES('420921198408051523',3,'L3','采购经理',(SELECT EMPLOYEEID FROM RESOURCES.EMPLOYEE WHERE TITLE='总经理'),'1981-08-05','S','','2002-05-02',23000);INSERT INTO RESOURCES.EMPLOYEE(NATIONALNO,PERSONID,LOGINID,TITLE,MANAGERID,BIRTHDATE,MARITALSTATUS,PHOTO,HAIRDATE,SALARY)
VALUES('420921198208051523',4,'L4','销售代表',(SELECT EMPLOYEEID FROM RESOURCES.EMPLOYEE WHERE TITLE='销售经理'),'1982-08-05','S','','2002-05-02',15000);INSERT INTO RESOURCES.EMPLOYEE(NATIONALNO,PERSONID,LOGINID,TITLE,MANAGERID,BIRTHDATE,MARITALSTATUS,PHOTO,HAIRDATE,SALARY)
VALUES('420921198308051523',5,'L5','销售代表',(SELECT EMPLOYEEID FROM RESOURCES.EMPLOYEE WHERE TITLE='销售经理'),'1983-08-05','S','','2002-05-02',16000);INSERT INTO RESOURCES.EMPLOYEE(NATIONALNO,PERSONID,LOGINID,TITLE,MANAGERID,BIRTHDATE,MARITALSTATUS,PHOTO,HAIRDATE,SALARY)
VALUES('420921198408051523',6,'L6','采购代表',(SELECT EMPLOYEEID FROM RESOURCES.EMPLOYEE WHERE TITLE='采购经理'),'1984-08-05','S','','2005-05-02',12000);INSERT INTO RESOURCES.EMPLOYEE(NATIONALNO,PERSONID,LOGINID,TITLE,MANAGERID,BIRTHDATE,MARITALSTATUS,PHOTO,HAIRDATE,SALARY)
VALUES('420921197708051523',7,'L7','人力资源部经理',(SELECT EMPLOYEEID FROM RESOURCES.EMPLOYEE WHERE TITLE='总经理'),'1977-08-05','M','','2002-05-02',25000);INSERT INTO RESOURCES.EMPLOYEE(NATIONALNO,PERSONID,LOGINID,TITLE,MANAGERID,BIRTHDATE,MARITALSTATUS,PHOTO,HAIRDATE,SALARY)
VALUES('420921198008071523',8,'L8','系统管理员',(SELECT EMPLOYEEID FROM RESOURCES.EMPLOYEE WHERE TITLE='人力资源部经理'),'1980-08-07','S','','2004-05-02',20000);--INSERT IMPLOYEE_DEPARTMENT 
INSERT INTO RESOURCES.EMPLOYEE_DEPARTMENT(EMPLOYEEID,DEPARTMENTID,STARTDATE,ENDDATE)
SELECT EMPLOYEEID,'2','2005-02-01',null FROM RESOURCES.EMPLOYEE WHERE RESOURCES.EMPLOYEE.TITLE='销售代表' OR RESOURCES.EMPLOYEE.TITLE='销售经理';
INSERT INTO RESOURCES.EMPLOYEE_DEPARTMENT(EMPLOYEEID,DEPARTMENTID,STARTDATE,ENDDATE)
SELECT EMPLOYEEID,'1','2005-02-01',null FROM RESOURCES.EMPLOYEE WHERE RESOURCES.EMPLOYEE.TITLE='采购代表' OR RESOURCES.EMPLOYEE.TITLE='采购经理';
INSERT INTO RESOURCES.EMPLOYEE_DEPARTMENT(EMPLOYEEID,DEPARTMENTID,STARTDATE,ENDDATE)
SELECT EMPLOYEEID,'3','2005-02-01',null FROM RESOURCES.EMPLOYEE WHERE RESOURCES.EMPLOYEE.TITLE='系统管理员';
INSERT INTO RESOURCES.EMPLOYEE_DEPARTMENT(EMPLOYEEID,DEPARTMENTID,STARTDATE,ENDDATE)
SELECT EMPLOYEEID,'4','2001-02-01',null FROM RESOURCES.EMPLOYEE WHERE RESOURCES.EMPLOYEE.TITLE='总经理';--INSERT EMPLOYEE_ADDRESS
INSERT INTO RESOURCES.EMPLOYEE_ADDRESS(EMPLOYEEID,ADDRESSID) VALUES(1,1);
INSERT INTO RESOURCES.EMPLOYEE_ADDRESS(EMPLOYEEID,ADDRESSID) VALUES(2,2);
INSERT INTO RESOURCES.EMPLOYEE_ADDRESS(EMPLOYEEID,ADDRESSID) VALUES(3,3);
INSERT INTO RESOURCES.EMPLOYEE_ADDRESS(EMPLOYEEID,ADDRESSID) VALUES(4,4);
INSERT INTO RESOURCES.EMPLOYEE_ADDRESS(EMPLOYEEID,ADDRESSID) VALUES(5,5);
INSERT INTO RESOURCES.EMPLOYEE_ADDRESS(EMPLOYEEID,ADDRESSID) VALUES(6,6);
INSERT INTO RESOURCES.EMPLOYEE_ADDRESS(EMPLOYEEID,ADDRESSID) VALUES(7,7);
INSERT INTO RESOURCES.EMPLOYEE_ADDRESS(EMPLOYEEID,ADDRESSID) VALUES(8,8);--INSERT SALES.SALESPERSON
INSERT INTO SALES.SALESPERSON(EMPLOYEEID,SALESTHISYEAR,SALESLASTYEAR)
SELECT EMPLOYEEID,8,10 FROM RESOURCES.EMPLOYEE WHERE TITLE='销售代表';--INSERT VENDOR
INSERT INTO PURCHASING.VENDOR(ACCOUNTNO,NAME,ACTIVEFLAG,WEBURL,CREDIT)
VALUES('00','上海画报出版社','1','','2');
INSERT INTO PURCHASING.VENDOR(ACCOUNTNO,NAME,ACTIVEFLAG,WEBURL,CREDIT)
VALUES('00','长江文艺出版社','1','','2');
INSERT INTO PURCHASING.VENDOR(ACCOUNTNO,NAME,ACTIVEFLAG,WEBURL,CREDIT)
VALUES('00','北京十月文艺出版社','1','','1');
INSERT INTO PURCHASING.VENDOR(ACCOUNTNO,NAME,ACTIVEFLAG,WEBURL,CREDIT)
VALUES('00','人民邮电出版社','1','','1');
INSERT INTO PURCHASING.VENDOR(ACCOUNTNO,NAME,ACTIVEFLAG,WEBURL,CREDIT)
VALUES('00','清华大学出版社','1','','1');
INSERT INTO PURCHASING.VENDOR(ACCOUNTNO,NAME,ACTIVEFLAG,WEBURL,CREDIT)
VALUES('00','中华书局','1','','1');
INSERT INTO PURCHASING.VENDOR(ACCOUNTNO,NAME,ACTIVEFLAG,WEBURL,CREDIT)
VALUES('00','广州出版社','1','','1');
INSERT INTO PURCHASING.VENDOR(ACCOUNTNO,NAME,ACTIVEFLAG,WEBURL,CREDIT)
VALUES('00','上海出版社','1','','1');
INSERT INTO PURCHASING.VENDOR(ACCOUNTNO,NAME,ACTIVEFLAG,WEBURL,CREDIT)
VALUES('00','21世纪出版社','1','','1');
INSERT INTO PURCHASING.VENDOR(ACCOUNTNO,NAME,ACTIVEFLAG,WEBURL,CREDIT)
VALUES('00','外语教学与研究出版社','1','','1');
INSERT INTO PURCHASING.VENDOR(ACCOUNTNO,NAME,ACTIVEFLAG,WEBURL,CREDIT)
VALUES('00','机械工业出版社','1','','1');
INSERT INTO PURCHASING.VENDOR(ACCOUNTNO,NAME,ACTIVEFLAG,WEBURL,CREDIT)
VALUES('00','文学出版社','1','','1');--INSERT VENDOR_ADDRESS
INSERT INTO PURCHASING.VENDOR_ADDRESS(VENDORID,ADDRESSID,ADDRESS_TYPEID)
SELECT VENDORID,9,1 FROM PURCHASING.VENDOR;
INSERT INTO PURCHASING.VENDOR_ADDRESS(VENDORID,ADDRESSID,ADDRESS_TYPEID)
SELECT VENDORID,10,4 FROM PURCHASING.VENDOR;--INSERT VENDOR_PERSON
INSERT INTO PURCHASING.VENDOR_PERSON(VENDORID,PERSONID,PERSON_TYPEID)
SELECT VENDORID,9,4 FROM PURCHASING.VENDOR;--INSERT PRODUCT_CATEGORRY
INSERT INTO PRODUCTION.PRODUCT_CATEGORY(NAME) VALUES('小说');
INSERT INTO PRODUCTION.PRODUCT_CATEGORY(NAME) VALUES('文学');
INSERT INTO PRODUCTION.PRODUCT_CATEGORY(NAME) VALUES('计算机');
INSERT INTO PRODUCTION.PRODUCT_CATEGORY(NAME) VALUES('英语');
INSERT INTO PRODUCTION.PRODUCT_CATEGORY(NAME) VALUES('管理');
INSERT INTO PRODUCTION.PRODUCT_CATEGORY(NAME) VALUES('少儿');
INSERT INTO PRODUCTION.PRODUCT_CATEGORY(NAME) VALUES('金融');--INSERT PRODUCT_SUBCATEGORY
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='小说'),'世界名著');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='小说'),'武侠');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='小说'),'科幻');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='小说'),'四大名著');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='小说'),'军事');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='小说'),'社会');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME) VALUES(10,'历史');INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='文学'),'文集');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='文学'),'纪实文学');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='文学'),'文学理论');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='文学'),'中国古诗词');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='文学'),'中国现当代诗');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='文学'),'戏剧');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='文学'),'民间文学');INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='计算机'),'计算机理论');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='计算机'),'计算机体系结构');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='计算机'),'操作系统');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='计算机'),'程序设计');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='计算机'),'数据库');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='计算机'),'软件工程');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='计算机'),'信息安全');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='计算机'),'多媒体');INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='英语'),'英语词汇');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='英语'),'英语语法');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='英语'),'英语听力');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='英语'),'英语口语');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='英语'),'英语阅读');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='英语'),'英语写作');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='管理'),'行政管理');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='管理'),'项目管理');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='管理'),'质量管理与控制');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='管理'),'商业道德');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='管理'),'经营管理');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='管理'),'财务管理');INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='少儿'),'幼儿启蒙');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='少儿'),'益智游戏');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='少儿'),'童话');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='少儿'),'卡通');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='少儿'),'励志');
INSERT INTO PRODUCTION.PRODUCT_SUBCATEGORY(PRODUCT_CATEGORYID,NAME)
VALUES((SELECT PRODUCT_CATEGORYID FROM PRODUCTION.PRODUCT_CATEGORY WHERE NAME='少儿'),'少儿英语');--INSERT PRODUCT
INSERT INTO PRODUCTION.PRODUCT(NAME,AUTHOR,PUBLISHER,PUBLISHTIME,PRODUCTNO,PRODUCT_SUBCATEGORYID,SATETYSTOCKLEVEL,ORIGINALPRICE,NOWPRICE,DISCOUNT,DESCRIPTION,PHOTO,TYPE,PAPERTOTAL,WORDTOTAL,SELLSTARTTIME,SELLENDTIME)
VALUES('红楼梦','曹雪芹,高鹗','中华书局','2005-4-1','9787101046120',(SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='四大名著'),'10','19','15.2','8.0','曹雪芹,是中国文学史上最伟大也是最复杂的作家,《红楼梦》也是中国文学史上最伟大而又最复杂的作品。《红楼梦》写的是封建贵族的青年贾宝玉、林黛王、薛宝钗之间的恋爱和婚姻悲剧,而且以此为中心,写出了当时具有代表性的贾、王、史、薛四大家族的兴衰,其中又以贾府为中心,揭露了封建社会后期的种种黑暗和罪恶,及其不可克服的内在矛盾,对腐朽的封建统治阶级和行将崩溃的封建制度作了有力的批判,使读者预感到它必然要走向覆灭的命运。本书是一部具有高度思想性和高度艺术性的伟大作品,从本书反映的思想倾向来看,作者具有初步的民主主义思想,他对现实社会包括宫廷及官场的黑暗,封建贵族阶级及其家庭的腐朽,封建的科举制度、婚姻制度、奴婢制度、等级制度,以及与此相适应的社会统治思想即孔孟之道和程朱理学、社会道德观念等等,都进行了深刻的批判并且提出了朦胧的带有初步民主主义性质的理想和主张。这些理想和主张正是当时正在滋长的资本主义经济萌芽因素的曲折反映。','','16','943','933000','2006-03-20','');INSERT INTO PRODUCTION.PRODUCT(NAME,AUTHOR,PUBLISHER,PUBLISHTIME,PRODUCTNO,PRODUCT_SUBCATEGORYID,SATETYSTOCKLEVEL,ORIGINALPRICE,NOWPRICE,DISCOUNT,DESCRIPTION,PHOTO,TYPE,PAPERTOTAL,WORDTOTAL,SELLSTARTTIME,SELLENDTIME)
VALUES('水浒传','施耐庵,罗贯中','中华书局','2005-4-1','9787101046137',(SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='四大名著'),'10','19','14.3','7.5','《水浒传》是宋江起义故事在民间长期流传基础上产生出来的,吸收了民间文学的营养。《水浒传》是我国人民最喜爱的古典长篇白话小说之一。它产生于明代,是在宋、元以来有关水浒的故事、话本、戏曲的基础上,由作者加工整理、创作而成的。全书以宋江领导的农民起义为主要题材,艺术地再现了中国古代人民反抗压迫、英勇斗争的悲壮画卷。作品充分暴露了封建统治阶级的腐朽和残暴,揭露了当时尖锐对立的社会矛盾和“官逼民反”的残酷现实,成功地塑造了鲁智深、李逵、武松、林冲、阮小七等一批英雄人物。小说故事情节曲折,语言生动,人物性格鲜明,具有高度的艺术成就。但作品歌颂、美化宋江,鼓吹“忠义”和“替天行道”,表现出严重的思想局限。','','16','922','912000','2006-03-20','');INSERT INTO PRODUCTION.PRODUCT(NAME,AUTHOR,PUBLISHER,PUBLISHTIME,PRODUCTNO,PRODUCT_SUBCATEGORYID,SATETYSTOCKLEVEL,ORIGINALPRICE,NOWPRICE,DISCOUNT,DESCRIPTION,PHOTO,TYPE,PAPERTOTAL,WORDTOTAL,SELLSTARTTIME,SELLENDTIME)
VALUES('老人与海','海明威','上海出版社','2006-8-1','9787532740093',(SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='世界名著'),'10','10','6.1','6.1','海明威(1899一1961),美国著名作家、诺贝尔文学奖获得者。《老人与海》是他最具代表性的作品之一。','','16','98','67000','2006-03-20','');INSERT INTO PRODUCTION.PRODUCT(NAME,AUTHOR,PUBLISHER,PUBLISHTIME,PRODUCTNO,PRODUCT_SUBCATEGORYID,SATETYSTOCKLEVEL,ORIGINALPRICE,NOWPRICE,DISCOUNT,DESCRIPTION,PHOTO,TYPE,PAPERTOTAL,WORDTOTAL,SELLSTARTTIME,SELLENDTIME)
VALUES('射雕英雄传(全四册)','金庸 ','广州出版社','2005-12-1','9787807310822',(SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='武侠'),'10','32','21.7','6.8','自幼家破人亡的郭靖,随母流落蒙古大漠,这傻头傻脑但有情有义的小伙子倒也逝有福气,他不但习得了江南六怪的绝艺、全真教马钰的内功、洪七公的隆龙十八掌、双手互博之术、九阴真经等盖世武功,还让古灵精怪的小美女黄蓉这辈子跟定了他。这部原名『大漠英雄传』的小说是金庸小说中最广为普罗大众接受、传颂的一部,其中出了许多有名又奇特的人物,东邪西毒南帝北丐中神通,还有武功灵光、脑袋不灵光的老顽童周伯通,他们有特立独行的性格、作为和人生观,让人叹为观止。书中对历史多有着墨,中原武林及蒙古大漠的生活情形随着人物的生长环境变迁而有不同的叙述,异族统治之下的小老百姓心情写来丝丝入扣,本书对情的感觉是很含蓄的,尤其是郭靖与拖雷、华筝无猜的童年之谊,他与江南六怪的师生之谊等等,还有全真七子中长春子丘处机的侠义行为及其与郭杨二人风雪中的一段情谊,也有很豪气的叙述。神算子瑛姑及一灯大师和周伯通的一场孽恋,是最出乎人意料的一段,成人世界的恋情可比小儿女的青涩恋燕还复杂多了。郭靖以扭胜巧的人生经历和「为国为民,侠之大者」的儒侠风范,也是书中最大要旨。距离这本书完成的时间已有四十年了,书中的单纯诚朴的人物性格还深深的留在读者心中,本书故事也多改编成电影、电视剧等,受欢迎程度可见一斑。','','16','','1153000','2006-03-20','');INSERT INTO PRODUCTION.PRODUCT(NAME,AUTHOR,PUBLISHER,PUBLISHTIME,PRODUCTNO,PRODUCT_SUBCATEGORYID,SATETYSTOCKLEVEL,ORIGINALPRICE,NOWPRICE,DISCOUNT,DESCRIPTION,PHOTO,TYPE,PAPERTOTAL,WORDTOTAL,SELLSTARTTIME,SELLENDTIME)
VALUES('鲁迅文集(小说、散文、杂文)全两册','鲁迅','','2006-9-1','9787509000724',(SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='文集'),'10','39.8','20','5.0','','','16','684','680000','2006-03-20','');INSERT INTO PRODUCTION.PRODUCT(NAME,AUTHOR,PUBLISHER,PUBLISHTIME,PRODUCTNO,PRODUCT_SUBCATEGORYID,SATETYSTOCKLEVEL,ORIGINALPRICE,NOWPRICE,DISCOUNT,DESCRIPTION,PHOTO,TYPE,PAPERTOTAL,WORDTOTAL,SELLSTARTTIME,SELLENDTIME)
VALUES('长征','王树增 ','人民文学出版社','2006-9-1','9787020057986',(SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='纪实文学'),'10','53','37.7','6.4','','','16','683','670000','2006-03-20','');INSERT INTO PRODUCTION.PRODUCT(NAME,AUTHOR,PUBLISHER,PUBLISHTIME,PRODUCTNO,PRODUCT_SUBCATEGORYID,SATETYSTOCKLEVEL,ORIGINALPRICE,NOWPRICE,DISCOUNT,DESCRIPTION,PHOTO,TYPE,PAPERTOTAL,WORDTOTAL,SELLSTARTTIME,SELLENDTIME)
VALUES('数据结构(C语言版)(附光盘)','严蔚敏,吴伟民','清华大学出版社','2007-3-1','9787302147510',(SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='计算机理论'),'10','30','25.5','8.5','《数据结构》(C语言版)是为“数据结构”课程编写的教材,也可作为学习数据结构及其算法的C程序设计的参数教材。 本书的前半部分从抽象数据类型的角度讨论各种基本类型的数据结构及其应用','','8','334','493000','2006-03-20','');INSERT INTO PRODUCTION.PRODUCT(NAME,AUTHOR,PUBLISHER,PUBLISHTIME,PRODUCTNO,PRODUCT_SUBCATEGORYID,SATETYSTOCKLEVEL,ORIGINALPRICE,NOWPRICE,DISCOUNT,DESCRIPTION,PHOTO,TYPE,PAPERTOTAL,WORDTOTAL,SELLSTARTTIME,SELLENDTIME)
VALUES('工作中无小事','陈满麒','机械工业出版社','2006-1-1','9787111182252',(SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='行政管理'),'10','16.8','11.4','6.8','本书立足于当今企业中常见的轻视小事,做事浮躁等现象,从人性的弱点这一独特角度,挖掘出员工轻视小事的根本原因,具有深厚的人文关怀,极易引起员工的共鸣。它有助于员工端正心态,摒弃做事贪大的浮躁心理,把小事做好做到位,从而提高整个企业的工作质量。当重视小事成为员工的一种习惯,当责任感成为一种生活态度,他们将会与胜任、优秀、成功同行,责任、忠诚、敬业也将不再是一句空洞的企业宣传口号。本书是一本提升企业竞争力、建设企业文化的指导手册,一本员工素质培训的完美读本,一本所有公务员、公司职员的必读书。','','8','152','70000','2006-03-20','');INSERT INTO PRODUCTION.PRODUCT(NAME,AUTHOR,PUBLISHER,PUBLISHTIME,PRODUCTNO,PRODUCT_SUBCATEGORYID,SATETYSTOCKLEVEL,ORIGINALPRICE,NOWPRICE,DISCOUNT,DESCRIPTION,PHOTO,TYPE,PAPERTOTAL,WORDTOTAL,SELLSTARTTIME,SELLENDTIME)
VALUES('突破英文基础词汇','刘毅','外语教学与研究出版社','2003-8-1','9787560035024',(SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='英语词汇'),'10','15.9','11.1','7.0','本书所列单词共计1300个,加上各词的衍生词、同义词及反义词,则实际收录约3000词,均为平时最常用、最容易接触到的单词。详细列出各词的国际音标、词性说明及中文解释,省却查字典的麻烦。每一课分为五个部分,以便于分段记忆。在课前有预备测验,每一部分之后有习题,课后有效果检测,可借助于重复测验来加深对单词的印象,并学习如何活用单词。','','8','350','','2006-03-20','');INSERT INTO PRODUCTION.PRODUCT(NAME,AUTHOR,PUBLISHER,PUBLISHTIME,PRODUCTNO,PRODUCT_SUBCATEGORYID,SATETYSTOCKLEVEL,ORIGINALPRICE,NOWPRICE,DISCOUNT,DESCRIPTION,PHOTO,TYPE,PAPERTOTAL,WORDTOTAL,SELLSTARTTIME,SELLENDTIME)
VALUES('噼里啪啦丛书(全7册)','(日)佐佐木洋子','21世纪出版社','1901-01-01','9787539125992',(SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='幼儿启蒙'),'10','58','42','6.1','噼里啪啦系列丛书包括:我要拉巴巴》《我去刷牙》《我要洗澡》《你好》《草莓点心》《车来了》《我喜欢游泳》共7册。 这是日本画家佐佐木洋子编绘的,分别描绘孩子在刷牙、洗澡、游玩、吃点心等各种时候所碰到的问题,以风趣的方式教会他们人生的最初的知识。书中的图形不仅夸张诱人,而且采用了一些局部折叠的方式,在书页中可以不时翻开一些折叠面,让人看到图画内部的东西,这是很符合低幼儿童的阅读心理的。','','8','','','2006-03-20','');--INSERT LOCATION
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='世界名著'),'库存1-货架1');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='武侠'),'库存1-货架1');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='科幻'),'库存1-货架1');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='军事'),'库存1-货架1');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='社会'),'库存1-货架1');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='文集'),'库存1-货架1');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='纪实文学'),'库存1-货架1');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='文学理论'),'库存1-货架1');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='中国古诗词'),'库存1-货架2');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='中国现当代诗'),'库存1-货架2');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='戏剧'),'库存1-货架2');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='民间文学'),'库存1-货架2');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='计算机理论'),'库存1-货架2');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='计算机体系结构'),'库存1-货架2');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='操作系统'),'库存1-货架2');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='程序设计'),'库存1-货架3');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='数据库'),'库存1-货架3');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='软件工程'),'库存1-货架3');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='信息安全'),'库存1-货架3');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='多媒体'),'库存1-货架3');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='英语词汇'),'库存1-货架4');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='英语语法'),'库存1-货架4');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='英语听力'),'库存1-货架4');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='英语口语'),'库存1-货架4');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='英语阅读'),'库存1-货架4');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='英语写作'),'库存1-货架4');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='行政管理'),'库存1-货架4');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='项目管理'),'库存1-货架4');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='质量管理与控制'),'库存1-货架4');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='商业道德'),'库存1-货架4');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='经营管理'),'库存1-货架4');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='财务管理'),'库存1-货架4');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='幼儿启蒙'),'库存2-货架1');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='益智游戏'),'库存2-货架1');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='童话'),'库存2-货架2');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='卡通'),'库存2-货架2');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='励志'),'库存2-货架2');
INSERT INTO PRODUCTION.LOCATION(PRODUCT_SUBCATEGORYID,NAME)
VALUES((SELECT PRODUCT_SUBCATEGORYID FROM PRODUCTION.PRODUCT_SUBCATEGORY WHERE NAME='少儿英语'),'库存2-货架2');--INSERT PRODUCT_INVENTORY
INSERT INTO PRODUCTION.PRODUCT_INVENTORY(PRODUCTID,LOCATIONID,QUANTITY) 
SELECT T1.PRODUCTID,T2.LOCATIONID,100 FROM PRODUCTION.PRODUCT T1,PRODUCTION.LOCATION T2 
WHERE T1.PRODUCT_SUBCATEGORYID=T2.PRODUCT_SUBCATEGORYID;--INSERT PRODUCT_REVIEW
INSERT INTO PRODUCTION.PRODUCT_REVIEW(PRODUCTID,NAME,REVIEWDATE,EMAIL,RATING,COMMENTS)
SELECT PRODUCTID,'刘青','2007-05-06','zhangping@sina.com','1','送货快' from PRODUCTION.PRODUCT;
INSERT INTO PRODUCTION.PRODUCT_REVIEW(PRODUCTID,NAME,REVIEWDATE,EMAIL,RATING,COMMENTS)
SELECT PRODUCTID,'桑泽恩','2007-05-06','zhangping@sina.com','1','服务态度好' from PRODUCTION.PRODUCT;--INSERT PRODUCT_VENDOR
INSERT INTO PRODUCTION.PRODUCT_VENDOR(PRODUCTID,VENDORID,STANDARDPRICE,LASTPRICE,LASTDATE,MINQTY,MAXQTY,ONORDERQTY)
SELECT PRODUCTID,VENDORID,25,'','','10','100','' FROM PRODUCTION.PRODUCT,PURCHASING.VENDOR WHERE PRODUCTION.PRODUCT.PUBLISHER=PURCHASING.VENDOR.NAME;--INSER SALESORDER_HEADER
INSERT INTO SALES.SALESORDER_HEADER(ORDERDATE,DUEDATE,STATUS,ONLINEORDERFLAG,CUSTOMERID,SALESPERSONID,ADDRESSID,SHIPMETHOD,SUBTOTAL,FREIGHT,TOTAL,COMMENTS)
VALUES ('2007-05-06','2007-5-07',2,1,1,2,3,0,36.9,0,36.9,'上午送到');
INSERT INTO SALES.SALESORDER_HEADER(ORDERDATE,DUEDATE,STATUS,ONLINEORDERFLAG,CUSTOMERID,SALESPERSONID,ADDRESSID,SHIPMETHOD,SUBTOTAL,FREIGHT,TOTAL,COMMENTS)
VALUES ('2007-05-07','2007-5-07',1,1,1,1,1,0,36.9,0,36.9,'上午送到');-- INSERT SALESORDER_DETAIL
INSERT INTO SALES.SALESORDER_DETAIL(SALESORDERID,SALESORDER_DETAILID,CARRIERNO,PRODUCTID,ORDERQTY,LINETOTAL)
SELECT SALESORDERID,'1','2007052',1,1,15.2 FROM SALES.SALESORDER_HEADER;
INSERT INTO SALES.SALESORDER_DETAIL(SALESORDERID,SALESORDER_DETAILID,CARRIERNO,PRODUCTID,ORDERQTY,LINETOTAL)
SELECT SALESORDERID,'2','2007053',3,1,21.7 FROM SALES.SALESORDER_HEADER;UPDATE SALES.SALESPERSON SET SALESLASTYEAR = 20.0000 WHERE SALESPERSONID = 2;INSERT INTO PURCHASING.PURCHASEORDER_HEADER(ORDERDATE,STATUS,EMPLOYEEID,VENDORID,SHIPMETHOD,SUBTOTAL,TAX,FREIGHT,TOTAL)
VALUES('2006-7-21',1,6,5,'快递',5000.00,600.00,800.00,6400.00);INSERT INTO OTHER.DEPARTMENT VALUES(NULL, '总公司');
INSERT INTO OTHER.DEPARTMENT VALUES('总公司', '服务部');
INSERT INTO OTHER.DEPARTMENT VALUES('总公司', '采购部');
INSERT INTO OTHER.DEPARTMENT VALUES('总公司', '财务部');
INSERT INTO OTHER.DEPARTMENT VALUES('服务部', '网络服务部');
INSERT INTO OTHER.DEPARTMENT VALUES('服务部', '读者服务部');
INSERT INTO OTHER.DEPARTMENT VALUES('服务部', '企业服务部');
INSERT INTO OTHER.DEPARTMENT VALUES('读者服务部', '书籍借阅服务部');
INSERT INTO OTHER.DEPARTMENT VALUES('读者服务部', '书籍阅览服务部');INSERT INTO OTHER.EMPSALARY VALUES ('KING',7839,5000);
INSERT INTO OTHER.EMPSALARY VALUES ('SCOTT',7788,3000);
INSERT INTO OTHER.EMPSALARY VALUES ('FORD',7902,3000);
INSERT INTO OTHER.EMPSALARY VALUES ('JONES',7566,2975);
INSERT INTO OTHER.EMPSALARY VALUES ('BLAKE',7698,2850);
INSERT INTO OTHER.EMPSALARY VALUES ('CLARK',7782,2450);
INSERT INTO OTHER.EMPSALARY VALUES ('ALLEN',7499,1600);
INSERT INTO OTHER.EMPSALARY VALUES ('TURNER',7844,1500);
INSERT INTO OTHER.EMPSALARY VALUES ('MILLER',7934,1300);
INSERT INTO OTHER.EMPSALARY VALUES ('WARD',7521,1250);
INSERT INTO OTHER.EMPSALARY VALUES ('MARTIN',7654,1250);
INSERT INTO OTHER.EMPSALARY VALUES ('ADAMS',7876,1100);
INSERT INTO OTHER.EMPSALARY VALUES ('JAMES',7900,950);
INSERT INTO OTHER.EMPSALARY VALUES ('SMITH',7369,800);INSERT INTO OTHER.ACCOUNT VALUES(1,1000);
INSERT INTO OTHER.ACCOUNT VALUES(2,2000);
INSERT INTO OTHER.ACCOUNT VALUES(3,1500);
INSERT INTO OTHER.ACCOUNT VALUES(4,6500);
INSERT INTO OTHER.ACCOUNT VALUES(5,500);INSERT INTO OTHER.ACTIONS VALUES(3,'U',599,NULL);
INSERT INTO OTHER.ACTIONS VALUES(6,'I',20099,NULL);
INSERT INTO OTHER.ACTIONS VALUES(5,'D',NULL,NULL);
INSERT INTO OTHER.ACTIONS VALUES(7,'U',1599,NULL);
INSERT INTO OTHER.ACTIONS VALUES(1,'I',399,NULL);
INSERT INTO OTHER.ACTIONS VALUES(9,'D',NULL,NULL);
INSERT INTO OTHER.ACTIONS VALUES(10,'X',NULL,NULL);INSERT INTO OTHER.READER VALUES(10, 'Bill', 19, 'M', 'Computer');
INSERT INTO OTHER.READER VALUES(11, 'Susan', 18, 'F', 'History');
INSERT INTO OTHER.READER VALUES(12, 'John', 19, 'M', 'Computer');

手册中的示例说明 | 达梦技术文档为方便读者阅读并尽快学会使用 DM 系统,本手册在介绍利用 DM 建立、维护数据库以及对数据库进行的各种操作中,使用了示例库 BOOKSHOP。本章将对该示例库进行说明。 2.1 示例库说明 示例库 BOOKSHOP 模拟武汉代理图书的某销售公司,该公司欲建立在线购物平台来拓展其代理产品的销售渠道,该在线购物平台支持网上产品信息浏览、订购等服务(仅限同城内销售及送货)。该销售公司的雇员、部门信息icon-default.png?t=O83Ahttps://eco.dameng.com/document/dm/zh-cn/pm/example-description#

示例库DMHR创建方式与 BOOKSHOP一致。

-END- 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/491401.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

认识javascript中的模块化

什么是模块化? 将程序⽂件依据⼀定规则拆分成多个文件,拆分出来每个⽂件就是⼀个模块,模块中的数据都是私有的,模块之间互相隔离。如果不进行隔离,可能会造成模块间的变量定义有冲突,导致程序崩溃 为啥要使…

EasyExcel 动态设置表格的背景颜色和排列

项目中使用EasyExcel把数据以excel格式导出&#xff0c;其中设置某一行、某一列单元格的背景颜色、排列方式十分常用&#xff0c;记录下来方便以后查阅。 1. 导入maven依赖&#xff1a; <dependency><groupId>com.alibaba</groupId><artifactId>easy…

AccessClient在苹果电脑闪退,解决方法

AccessClient 2 年前突然闪退了&#xff0c;一直没管&#xff0c;最近弄一个 electron打包&#xff0c;一直提示找不到 python&#xff0c;解决了 python 解释器后&#xff0c;顺手把AccessClient闪退解决了&#xff0c;解决思路如下&#xff1a; 1.在AccessClient点击鼠标右…

NVM:安装配置使用(详细教程)

文章目录 一、简介二、安装 nvm三、配置 nvm 镜像四、配置环境变量五、使用教程5.1 常用命令5.2 具体案例 六、结语 一、简介 在实际的开发和学习中可能会遇到不同项目的 node 版本不同&#xff0c;而出现的兼容性问题。 而 nvm 就可以很好的解决这个问题&#xff0c;它可以在…

ActiveMQ 反序列化漏洞CVE-2015-5254复现

文章目录 一、产生原因二、利用条件三、利用过程四、PoC&#xff08;概念验证&#xff09;五、poc环境验证使用find搜索vulhub已安装目录打开activeMQ组件查看配置文件端口启动镜像-文件配置好后对于Docker 镜像下载问题及解决办法设置好镜像源地址&#xff0c;进行重启docker查…

【Python】【数据分析】深入探索 Python 数据可视化:Seaborn 可视化库详解

目录 引言一、Seaborn 简介二、安装 Seaborn三、Seaborn 的基本图形3.1 散点图&#xff08;Scatter Plot&#xff09;3.2 线图&#xff08;Line Plot&#xff09;3.3 条形图&#xff08;Bar Plot&#xff09;3.4 箱型图&#xff08;Box Plot&#xff09;3.5 小提琴图&#xff0…

某药业数据中心与重工集团灾备中心SAP监测实战应用

在当今数字化转型的浪潮中&#xff0c;企业的IT系统承载着前所未有的业务压力。作为业务运营的核心支撑&#xff0c;SAP系统的稳定性和性能优化成为运维团队关注的重点。本文将结合两个实际案例——某药业集团数据中心&#xff08;以下简称“药业数据中心”&#xff09;与某重工…

Qt编译MySQL数据库驱动

目录 Qt编译MySQL数据库驱动 测试程序 Qt编译MySQL数据库驱动 &#xff08;1&#xff09;先找到MySQL安装路径以及Qt安装路径 C:\Program Files\MySQL\MySQL Server 8.0 D:\qt\5.12.12 &#xff08;2&#xff09;在D:\qt\5.12.12\Src\qtbase\src\plugins\sqldrivers\mysql下…

开发布局总结

线性布局 (Row/Column) 概述&#xff1a; 线性容器Row和Column构建。线性布局是其他布局的基础&#xff0c;其子元素在线性方向上&#xff08;水平方向和垂直方向&#xff09;依次排列。线性布局的排列方向由所选容器组件决定&#xff0c;Column容器内子元素按照垂直方向排列…

网络数据包分析

Target 实践内容&#xff1a;使用 Wireshark 捕获和分析网络流量。 涉及知识点&#xff1a;Wireshark 基本使用、数据包结构、理解网络协议分析、网络流量分析。 Trial Wireshark使用WinPCAP作为接口&#xff0c;直接与网卡进行数据报文交换。 Wireshark基本使用 勾选 WLA…

游戏引擎学习第45天

仓库: https://gitee.com/mrxiao_com/2d_game 回顾 我们刚刚开始研究运动方程&#xff0c;展示了如何处理当人物遇到障碍物时的情况。有一种版本是角色会从障碍物上反弹&#xff0c;而另一版本是角色会完全停下来。这种方式感觉不太自然&#xff0c;因为在游戏中&#xff0c;…

微知-C语言如何指定弱符号?(#define WEAK __attribute__((weak)); WEAK int foo(void))

背景 在C语言中&#xff0c;弱符号是一种特殊的符号&#xff0c;它可以被重定义&#xff0c;但在链接时&#xff0c;只会使用被重定义的符号。 在某些情况下&#xff0c;我们需要在多个文件中定义相同的函数&#xff0c;但只使用其中一个函数。本文将介绍如何在C语言中实现弱符…

windos系统安装-mysql 5.7 zip压缩包教程

一, 安装包下载 在mysql官网上下载mysql5.7版本的压缩包 官方网址: https://dev.mysql.com/downloads/mysql/5.7.html#downloads选择历史版本 选择系统和数据库版本下载 下载完成后解压到安装的目录 二, 新增数据目录,配置文件, 配置环境变量 新建data文件夹用于存放数据库…

Tengine 搭建手册

简介 官网&#xff1a; tengine.taobao.org/ Tengine是由[淘宝](http://en.wikipedia.org/wiki/Taobao)发起的Web服务器项目。它在[Nginx](https://nginx.org/)的基础上&#xff0c;针对大访问量网站的需求&#xff0c;添加了很多高级功能和特性。Tengine的性能和稳定性已经在…

MybatisPlus-配置加密

配置加密 目前配置文件中的很多参数都是明文&#xff0c;如果开发人员发生流动&#xff0c;很容易导致敏感信息的泄露。所以MybatisPlus支持配置文件的加密和解密功能。 我们以数据库的用户名和密码为例。 生成秘钥 首先&#xff0c;我们利用AES工具生成一个随机秘钥&#…

【机器学习(五)】分类和回归任务-AdaBoost算法-Sentosa_DSML社区版 (2)11

文章目录 一、算法概念11一、算法原理&#xff08;一&#xff09;分类算法基本思路1、训练集和权重初始化2、弱分类器的加权误差3、弱分类器的权重4、Adaboost 分类损失函数5、样本权重更新6、AdaBoost 的强分类器 &#xff08;二&#xff09;回归算法基本思路1、最大误差的计算…

前端入门之VUE--ajax、vuex、router,最后的前端总结

前言 VUE是前端用的最多的框架&#xff1b;这篇文章是本人大一上学习前端的笔记&#xff1b;欢迎点赞 收藏 关注&#xff0c;本人将会持续更新。本人不是学前端的&#xff0c;这个是大一的时候上学的和做的笔记&#xff0c;那个时候学的也蒙&#xff0c;故这里对前端做一个总…

GB28181系列三:GB28181流媒体服务器ZLMediaKit

我的音视频/流媒体开源项目(github) GB28181系列目录 目录 一、ZLMediaKit介绍 二、 ZLMediaKit安装、运行(Ubuntu) 1、安装 2、运行 3、配置 三、ZLMediaKit使用 一、ZLMediaKit介绍 ZLMediaKit是一个基于C11的高性能运营级流媒体服务框架&#xff0c;项目地址&#xf…

人工智能增强的音频和聊天协作服务

论文标题&#xff1a;AI-enabled Audio and Chat Collaboration Services 中文标题&#xff1a;人工智能增强的音频和聊天协作服务 作者信息&#xff1a; Emil P. Andersen, Norwegian Defence Research Establishment (FFI), Kjeller, NorwayJesper R. Goksr, Sindre E. Ha…

构建树莓派温湿度监测系统:从硬件到软件的完整指南

✅作者简介&#xff1a;2022年博客新星 第八。热爱国学的Java后端开发者&#xff0c;修心和技术同步精进。 &#x1f34e;个人主页&#xff1a;Java Fans的博客 &#x1f34a;个人信条&#xff1a;不迁怒&#xff0c;不贰过。小知识&#xff0c;大智慧。 &#x1f49e;当前专栏…