or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
資料庫系統概論––曾新穆
ER-Mod****el
Relational Data Model ( Ted Codd )
Before = Network Data Model (Cobol ans DDL, DML)
Very contentious: Database Wars (Charlie Bachman vs. Mike Stonebraker) -> Postgres->IIIustra->Informix->IBM
1st prototypes:
Ingres -> CA
Postgres -> IIIustra -> Informix -> IBM
System R -> Oracle, DB2
Why Relations?
Math:
sets: R = {1,2,3} S = {3,4}
A relation on R, S is any subset U R x S (e.g: {(1,4), (3,4)} )
DB:
Branch = {A, B, …}
Accounts = { a, b, …}
=> A U B = A x B ( e.g: {(A,a) (A,b) (A,…) (B,a) (B,b) (B, …) } )
Keys and Relations
Key can map to Relations
Candidate key
=> Primary key <–> Composite key
=> Super key
(Key can also check integrity constraints)
Key Reference: Wiki
Enhanced ER Modle (EER) (ch13)
entity type include one or more distinct subgroupings of its occurences
distinct subgrouping of occurrences of an entity type
The process of maximizing the differences between members of an entity by identifying their distinguishing characteristics
The process of maximizing the differences between entities by identifying their common characteristics
(img source: http://goo.gl/TyMvRM)
(img source: http://goo.gl/xfxD9K)
The Relational Model (ch4)
Overview
Terminology
Key
(URL : http://www.mysql.tw/2015/04/super-keycandidate-keyprimary.html )
ex. {(a,b,c,d,e)}
R = {R1,R2,R3…}
Relational Algebra and Relational Calculus (ch5)
work on relation to define another relation without changing the original relations
operands and results are relations
nesting
5 Basic operations
Other operations
DivisionSelection
Projection
Union
Set difference
Intersection
Cartesian product
Join
Theta join
Equijoin (theta join with operator only is =)

Natural join
Outer join
Semijoin
Division (/)
Aggregate Operations
Grouping Operation
SQL (ch6)
*
FROM TableName[alias][,…]
[WHERE condition]
[GROUP BY columnList][HAVING condition]
[ORDER BY columnList]
Objectives (CH7)
sex CHAR NOT NULL
CHECK(sex IN('M','F')
CREATE DOMEAIN DomainName[AS] dataType
[DEFAULT defaultOption]
[CHECK (searchCondition)]
[CHECK (searchCondition)]
CREATE DOMAIN DOMAIN SexType AS CHAR
CHECK(VALUE IN('M','F'));
sex SexType NOT NULL
CREATE ASSERTION
CREATE ASSERTION j bn
catalogs
schema (no include data: table,view,doman)
CREATE ACHEMA [Name | AUTHORIZATION Creatorld]
DROP SCHEMA Name [RESTRICT | CASCADE]
CREATE DOMAIN OwnerNiumber AS VARCHAR(5)
CHECK(VALUE IN(SELECT ownerNo FROM PrivateOwner));
CREATE DOMAIN StaffNumber AS VARCHAR(5)
CREATE VIEW ViewName [ (newColumnName[])]
AS subselect
[WITH [CASCADED | LOCAL] CHECK OPTION]
Normalization(CH14)
Objectives(CH15)
Query Processing(CH23)
Transaction
ACID