1.DB、DBS、DBMS
1)Database(DB):structured collection of “records”。
2)Database System(DBS):specific database + DBMS。
· DBS = DB + DBMS
3)Database Management System(DBMS):manage the database。
2.3 Level Schema Architecture
1)目标:底层修改不应影响高层。
2)External Level:应用层,和用户/应用交互。——VIEW
3)Conceptual Level:逻辑层。——TABLE
4)Internal Level:物理层。——INDEX
3.Database Models
1)Hierarchical Database Model
2)Network Database Model
3)Relational Database Model
4)Object-relational Database Model
5)Object-oriented Database Model
6)XML-based Database Model
4.Relational Database Model
1)Relations:A relation(in the sense of mathematics) is the subset of the Cartesian product of sets.
2)关系型语言:
· Relational Algebra
· Relational Calculus
· SQL
3)SAP HANA is a relational data base management system and supports SQL.
4)Different application architectures and development models are possible with SAP HANA.
· Data Marts with SAP HANA
· Standalone HANA Apps
· HANA as Accelerator(secondary DB)
· HANA as primary Database(for AS ABAP)
5)HANA supports an extended version of SQL.
5.SQL特性
1)SQL is standardized。
2)SQL is descriptive(rather than procedural).
3)SQL execution is optimized.
· SQL statement is first parsed and optimized, and then executed.
4)SQL is multi-set oriented(not single record-based).
6.SQL语言的子语言
1)DML(Data Manipulation Language):SELECT, INSERT, UPDATE, DELETE.
2)DDL(Data Definition Language):CREATE, ALTER, DROP, RENAME.
3)DCL(Data Control Language):GRANT, REVOKE.
7.SQL不是纯粹的关系型
1)主键不是必须的。允许有重复数据。
2)允许NULL。此时“A=A”不一定正确。
3)语言非闭包。
· 结果的顺序与ORDER BY相关。
· 允许匿名结果列。
· 允许重复列名的结果。
8.DB objects
1)Table
2)View
3)Index
4)Constraint
5)Stored procedure
6)Trigger
9.Table
1)表即关系。
2)表由rows和columns组成,是二维的。
10.Key
1)Key:a set of columns,which serves to uniquely identify any row in the table.
2)可以有多个键,但primary key仅有一个,其他作为候选键。
11.Foreign-Key
1)Foreign-Key:set of columns, which is a (primary) key in an (other) table.
2)外键可以引用该表本身。
3)外键不必用相同的名字。
4)外键仅能是其他表的键(允许NULL)。