Analysis, ER Diagrams, Data Dictionaries, Advanced SQL, Testing & Evaluation.
1. Analysis & Design
Analysis
The tasks the users need to perform.
What the database system must do.
- Must store Customer and Booking details.
- Must allow querying of bookings by date.
- Must calculate total costs.
Entity Relationships
Visual map of entities (tables) and relationships.
One-to-Many Relationship (Crow's Foot)
Maps specific instances of data.
- John —
- Ali —
- — Order 1
- — Order 2
Structures
A Primary Key made up of 2 or more attributes. Used to uniquely identify a record when one field isn't enough (often in link entities).
| Attribute | Type | Key | Validation |
|---|---|---|---|
| cust_ID | Int | PK | Required |
| name | Text | Max 50 |
Plan: Fields, Tables, Search Criteria, Sort Order.
2. Implementation (SQL)
Modification
INSERT INTO Customers (name, age)
VALUES ('Bob', 24);
-- UPDATE (Change data)
UPDATE Customers
SET age = 25
WHERE name = 'Bob';
-- DELETE (Remove row)
DELETE FROM Customers
WHERE name = 'Bob';
Wildcards
Used with LIKE for pattern matching.
Many characters
One character
WHERE surname LIKE 'Mc%';
Aggregates
Functions that perform a calculation on a set of values.
3. Advanced SQL & Evaluation
Calc & Alias
Performing math on columns (+ - * /).
Giving a temporary name to a column/calculation.
FROM Products;
Group & Subquery
Used with aggregates to group results by a category.
FROM Items
GROUP BY category;
Using the result of one query inside another.
WHERE price > (
SELECT AVG(price) FROM Items
);
Test & Eval
Comparing Actual Results (what the query output) against Expected Results (what you calculated manually).
-
Fitness for Purpose:
Does the database meet the Functional Requirements? (Can it store/query what was asked?) -
Accuracy of Output:
Is the data correct? Are calculations (sums/averages) precise and correct?