use jijin
create table sales--基金柜台人员操作表
(
sales_no int identity(1,1)primary key not null,
username varchar(50)not null,--登陆名
password varchar(50)not null,--密码
realname varchar(50)not null,--真实姓名
sex varchar(10)not null,--性别
created_date datetime null,--时间
)
------------------------------------------------------------------------------
create table fund--基金表
(
fund_no int identity(1,1)primary key not null,
pund_name varchar(50)not null,--名称
price float not null,--价格
description varchar(50)not null,--描述
status varchar(50)not null,--状态
cerated_date datetime null,--时间
)
------------------------------------------------------------------------------
create table client--客户表
(
client_no int identity(1,1)primary key not null,
client_name varchar(50)not null,--客户名
id_acrd_no varchar(50)not null,--身份
sex varchar(10)not null,--性别
phone varchar(50)not null,--电话
address varchar(100)not null,--地质
email varchar(50)not null,--email
hobby varchar(100)not null,--习惯
created_date datetime null,--时间
)
------------------------------------------------------------------------------
create table financial_account--资金账户
(
account_no int identity(1,1)primary key not null,--资金编号
client_no int not null,--客户号
financing_amount float not null,--金额
created_date datetime null,--时间
status varchar(50)not null,--状态
password varchar(50)not null,--密码
)
------------------------------------------------------------------------------
create table fund_account--基金账户
(
fund_acc_no int identity(1,1)primary key not null,
financial_acc_no int not null,--资金账户号
fund_no int not null,--基金编号
quantity int not null,--数量
price float not null,--价格
)
------------------------------------------------------------------------------
select *from sales--基金柜台人员操作表
select *from fund--基金表
delete from fund
insert into fund(pund_name,price,description,cerated_date)values('gg',12.99,'gg','2009-08-07')
select *from fund_account--基金账户
select *from client--客户表
select *from financial_account--资金账户
--内联结
select client.client_no,client.client_name,financial_account.account_no,financial_account.financing_amount,financial_account.created_date from client,financial_account where client.client_no=financial_account.client_no
--注册存储过程
create procedure proc_zhuce
@username varchar(50),
@password varchar(50),
@realname varchar(50),
@sex varchar(10),
@created_date datetime
as
insert into sales values(@username,@password,@realname,@sex,@created_date)
drop procedure porc_zhuce
------------------------------------------------------------------------------
create procedure proc_cha
@username varchar(50),
@password varchar(50)
as
select count(*) from sales where username=@username and password=@password
drop procedure proc_cha
------------------------------------------------------------------------------
--查询资金
create procedure proc_chaa
as
--内联结
select client.client_no,client.client_name,financial_account.account_no,financial_account.financing_amount,financial_account.created_date from client,financial_account where client.client_no=financial_account.client_no
drop procedure proc_chaa
评论1
最新资源