Create view medical food (disease, name, photo, produce, price) //药膳菜品
As
Select disease, name, photo, produce, price
From food data
With check option;
Select name
From medical food
Where disease=’便秘’;
Select price
From medical food
Where name=’乌鸡汤’;
Create view snack (name, photo, produce, price) //小吃
As
Select name, photo, produce, price
From food data
With check option;
Select photo
From snack
Where name=’羊肉串’;
Select produce
From snack
Where photo=’炒粉’;
Create schema “order list” authorization user
Create table order list
(Lnumber char (9) primary key and unique, //订单编号
China-style food char (20), //中餐
Western-style food char (20), //西餐
medical food char(20), //药膳菜品
snack char (20) //小吃
);
给用户授权,对订单有所有权力
Grant all privileges
On table order list
To user;
Select China-style food
From order list;
Select Western-style food
From order list;
Insert
Into order list
Values ( ‘
Update order list
Set medical food=’乌鸡汤’
Where Western-style food =’意大利面’;
Delete
From order list
Where snack=’麻优烫’;
4.2客户会员注册模块SQL语句
用户模式
Create schema “user” authorization user
Create table user
( Unumber char (9) primary key and unique, //会员帐号
Uname char (20), //姓名
Usex char (4), //性别
Ucode char (9), //密码
Telephone char(12), //常用电话
Address char(40) //收货具体地点
);
给用户授权,对用户有插入和更新权力
Grant insert, update
On table user
To user;
Insert
Into user
Values (‘
Insert
Into user
Values (‘
Insert
Into user
Values (‘
Update user
Set Uname=’张力’
Where Usex=’男’;
Update user
Set Ucode=’
Where Ucode=”
Update user
Set Telephone=’
Where Address=’黄河路花园街93号’;
4.3后台综合管理模块SQL语句
管理员模式
Create schema “controller” authorization controller
上一页 [1] [2] [3] [4] [5] [6] [7] 下一页