⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bank.sql

📁 银行自动取款机系统的源代码
💻 SQL
字号:
create database bank
go
use bank
/*创建Customer表*/
if exists(select name
	from sysobjects
	where name='Customer'
	and type='u'
	)
	drop table Customer
go
create table Customer
(
	CustomerID varchar(18) not null,
	Name varchar(20),
	Gender char(2),
	Birthday datetime,
	Address varchar(50),
	Phone varchar(50),
	constraint pk_Customer 
	primary key(CustomerID)
)
go
/*创建Account表*/
if exists(select name
	from sysobjects 
	where name='Account'
		and type='u'
	)
	drop table Account
go
create table Account
(	
	AccountNo varchar(12) not null,
	CustomerID varchar(18) not null
		references Customer(CustomerID),
	Balance money not null
		check(Balance>0),
	Password varchar(20) not null,
	StartTime datetime,
	constraint pk_Account
		primary key(AccountNo)
)
go
/*创建Card表*/
if exists(select name
	from sysobjects 
	where name='Card'
		and type='U'
	)
	drop table Card
go
create table Card
(
	CardNo varchar(12),
	AccountNo varchar(12) not null
		references Account(AccountNo),
	Password varchar(20),
	constraint pk_Card
		primary key(CardNo)
)
go

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -