(二) SQL语句 模糊查询 空值处理 聚合函数 自己学习笔记,转载请注明出处,谢谢! 酸菜 SQL :结构化查询语言(Structured Query Language),关系数据库管理系统的标准语言. Sybase与Mircosoft对标准SQL做了扩展:T-SQL (Transact-SQL) ...
分类:
数据库 时间:
2017-04-03 22:51:21
阅读次数:
360
(1) 主键约束:PRIMARY KEY 实例 (2) 外键约束:FOREIGN KEY 实例 (3) 非空约束:NOT NULL 实例 (4) 默认约束:DEFAULT 实例 (5) 唯一性约束:QNIQUE 实例 (6) 属性值自动增加:AUTO_INCREMENT 实例 ...
分类:
数据库 时间:
2017-04-03 22:10:16
阅读次数:
243
第一节一、相关概念1. Data:数据,是数据库中存储的基本对象,是描述事物的符号记录。2. Database:数据库,是长期储存在计算机内、有组织的、可共享的大量数据的集合。3. DBMS:数据库管理系统,是位于用户与操作系统之间的一层数据管理软件,用于科学地组织、存储和管理数据、高效地获取和维护... ...
分类:
数据库 时间:
2017-04-01 21:06:13
阅读次数:
318
-- 禁用外键约束 SET FOREIGN_KEY_CHECKS=0; -- 删除数据 truncate table stockTBL; -- 启动外键约束 SET FOREIGN_KEY_CHECKS=1; -- 查看当前FOREIGN_KEY_CHECKS的值,可用如下命令: SELECT @@... ...
分类:
数据库 时间:
2017-04-01 21:03:28
阅读次数:
197
1.HAWQ 是不支持主键和外建的,官方文档明确给出 Notes Using OIDs in new applications is not recommended. Avoid assuming that OIDs are unique across tables; if you need a d ...
分类:
其他好文 时间:
2017-03-24 17:29:34
阅读次数:
173
The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ag ...
分类:
其他好文 时间:
2017-03-19 10:57:55
阅读次数:
178
使用工具:LINQPad4 1.准备数据表 Customer(顾客表)-- Id(自增主键)Name(顾客姓名)Phone(顾客联系方式) CREATE TABLE [dbo].[Customer]( [Id] [int] IDENTITY(1,1) NOT NULL, [Name] [nvarch ...
分类:
数据库 时间:
2017-03-18 00:46:07
阅读次数:
184
无聊的计算姬 Description Input Output Sample Input 6 2 2 3 4 3 2 7 9 2 1 2 9 3 1 6 7 1 5 3 7 1 9 2 8 Sample Output Math Error 3 Math Error 6 6 1 HINT Source ...
分类:
其他好文 时间:
2017-03-16 19:01:14
阅读次数:
150
在Mysql中删除一张表或一条数据的时候,出现 [Err] 1451 -Cannot delete or update a parent row: a foreign key constraint fails (...) 这是因为MySQL中设置了foreign key关联,造成无法更新或删除数据。 ...
分类:
数据库 时间:
2017-03-16 18:35:02
阅读次数:
198
1、创建并命名外键 alter table OrderDetails add constraint fk_oderId foreign key (OrderId) references orders(OrderId);alter table OrderDetails add constraint f ...
分类:
数据库 时间:
2017-03-16 16:03:21
阅读次数:
274