数据库表客户信息附加表读错误记录不存在

数据库表客户信息附加表读错误记录不存在,第1张

方法1接下来首先找到存放数据库文件的文件夹,鼠标右键点击改文件夹,选择“属性”。

d出属性框,切换至“安全”的选项卡。看到中间部分“要更改权限,请单击编辑”,点击编辑。2对存放数据库文件的文件夹进行权限设置,增加相关的账号权限。在组或用户名下面,点击“添加”。3在d出的界面中,选择“高级”。4在d出界面中,点击立即查找,搜索Windows中的相关用户。找到Everyone。5在输入对象名称处选择到Everyone,点击“确定”。6有个快捷方式,直接在输入对象名称处“输入关键字”,输入个“e”,然后点击“检查名称”,就会直接搜索出来。

解题思路分析:

第一步:创建表,确定数据类型,建立约束

--删除数据表

drop table purcase;

drop table product;

drop table customer;

---创建数据表

---解题思路分析:

---第一步:创建表,确定数据类型,建立约束

----创建商品表product

create table product (

productid varchar2(10) ,

productname varchar2(20) NOT NULL,

unitprice number,

category varchar2(20),

provider varchar2(20),

CONSTRAINT pk_productid primary key (productid),

CONSTRAINT CK_unitprice CHECK (unitprice>0)

);

--创建顾客表customer:

create table customer(

customerid varchar2(10),

name varchar2(20) NOT NULL,

location varchar2(20),

CONSTRAINT pk_customerid primary key(customerid)

);

--创建购买记录表 purcase:

create table purcase(

customerid varchar2(10),

productid varchar2(10),

quantity number,

CONSTRAINT FK_customerid FOREIGN KEY(customerid) REFERENCES customer(customerid) on delete cascade,

CONSTRAINT FK_productid FOREIGN KEY(productid) REFERENCES product(productid) on delete cascade,

CONSTRAINT CK_quantity CHECK(quantity BETWEEN 0 AND 20)

);

---测试数据的编写:

insert into product (productid,productname,unitprice,category,provider)

values('M01','佳洁士',800,'牙膏','宝洁');

insert into product (productid,productname,unitprice,category,provider)

values('M02','高露洁',650,'牙膏','高露洁');

insert into product (productid,productname,unitprice,category,provider)

values('M03','洁诺',500,'牙膏','联合利华');

insert into product (productid,productname,unitprice,category,provider)

values('M04','舒肤佳',300,'香皂','宝洁');

insert into product (productid,productname,unitprice,category,provider)

values('M05','夏士莲',500,'香皂','联合利华');

insert into product (productid,productname,unitprice,category,provider)

values('M06','雕牌',800,'洗衣粉','纳爱斯');

insert into product (productid,productname,unitprice,category,provider)

values('M07','中华',350,'牙膏','联合利华');

insert into product (productid,productname,unitprice,category,provider)

values('M08','汰渍',300,'洗衣粉','宝洁');

insert into product (productid,productname,unitprice,category,provider)

values('M09','碧浪',400,'洗衣粉','宝洁');

insert into customer (customerid, name ,location)

values('C01','Dennis','海淀');

insert into customer (customerid, name ,location)

values('C02','John','朝阳');

insert into customer (customerid, name ,location)

values('C03','Tom','东城');

insert into customer (customerid, name ,location)

values('C04','Jenny','东城');

insert into customer (customerid, name ,location)

values('C05','Rick','西城');

insert into purcase(customerid,productid,quantity)

values('C01','M01',3);

insert into purcase(customerid,productid,quantity)

values('C01','M05',2);

insert into purcase(customerid,productid,quantity)

values('C01','M08',2);

insert into purcase(customerid,productid,quantity)

values('C02','M02',5);

insert into purcase(customerid,productid,quantity)

values('C02','M06',4);

insert into purcase(customerid,productid,quantity)

values('C03','M01',1);

insert into purcase(customerid,productid,quantity)

values('C03','M05',1);

insert into purcase(customerid,productid,quantity)

values('C03','M06',3);

insert into purcase(customerid,productid,quantity)

values('C03','M08',1);

insert into purcase(customerid,productid,quantity)

values('C04','M03',7);

insert into purcase(customerid,productid,quantity)

values('C04','M04',3);

insert into purcase(customerid,productid,quantity)

values('C05','M06',2);

insert into purcase(customerid,productid,quantity)

values('C05','M07',8);

---提交事务

commit;

---问题分析

--(1)求购买了供应商"宝洁"产品的所有顾客;

1、确定要使用的表

product 表:供应商信息

customer表:顾客信息

purcase表:顾客的购买记录

2、确定关联关系

purcasecustomerid=customercustomerid;

purcaseproductid=customerproductid;

以上就是关于数据库表客户信息附加表读错误记录不存在全部的内容,包括:数据库表客户信息附加表读错误记录不存在、现有一个商店的数据库,记录顾客及其购物情况,由下列三个表组成:、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/sjk/9521545.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-29
下一篇 2023-04-29

发表评论

登录后才能评论

评论列表(0条)

保存