Computer Science · Theme A: Concepts of computer science
A3.2 — Database design
Computer Science · SL / HL · syllabus-mapped notes
CS_A3.2.1
Database schemas
Conceptual, logical and physical schemas as abstractions at different levels.
Full note — freeA schema is an abstract definition of the structure and organization of the data. You must be able to describe the three levels, from most abstract to most concrete. Conceptual schema : a high-level, technology-independent view of the entities, attributes and relationships (what data the system holds, for the whole organization). Logical schema : the design mapped onto the relational model, defining tables, columns, keys and relationships, but not tied to a specific product. Physical schema : how the data is actually stored on the system, including files, indexes, data types and access paths for a particular database engine. Each level is a more detailed abstraction of the one above, letting designers reason about meaning, structure and storage separately.
CS_A3.2.2
Constructing ERDs
Entities, relationships, and the roles of cardinality and modality.
An entity relationship diagram (ERD) models the entities in a system and the relationships between them. ERDs matter because they help craft organized, efficient database designs tailored to a specific application before any tables are built. Entities and relationships An entity is a real-world thing …
CS_A3.2.3
Data types in relational databases
Common data types, why consistency matters, and effects of a wrong type.
A data type defines the kind of value a column can hold. You must be able to outline the common types and why the choice matters. Integer (whole numbers), decimal / float (numbers with a fractional part), char / varchar / text (fixed or variable …
CS_A3.2.4
Constructing tables
Primary, foreign, composite and concatenated keys for well-defined tables.
You must be able to construct tables and link them with keys so the design has strong data integrity (well-defined tables prevent invalid or contradictory data). Primary key : uniquely identifies each row in its table. Foreign key : a column that references another table's …
CS_A3.2.5
Difference between normal forms
1NF, 2NF, 3NF and the dependency terms behind normalization.
Normalization organizes columns into tables to reduce redundancy and dependency problems. You must be able to explain the difference between the three normal forms. First normal form (1NF) : every value is atomic (no repeating groups or lists in a cell) and each row is …
CS_A3.2.6
Normalizing to 3NF
Building a 3NF design for a real-world scenario, step by step.
You must be able to construct a database normalized to 3NF for a real-world scenario (for example library, hospital, e-commerce, school, employee, inventory or police crime reporting). Worked example: library management 1NF : split any repeating group. A Loan row listing several books becomes one …
CS_A3.2.7
The need for denormalization
Weighing read performance against redundancy risk.
Denormalization deliberately reintroduces redundancy into a normalized design. You must be able to evaluate when this is worthwhile. Faster reads : pre-joining or duplicating data means fewer joins, helping read-intensive applications and reporting. Simpler queries : fewer tables to combine makes queries shorter and easier …
