--创建学员信息数据表
use StudentManageDB
go
if exists(select * from sysobjects where name='Students')
drop table Students
go
create table Students
(
StudentId int identity(10000,1),--学号
StudentName varchar(20) not null,--姓名
Gender char(2) not null,--性别
Birthday datetime not null,--出生日期
StudentIdNo numeric(18,0) not null,--身份证号
Age int not null,--年龄
PhoneNumber varchar(50),
StudentAddress varchar(500),
ClassId int not null --班级外键
)
go
--创建班级表
if exists(select * from sysobjects where name='StudentClass')
drop table StudentClass
go
create table StudentClass
(
ClassId int primary key,--班级编号
ClassName varchar(20) not null
)
go
--创建成绩表
if exists(select * from sysobjects where name='ScoreList')
drop table ScoreList
go
create table ScoreList
(
Id int identity(1,1) primary key,
StudentId int not null,--学号外键
CSharp int null,
SQLServer int null,
UpdateTime datetime not null--更新时间
)
go
--创建管理员表
if exists(select * from sysobjects where name='Admins')
drop table Admins
go
create table Admins
(
LoignId int identity(1000,1) primary key,
LoginPwd varchar(20) not null,--登录密码
AdminName varchar(20) not null
)
go

sqlserver创建表的更多相关文章

  1. Oracle、Mysql、SqlServer创建表和给表和字段加注释

    一.Oracle --创建表 create table test (      id varchar2(200) primary key not null,      sort number,     ...

  2. 【转载】Sqlserver在创建表的时候如何定义自增量Id

    在Sqlserver创建表的过程中,有时候需要为表指定一个自增量Id,其实Sqlserver和Mysql等数据库都支持设置自增量Id字段,允许设置自增量Id的标识种子和标识自增量,标识种子代表初始自增 ...

  3. sqlserver -- 解决sqlserver2008“Prevent saving changes that require table re_creation(阻止保存要求重新创建表的更改)”的问题

    电脑重装了sqlserver2008 R2(英文版)后,新建数据表,新建字段,发现有个字段类型设置错了,想修改字段类型,而该表已经保存好了,即保存后修改字段属性.但无法保存修改后的设置,提示“Savi ...

  4. (喷血分享)利用.NET生成数据库表的创建脚本,类似SqlServer编写表的CREATE语句

    (喷血分享)利用.NET生成数据库表的创建脚本,类似SqlServer编写表的CREATE语句 在我们RDIFramework.NET代码生成器中,有这样一个应用,就是通过数据库表自动生成表的CREA ...

  5. 利用.NET生成数据库表的创建脚本,类似SqlServer编写表的CREATE语句

    利用.NET生成数据库表的创建脚本,类似SqlServer编写表的CREATE语句 (喷血分享)利用.NET生成数据库表的创建脚本,类似SqlServer编写表的CREATE语句 在我们RDIFram ...

  6. SqlServer创建数据表描述及列描述信息

    SqlServer创建数据表描述及列描述信息 Intro Q: 为什么要创建描述信息? A: 鼠标悬停在对应表和列上时,会出现描述信息,可以提高工作的效率,借助工具我们根据数据表可以生成Model,可 ...

  7. 【SqlServer】【问题收集】阻止保存要求重新创建表的更改

    1   概述 阻止保存要求重新创建表的更改,场景是这样的:假设数据库中有一张员工表EmployeeInfo,如下所示: 其中有个字段EmployeeBirthday,在设计表时,其类型误设为VARCH ...

  8. 【转载】Sqlserver阻止保存要求重新创建表的更改

    在Sqlserver创建完表table后,后续维护过程中有时候需要往表格中新增字段,在表设计窗体中新增字段后保存,有时候会直接抛出错误信息,提示“不允许保存更改,您所做的更改要求删除并重新创建以下表” ...

  9. PowerDesigner创建表 拷贝创建表语句 SQLSERVER创建数据库 使用查询 创建表 并且添加数据

    PowerDesigner创建表 : 1.双击打开PowerDesigner   2.双击打开Create model 3左键点击Model  types,再点击Physical    Data  m ...

随机推荐

  1. linux解压缩命令之unzip,tar(持续更新)

    unzip apache-tomcat-7.0.78.zip -d /usr/local/src/ 解压zip压缩包到/usr/local/src,-d就是指定解压路径的意思

  2. centos7和linux防火墙配置入门

    linux部分 iptables -L    列出当前防火墙策略 iptables -F   清空防火墙策略 iptables -P INPUT  DROP   默认设置丢弃进来的流量包(-p指默认策 ...

  3. haproxy httpcheck with basic auth

    一个简单的需求,就是需要在 haproxy 的 httpcheck 使用 basic 认证,解决方法 base64 编码username 以及密码 echo -n "my_username: ...

  4. C# to IL 7 Pointers(指针)

    Pointers are the heart and soul of a programming language. The only reason why the Cprogramming lang ...

  5. Zabbix-2.4-安装-4

    Zabbix api 对于以上两种方式,有些人都不选,倾向于使用第三种:使用zabbix api加上这个监控在把这台机器删除了,然后discovery和自动注册的都关闭了再换一种方式把它加进去,zab ...

  6. 获取当前 服务 路径 .net

    using System; //例如 AppDomain.CurrentDomain.BaseDirectory + "\\Setting.ini";

  7. MySQL 建表语句 create table 中的列定义

    MySQL 建表语句 create table 中的列定义: column_definition: data_type [NOT NULL | NULL] [DEFAULT default_value ...

  8. 微信小程序 学习资料

    微信小程序 学习资料 资料名称 网址 官方教程 https://developers.weixin.qq.com/miniprogram/dev/index.html?t=18110517

  9. spring-boot-dependencies jar 不完整的问题

    集成 springboot 有两种方式. 1 直接 父项目指向  springboot <parent> <groupId>org.springframework.boot&l ...

  10. java-plupload上传大文件

    参考链接: https://blog.csdn.net/hjf_1291030386/article/details/74784172 https://www.cnblogs.com/tengyunh ...