CHAPTER 8: DATABASE CONCEPTS AND MANAGEMENT

8.1 DATABASE CONCEPTS

8.1.1 Limitations of File-Based Systems

Disadvantages:

8.1.2 Database Approach

Database:

DBMS (Database Management System):

8.1.3 Relational Database Terminology

Term Definition
Entity Object/event that can be distinctly identified
Table Contains related entities in rows and columns
Tuple Row/record in relational database
Attribute Field/column in relational database
Primary Key Attribute that uniquely identifies each tuple
Candidate Key Attribute that can potentially be primary key
Foreign Key Attribute that relates two different tables
Secondary Key Candidate key not chosen as primary
Referential Integrity Prevents inconsistent data in relationships

8.1.4 Entity-Relationship Diagrams

Relationships:

8.2 DATABASE MANAGEMENT SYSTEMS (DBMS)

8.2.1 Features of DBMS

Data Management:

Data Dictionary:

Data Modelling:

Logical Schema:

Data Integrity:

Data Security:

Data Change Handling:

Deadlock:

8.2.2 DBMS Tools

Developer Interface:

Query Processor:

8.3 NORMALIZATION

8.3.1 First Normal Form (1NF)

Requirements:

8.3.2 Second Normal Form (2NF)

Requirements:

8.3.3 Third Normal Form (3NF)

Requirements:

8.3.4 Many-to-Many Relationships

8.4 SQL (STRUCTURED QUERY LANGUAGE)

8.4.1 Data Definition Language (DDL)

CREATE DATABASE:

<SQL>

CREATE DATABASE database-name

CREATE TABLE:

<SQL>

CREATE TABLE table-name (
field1 data-type,
field2 data-type,
...
)

ALTER TABLE:

<SQL>

ALTER TABLE table-name ADD field-name data-type

PRIMARY KEY:

<SQL>

PRIMARY KEY (field)

FOREIGN KEY:

<SQL>

FOREIGN KEY (field) REFERENCES table(field)

8.4.2 Data Manipulation Language (DML)

SELECT (Query):

<SQL>

SELECT field-name
FROM table-name
WHERE condition

Operators: =, >, <, >=, <=, <>, IS NULL

ORDER BY: Sort ascending

<SQL>

ORDER BY field-name

GROUP BY: Group identical data

<SQL>

GROUP BY field-name

INNER JOIN: Combine fields from different tables

<SQL>

INNER JOIN table ON condition

INSERT:

<SQL>

INSERT INTO table (field1, field2)
VALUES (value1, value2)

DELETE:

<SQL>

DELETE FROM table WHERE condition

UPDATE:

<SQL>

UPDATE table
SET field = value
WHERE condition

Data Types:


Revision #1
Created 2026-03-16 12:03:00 UTC by Samuel Lee
Updated 2026-03-16 12:03:15 UTC by Samuel Lee