Data and databases - Computer Science IB Study Notes

Overview
# Data and Databases - Cambridge IB Computer Science Summary ## Key Learning Outcomes Students will master the fundamental concepts of relational database design, including entity-relationship modelling, normalisation (up to 3NF), and SQL query construction for data manipulation and retrieval. The course covers data types, structures, and the distinction between primary and foreign keys, emphasising how databases ensure data integrity, reduce redundancy, and support concurrent access. Practical skills include creating efficient database schemas, writing complex SQL queries (SELECT, JOIN, WHERE clauses), and understanding transaction processing and ACID properties. ## Exam Relevance This topic features prominently in both Paper 1 (core content) and the internal assessment, with typical questions requiring students to design ER diagrams, normalise relations, write SQL queries, and evaluate database implementations against real-world scenarios. Candidates must demonstrate both theoretical understanding and practical application skills.
Core Concepts & Theory
Data refers to raw, unprocessed facts and figures without context or meaning. Information is processed data that has been organized and given context, making it meaningful and useful for decision-making.
Databases are organized collections of structured data stored electronically, designed for efficient retrieval, management, and updating. A Database Management System (DBMS) is software that facilitates creating, maintaining, and querying databases.
Key Database Terminology:
Entity - A distinct object or concept about which data is stored (e.g., Student, Product)
Attribute - A characteristic or property of an entity (e.g., StudentName, ProductPrice)
Primary Key - A unique identifier for each record in a table, ensuring no duplicates exist
Foreign Key - An attribute in one table that references the primary key of another table, establishing relationships
Relational Database - Data organized into tables (relations) with rows (records/tuples) and columns (attributes/fields), linked through keys
Flat File Database - A single-table database storing all data in one structure, suitable only for simple applications
Normalization - The process of organizing data to minimize redundancy and dependency, typically through First Normal Form (1NF), Second Normal Form (2NF), and Third Normal Form (3NF)
Data Integrity - Ensuring accuracy, consistency, and reliability of data throughout its lifecycle
Validation - Checking data meets specified rules before entry (e.g., range check, type check)
Verification - Confirming data has been accurately transferred or entered (e.g., double-entry, visual check)
Cambridge Command Words: Define requires precise, concise explanations. Explain demands reasoning with cause-and-effect. Describe needs characteristics without justification.
Detailed Explanation with Real-World Examples
Think of data versus information like ingredients versus a recipe. Raw numbers "25, 12, 2023" are data—meaningless alone. Processed as "25th December 2023" becomes information with context.
Real-World Database Applications:
E-commerce platforms like Amazon use relational databases with entities: Customer, Order, Product, Payment. A customer's order connects through foreign keys—CustomerID in the Order table references the Customer table's primary key. This prevents storing duplicate customer addresses for each order (redundancy reduction).
School Management Systems demonstrate normalization beautifully. Instead of one massive table repeating teacher details for every class they teach, separate tables exist: Teacher (TeacherID, Name, Department), Class (ClassID, Subject, TeacherID). The TeacherID foreign key links them, eliminating data duplication.
Healthcare databases prioritize data integrity. A patient's blood type must validate against permitted values (A, B, AB, O) with + or - modifiers. Verification through double-entry by different medical staff catches critical errors.
Flat files versus relational databases: Imagine a spreadsheet listing students with their courses—each student-course combination repeats student details (name, email, address). This flat file causes update anomalies: changing a student's email requires finding every row they appear in. A relational approach splits this into Student and Course tables linked through an Enrollment table, updating email once.
Primary keys in practice: Your passport number uniquely identifies you globally—it's your primary key in immigration databases. No two people share it, ensuring accurate tracking. Similarly, ISBNs uniquely identify books, preventing confusion between editions.
Memory Aid - ACID properties: Atomicity, Consistency, Isolation, Durability ensure reliable database transactions—like a complete bank transfer (not half-processed).
Worked Examples & Step-by-Step Solutions
**Example 1: Normalization to 3NF** *Question:* Normalize this table to Third Normal Form: | StudentID | StudentName | CourseID | CourseName | InstructorName | |-----------|-------------|----------|------------|----------------| | 101 | Alice | CS101 | Programming | Dr. Smith | | 101 | Alice | MA2...
Unlock 3 More Sections
Sign up free to access the complete notes, key concepts, and exam tips for this topic.
No credit card required · Free forever
Key Concepts
- Data: Raw facts, figures, or pieces of information, like a name, number, or image.
- Database: An organized collection of data, stored and accessed electronically, like a digital filing cabinet.
- Database Management System (DBMS): The software that allows users to create, maintain, and interact with a database.
- Query: A request for information from a database, often phrased as a question the computer understands.
- +6 more (sign up to view)
Exam Tips
- →Always define key terms like 'data', 'database', 'DBMS', 'query', 'table', 'record', and 'field' clearly and concisely.
- →Be ready to provide a real-world example of a database in action (e.g., online shopping, school records, social media) and explain how data is stored and retrieved.
- +3 more tips (sign up)
More Computer Science Notes