《SQL Server数据库实用案例教程》 实验2-数据定义 参考代码-不要先发学生.docx





《《SQL Server数据库实用案例教程》 实验2-数据定义 参考代码-不要先发学生.docx》由会员分享,可在线阅读,更多相关《《SQL Server数据库实用案例教程》 实验2-数据定义 参考代码-不要先发学生.docx(2页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、提示:不要把答案先发给学生,实验结束后再公布答案。要让学生先自己思考做题,老师对学生不会的题目适当提示,一题题解决困惑。实验2数据定义参考代码(1)使用SQL语句创建一个银行储蓄数据库,数据库名字为bank+你的姓名简拼,保存在d:bank目录,数据文件初 始大小MB,增长率。create database bankWXMon(namc=bankWXM_dat.filename=d:bankbankWXM_dat.mdf,一如果没有建 bank 文件夹,就写d:bankWXM.mdrsize=10.filegrow(h=IO%)(2)使用USE命令打开刚创建的数据库。use bankWXM (
2、3)使用SQL语句在刚创建的数据库中创建三个表,并增加约束,表结构如表2-18至2-20所示。 create table customerlnfonot null default(身份证)-客户编号,非空,主键-客户姓名,非空-证件类型,非空,默认“身份证”-证件号码,非空,惟一约束-电话,非空-地址邮编custonierlD int not null primary key , custonierNaine varchar(8) not null, cardType varcharf 10)card IDvarchar( 18) not null unique ,phone varchar(
3、 11) not null, address varchar( 1001 ) create table accountinfoaccountID char(19) not null primary key ,一账号,非空,主键savingTypc varchar(8) not null default(活期)chcck(savingTypc in (活期定期?定活两便),-存款类型,默认为“活期moneyType varchar( 10) nol null default人民币),一货币类型 非空,默认人民币,opcnDatc datetime not null dcfault(gctdate
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- SQL Server数据库实用案例教程 SQL Server数据库实用案例教程 实验2-数据定义 参考代码-不要先发学生 S

限制150内