Create one-page summaries for each major topic:
┌─────────────────────────────────────┐
│ DBMS ARCHITECTURE │
├─────────────────────────────────────┤
│ • Single-tier: Application + DB on │
│ same machine │
│ │
│ • Two-tier: Client ↔ Server │
│ - Client: UI + Application logic │
│ - Server: Database │
│ │
│ • Three-tier: │
│ - Presentation (UI) │
│ - Application (Business Logic) │
│ - Database (Data Storage) │
│ │
│ ADVANTAGES: │
│ • Data independence │
│ • Data integrity │
│ • Concurrent access │
│ • Security │
│ • Reduced redundancy │
└─────────────────────────────────────┘
┌─────────────────────────────────────┐
│ NORMALIZATION │
├─────────────────────────────────────┤
│ • 1NF: Atomic values, no repeating │
│ groups │
│ │
│ • 2NF: In 1NF + no partial │
│ dependencies on PK │
│ │
│ • 3NF: In 2NF + no transitive │
│ dependencies │
│ │
│ • BCNF: For every FD X→Y, X must be │
│ a superkey │
│ │
│ FUNCTIONAL DEPENDENCY (FD): │
│ • X→Y means Y is functionally │
│ dependent on X │
│ • If we know X, we know Y │
└─────────────────────────────────────┘
┌─────────────────────────────────────┐
│ PL/SQL ESSENTIALS │
├─────────────────────────────────────┤
│ STRUCTURE: │
│ DECLARE │
│ -- Variable declarations │
│ BEGIN │
│ -- Executable statements │
│ EXCEPTION │
│ -- Exception handlers │
│ END; │
│ │
│ TRIGGER SYNTAX: │
│ CREATE [OR REPLACE] TRIGGER name │
│ {BEFORE|AFTER|INSTEAD OF} event │
│ ON table_name │
│ [FOR EACH ROW] │
│ [WHEN condition] │
│ BEGIN │
│ -- trigger body │
│ END; │
│ │
│ FUNCTION vs PROCEDURE: │
│ • Function MUST return a value │
│ • Procedure does NOT return value │
└─────────────────────────────────────┘
┌─────────────────────────────────────┐
│ CURSOR ATTRIBUTES │
├─────────────────────────────────────┤
│ • %ISOPEN: TRUE if cursor is open │
│ • %FOUND: TRUE if row was fetched │
│ • %NOTFOUND: TRUE if no row fetched │
│ • %ROWCOUNT: Number of rows fetched │
│ │
│ EXPLICIT CURSOR: │
│ DECLARE │
│ CURSOR cur_name IS select_stmt; │
│ BEGIN │
│ OPEN cur_name; │
│ FETCH cur_name INTO variables; │
│ CLOSE cur_name; │
│ END; │
│ │
│ IMPLICIT CURSOR: │
│ • Automatically created for DML │
│ • Referenced as SQL%attribute │
└─────────────────────────────────────┘
Connect related concepts to strengthen memory: