Database System Concepts (2) -- SQL
来源:互联网 发布:淘宝上有正宗沉香卖吗 编辑:程序博客网 时间:2024/05/06 17:56
SQL stand for Structrue Query Language including:
Data-definition language (DDL): commands for defining relation schemas, deleting relations, and modifying relation schemas
Interactive data -manipulation language (DML): a query language based on both the relational algebra and the typle relational calculus
View definition: commands for defining views
Transaction control: commands for specifying the beginning and ending of transactions
Embedded SQL and dynamic SQL: can be embedded within programming languages
Integrity: commands for specifying integrity constraints that the data stored in the database must satisfy
Authorization: commands for specifying access rights to relations and views
Clauses
DML:
select
from
where
as: 1 rename operation, 2 derived relations
distinct
like: Percent(%) matches any substring, Underscore(_) matches any character
order by: desc, asc
union, union all(retain all duplicates)
intersect, intersect all(retain all duplicates, the number of duplicates that appear in the result is equal to the minimum number of duplicates in both table)
except, except all
avg, min, max, sum, count
group by
having
is null, not null
exists, not exists
unique, not unique
with: define a temporary view
with max-balance(value) as
select max(balance)
from account
select .....
from max-balance......
delete
insert into table-name values or <select clause>
update table-name set
case:
case
when pred1 then result1
when pred1 then result2
end
inner join...on, natural inner join
table1 inner join table2 on attribute
(natural) (full, left, right) outer join...(on)
DDL
create table
drop table
alter table... add(drop)
not null
primary key
create view name as <query expression>, drop view
Data-definition language (DDL): commands for defining relation schemas, deleting relations, and modifying relation schemas
Interactive data -manipulation language (DML): a query language based on both the relational algebra and the typle relational calculus
View definition: commands for defining views
Transaction control: commands for specifying the beginning and ending of transactions
Embedded SQL and dynamic SQL: can be embedded within programming languages
Integrity: commands for specifying integrity constraints that the data stored in the database must satisfy
Authorization: commands for specifying access rights to relations and views
Clauses
DML:
select
from
where
as: 1 rename operation, 2 derived relations
distinct
like: Percent(%) matches any substring, Underscore(_) matches any character
order by: desc, asc
union, union all(retain all duplicates)
intersect, intersect all(retain all duplicates, the number of duplicates that appear in the result is equal to the minimum number of duplicates in both table)
except, except all
avg, min, max, sum, count
group by
having
is null, not null
exists, not exists
unique, not unique
with: define a temporary view
with max-balance(value) as
select max(balance)
from account
select .....
from max-balance......
delete
insert into table-name values or <select clause>
update table-name set
case:
case
when pred1 then result1
when pred1 then result2
end
inner join...on, natural inner join
table1 inner join table2 on attribute
(natural) (full, left, right) outer join...(on)
DDL
create table
drop table
alter table... add(drop)
not null
primary key
create view name as <query expression>, drop view
- Database System Concepts (2) -- SQL
- DATABASE SYSTEM CONCEPTS
- Database System Concepts
- Database System Concepts (1) -- Data Models
- Database System Concepts (4) -- Indexing and Hashing
- [Database System Concepts] My First Virtual Website~
- Database System Concepts (1) -- Data Storage and Querying
- SQL Server system database
- 《Oracle Database Concepts 11g Release 2》读书笔记(2)-table
- 《Oracle Database Concepts 11g Release 2》读书笔记(1)-schema
- SQL语句之alter database/system/session
- 记录单词Oracle database concepts
- Database system
- 1.4. Basic Operating System Concepts
- Database system concept笔记(2)
- Operating System Concepts--chap9 Memory Management;
- Oracle Concepts - SGA System Global Area
- RDBMS and SQL Basic Concepts
- 低端交换机的选购
- mplayer在ARM9(AT91RM9200)上的移植
- java多线程设计模式详解[推荐]
- 经常用到的javaScript技术代码
- java从数据库和服务器硬盘读出并在JSP显示文件
- Database System Concepts (2) -- SQL
- poi读取文件,并获取相应属性 (java操作Excel文件)
- 关于money
- javascript的函数
- GCC lib分类及优缺点
- BizTalk Server 文件后缀含义
- CSS中嵌入脚本+DIV下拉列表
- web.xml元素介绍
- Visual Studio 2005 IDE 技巧和窍门