时间:2021-07-01 10:21:17 帮助过:15人阅读
create table RD_Commodity_types OF RD_Commodity_type;
create table RD_Goods of RD_Good;
create table RD_Payment_types of RD_Payment_type;
create table RD_Employees of RD_Employee;
create table RD_Members of RD_Member;
create table RD_Order_detailss of RD_Order_details;
create table RD_Orders of RD_Order;
③ 对于上述建好的数据表,每张表需使用INSERT INTO命令添加两条以上的记录。
Insert into C##RD.RD_MEMBERS (MEMBER_ID,MEMBER_PASSWORD,MEMBER_NAME,BIRTH,ADDRESS,MOBILE,WECHAT,REPUTATION,HOBBY,SEX,JOBE) values (‘0001‘,‘123456‘,‘昊哥‘,to_date(‘18-11月-19‘,‘DD-MON-RR‘),‘广西南宁‘,‘1008611‘,‘10010‘,‘100‘,‘喜欢吃臭豆腐‘,‘男‘,‘导师‘); Insert into C##RD.RD_MEMBERS (MEMBER_ID,MEMBER_PASSWORD,MEMBER_NAME,BIRTH,ADDRESS,MOBILE,WECHAT,REPUTATION,HOBBY,SEX,JOBE) values (‘0002‘,‘123456‘,‘小弟‘,to_date(‘18-11月-19‘,‘DD-MON-RR‘),‘广西藤县‘,‘10010‘,‘1008611‘,‘100‘,‘喜欢吃臭豆腐‘,‘男‘,‘学生‘); Insert into C##RD.RD_EMPLOYEES (EMPLOYEE_ID,EMPLOYEE_PASSWORD,EMPLOYEE_NAME,BIRTH,ADDRESS,MOBILE,WECHAT,REPUTATION,DEPARTMENT,SEX,COMPANY) values (‘0001‘,‘123456‘,‘张三‘,to_date(‘03-3月 -19‘,‘DD-MON-RR‘),‘北京八达岭‘,‘1109635‘,‘53425223‘,‘98‘,‘销售部门‘,‘男‘,‘北京岭科技有限公司‘); Insert into C##RD.RD_EMPLOYEES (EMPLOYEE_ID,EMPLOYEE_PASSWORD,EMPLOYEE_NAME,BIRTH,ADDRESS,MOBILE,WECHAT,REPUTATION,DEPARTMENT,SEX,COMPANY) values (‘0002‘,‘123456‘,‘李四‘,to_date(‘03-3月 -19‘,‘DD-MON-RR‘),‘杭州西湖边‘,‘1109635‘,‘53425223‘,‘98‘,‘作坊‘,‘男‘,‘西湖臭豆腐西施作坊‘); Insert into RD_PAYMENT_TYPES (PAYMENT_TYPE_ID,PAYMENT_TYPE) values (‘0001‘,‘支付宝‘); Insert into RD_PAYMENT_TYPES (PAYMENT_TYPE_ID,PAYMENT_TYPE) values (‘0002‘,‘微信‘); Insert into RD_COMMODITY_TYPES (COMMODITY_TYPE_ID,STATUS,COMMODITY_TYPE) values (‘0001‘,‘1‘,‘推荐‘); Insert into RD_COMMODITY_TYPES (COMMODITY_TYPE_ID,STATUS,COMMODITY_TYPE) values (‘0002‘,‘0‘,‘推荐‘); Insert into C##RD.RD_GOODS (GOOD_ID,DISCOUNT,GOODS,UNIT_PRICE,PURCHASE_DATE,GOOD_TYPE) values (‘0001‘,‘0.8‘,‘豆浆‘,23.5,‘2017-32-23‘, (select ref(a) from RD_COMMODITY_TYPES a where COMMODITY_TYPE_ID=‘0001‘)); Insert into C##RD.RD_GOODS (GOOD_ID,DISCOUNT,GOODS,UNIT_PRICE,PURCHASE_DATE,GOOD_TYPE) values (‘0002‘,‘0.8‘,‘豆浆‘,23.5,‘2017-32-23‘, (select ref(a) from RD_COMMODITY_TYPES a where COMMODITY_TYPE_ID=‘0001‘)); INSERT INTO RD_GOODS VALUES (RD_GOOD(‘0003‘, ‘0.8‘, ‘豆浆‘, ‘23.5‘, ‘2017-32-23‘, (select ref(a) from RD_COMMODITY_TYPES a where COMMODITY_TYPE_ID=‘0001‘))); Insert into C##RD.RD_ORDER_DETAILSS (ORDER_DETAILS_ID,ORDER_DETAILS,GOOD_INFO,PAYMENT_TYPE_INFO,EMPLOYEE_INFO,MEMBER_INFO) values (‘0001‘,‘es‘,(select ref(a) from RD_Goods a where GOOD_ID=‘0001‘),(select ref(a) from RD_PAYMENT_TYPES a where PAYMENT_TYPE_ID=‘0001‘),(select ref(a) from RD_EMPLOYEES a where EMPLOYEE_ID=‘0001‘),(select ref(a) from RD_MEMBERS a where MEMBER_ID=‘0001‘)); Insert into C##RD.RD_ORDER_DETAILSS (ORDER_DETAILS_ID,ORDER_DETAILS,GOOD_INFO,PAYMENT_TYPE_INFO,EMPLOYEE_INFO,MEMBER_INFO) values (‘0002‘,‘es‘,(select ref(a) from RD_Goods a where GOOD_ID=‘0001‘),(select ref(a) from RD_PAYMENT_TYPES a where PAYMENT_TYPE_ID=‘0001‘),(select ref(a) from RD_EMPLOYEES a where EMPLOYEE_ID=‘0001‘),(select ref(a) from RD_MEMBERS a where MEMBER_ID=‘0001‘)); Insert into C##RD.RD_ORDERS (ORDER_ID,GOODS_NUMBER,TOTAL_PRICE,SETUP_TIME,ORDER_DETAILS) VALUES (‘0001‘,4,23,‘2017-23-07‘,(select ref(a) from RD_Order_detailss a where ORDER_DETAILS_ID=‘0001‘)); INSERT INTO RD_ORDERS VALUES (RD_ORDER(‘0002‘,4,23,‘2017-23-07‘,(select ref(a) from RD_Order_detailss a where ORDER_DETAILS_ID=‘0001‘)));
① 模式的创建。
图5-1 用户模式创建成功
② 数据表的创建。
图5-2 数据表创建成功
图5-3 获取时间函数执行成功
③ 添加记录。
图5-4 插入数据记录成功
通过实验,相关的总结和经验收获,可分点总结如下:
面向对象数据库设计与应用 03 - 数据表创建与记录插入
标签:count 销售 成功 object datetime 详情 就会 lse 执行