资源描述:
《sql数据库的创建实例》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、SQL数据库的创建实例createtableasp学号varchar(8)姓名varchar(10)性别varchar(2)班级varchar(10))sp_helpaspaltertableaspaddqqvarchar(10)nullgoaltertableaspdropcolumnqqaltertableaspaltercolumnqqvarchar(10)notnullinsertintoaspvalues('01','党费’,’男’,’软件091',Tlllll')updatetheaspseen姓名二党飞'where学号二’01'dele
2、teaspcreatedatabasesalesalterdatabasesalesaddfile(name二sales_dat,filename二'd:datasales_dat2・ndf',size二5mb,maxsize二lOOmb,filegrowth二5mb)alterdatabasesalesaddlogfile(name二saleslog2,filename二'd:datasales_log2.1df',size二5mb,maxsize二lOOmb,filegrowth二5mb)alterdatabasesalesaddfile
3、groupsales_group1goalterdatabasesalesaddfile(name二salesglf1_dat,filename二'd:datasalesglf1_dat.ndf',size二5mb,maxsize二lOOmb,filegrowth二5mb)(name二salesglf2_dat,filename二'd:datasalesglf2_dat・ndf',size二5mb,maxsize二lOOmb,filegrowth二5mb)twofilegroupsales_group1goalterdatabasesales
4、modifyfilegroupsales_group1defaultgosp_helpsalesalterdatabasesalesremovefilesalesglf2_datalterdatabasesalesmodifyfile(name二salesglf1_dat,size二20mb)usesalescreatetableemployeeemployee_idchar(4)notnull,employee_namechar(8)notnull,sexchar(2)notnull,birth_datedatetimenotnull,hire_d
5、atedatetimenotnull,addressvarchar(50)notnull,telphonechar(8)wagesmoneydepartment_idchar(4)notnull,summarytextnotnulldroptablepubs.dbo.aspcreatetablesales,dbo.supplier(supplier_idchar(5)notnull,supplier_namevarchar(50)notnull,1inkman_namevarchar(10)addressvarchar(50)telephonecha
6、r(12)notnull)on[primary]createtablesalarys(姓名varchar(10)基本工资money奖金money总计as基本工资+奖金)createtableautouser(编号intidentity(1,1)notnull,用户代码varchar(18),登陆时间asgetdate()用户名asuser_name())altertableemployee添加电子邮件varchar(20)空去修改表的员工删除列的电子邮件去使用销售将供应商'朝阳路56号’,值CsOOl'华中电子有限公司’,’施宾彬'2636565”)
7、插入sales・dbo.supplier(supplier_id,supplier_name,linkman_name,地址,电话)值CsOOl'华科电子有限公司’,’施宾彬’,’朝阳路56号'2636565”)插入sales・dbo.supplier(suppliername,电话,supplierid)价值观(“韦力电了实业公司’,'4561681's003”)插入sales・dbo.supplier(supplier_id,supplier_name,电话)值('s003'韦力电子实业公司”’4161681”)创建表customer2(cus
8、tomer_idbigint不空身份(0,1),customer_namevarchar(50)不为空,1i