RDBMS Must Know


Concepts

key

composite/compound key

  • a key that has more than 1 attribute

super key

  • set of 1 or more attribute which can uniquely identify a row
  • sets has redundant attributes
  • sets don’t have redundant attributes

candidate key

primary key

  • determined by DBA (DB Admin)
  • is a candidate key
  • unique identifier of rows
  • no duplicate values
  • not NULL
  • can be 1 or more attributes

alternate key

  • all non-primary candidate keys

foreign key

  • cross-reference between tables
  • points to (same attribute name) primary/candidate keys of another table

DBMS-key

Indexing

  • Primary Index
    • Dense Index
      • 1 key : 1 row
    • Sparse Index
      • 1 key : n rows
  • Secondary Index
    • 1 1st key : n 2nd key
    • 1 2nd key : n rows
  • Multilevel Index
    • 2nd index -> nth indexes
  • Clustering Index
  • B+ Tree Index

indexing

Dense Index
dense-indexing

Sparse Index
sparse-indexing

Multilevel Index
multilv-indexing

Clustering Index
cluster-indexing

Comparison
indexing-compare

B+ Tree Index

  • fast search
    • tree height is less than BST, less hard disk random access operation
    • each level sibling nodes are linked
      bpt-indexing

DBMS Architecture

3-tier architecture

  • User/Presentation Tier (client)
  • App/Middle Tier (server)
  • Database/Data Tier (DB)

DBMS-key

DBMS Data Model

  • Entity-Relationship Model (ER Diagram)
    • DBMS Generalization
    • DBMS Specialization
  • Relational Model

ER

relational

DBMS Schema/Data Abstraction

  • Physical
    • DB actual hardware storage schema
  • Logical
    • DB schema, i.e. table schema
  • View
    • DBMS UI

schemas

Joins

joins1

joins2

Transaction & Concurrency


Author: Zijun Zhou
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint policy. If reproduced, please indicate source Zijun Zhou !
  TOC