Unity复习之键的约束
来源:互联网 发布:淘宝图片搜索商品 编辑:程序博客网 时间:2024/05/16 10:52
欢迎大家来到我的博客http://unity.gopedu.com/home.php?mod=space&uid=3352&do=blog&view=me&from=space
给表添加键的约束
--增加一列
alter table teacher add age int null
alter table users add age int null
--更改列类型
alter table teacher alter column age varchar(3)
alter table users alter column age varchar(3)
--删除一列
alter table teacher drop column age
alter table users drop column age
--为teacher表添加主键约束
alter table teacher add constraint t_pk primary key(id)
--为teacher表的name添加唯一约束
alter table teacher add constraint t_un unique(name)
--为teacher表的sex添加默认约束
alter table teacher add constraint t_de default('男') for sex
insert into teacher(id,name) values(101,'aa')
--为teacher表的age添加检查约束
alter table teacher add constraint t_ch check(age>=15 and age<=40)
insert into teacher(id,name,age) values(102,'bb',50)
--为teacher和users表添加主外关联
alter table score add constraint t_fk foreign key(uid) references users(id)
insert into score(id,grade,uid) values(1,85,110)
--删除约束
alter table score drop constraint t_fk
请继续关注我的博客
http://unity.gopedu.com/home.php?mod=space&uid=3352&do=blog&view=me&from=space
更多精彩尽在http://www.gopedu.com/
- Unity复习之键的约束
- unity之复习
- Unity之GUI复习
- Unity之射线复习
- unity之列的基本操作和约束
- Unity之列的基本操作和约束
- unity之复习数据库的增删改查
- unity之继承的复习和多态的复习还有抽象类
- 复习记录:mysql innodb 外键约束
- Unity复习之SQL语句基础查询
- Unity复习之SQL高级查询
- unity复习
- MySQL的外键约束之级联删
- Unity两日半复习
- 复习回顾Unity
- Unity第二关复习
- Unity 复习要点
- c# 泛型中类型参数约束 之 主约束的解读
- 【博客分享】优秀的有趣的博客
- Python基础学习篇—列表(list)
- BZOJ 1941 SDOI 2010 Hide and Seek K-D树
- RadHat 配置XDMCP
- 【BZOJ1941】【SDOI2010】Hide and Seek、KDTree【数组版】 模板、
- Unity复习之键的约束
- 4.1编写函数strindex(s,t)它返回字符串t在s中最右边出现的位置。如果s中不包含t,则返回-1。
- 设置eclipse字体大小
- 退出所有activity的方法
- Cocos2d-x手机游戏开发C编程基础---笔记一
- 服务(Service)的停止和启动
- unity3D__ArrayList和迭代器IEnumerator
- C++不允许使用指向不完整类型的指针
- JAVA正则表达式语法大全