🌍 Data Science · subject
Data Science Databases Syllabus
The Databases syllabus for Data Science in full: 7 chapters, 25 topics and 68 sub-topics, every one listed below, plus 50 Databases flashcards with answers.
Databases syllabus: all 7 chapters
Expand any chapter to see its topics and sub-topics.
-
Introduction to Databases
2 topics- What is a Database?
- Definition and Purpose
- Database vs. Spreadsheet
- Types of Databases
- Database Models
- Relational Model
- NoSQL Models
- Object-Oriented Model
- Hierarchical Model
- Network Model
- What is a Database?
-
Relational Databases
4 topics- Fundamentals of Relational Databases
- Tables, Rows, and Columns
- Primary and Foreign Keys
- Relationships and Normalization
- SQL (Structured Query Language)
- Basic SQL Commands
- Advanced SQL Queries
- Joins and Subqueries
- Indexes and Performance Tuning
- Database Design
- Entity-Relationship Diagrams
- Normalization Techniques
- Denormalization
- Transaction Management
- ACID Properties
- Isolation Levels
- Concurrency Control
- Fundamentals of Relational Databases
-
NoSQL Databases
5 topics- Introduction to NoSQL
- What is NoSQL?
- Types of NoSQL Databases
- Use Cases for NoSQL
- Document-Oriented Databases
- MongoDB
- CouchDB
- Key-Value Stores
- Redis
- Riak
- Column-Family Stores
- Cassandra
- HBase
- Graph Databases
- Neo4j
- OrientDB
- Introduction to NoSQL
-
Big Data and Distributed Databases
4 topics- Introduction to Big Data
- Characteristics of Big Data
- Big Data Technologies
- Hadoop Ecosystem
- HDFS
- MapReduce
- Hive
- Pig
- Spark
- Introduction to Spark
- Spark SQL
- Spark Streaming
- Distributed Databases
- CAP Theorem
- Data Partitioning and Sharding
- Consistency Models
- Introduction to Big Data
-
Data Warehousing
4 topics- Introduction to Data Warehousing
- Definition and Purpose
- Data Warehouse vs. Database
- ETL (Extract, Transform, Load)
- ETL Process
- ETL Tools
- Data Warehouse Design
- Star Schema
- Snowflake Schema
- Fact and Dimension Tables
- OLAP (Online Analytical Processing)
- OLAP Cubes
- ROLAP vs. MOLAP
- Introduction to Data Warehousing
-
Database Security
3 topics- Introduction to Database Security
- Importance of Security
- Common Threats
- Security Mechanisms
- Authentication and Authorization
- Encryption
- Auditing and Monitoring
- Compliance and Regulations
- GDPR
- HIPAA
- SOX
- Introduction to Database Security
-
Advanced sub-topics
3 topics- Data Integration
- Data Lakes
- Data Virtualization
- Database Performance Tuning
- Query Optimization
- Indexing Strategies
- Caching Mechanisms
- Machine Learning with Databases
- In-Database Machine Learning
- Integration with ML Libraries
- Data Integration
Data Science Databases flashcards — 50 questions with answers
What is a database?
An organized, structured collection of data stored electronically so it can be efficiently accessed, managed, queried and updated, typically controlled by a Database Management System (DBMS).
What is a DBMS, and what core functions does it provide?
A Database Management System is software that mediates between users/applications and the stored data. It provides data definition, storage, retrieval (querying), concurrency control, security/access control, backup/recovery and integrity enforcement.
List the main database models and one defining trait of each.
Hierarchical (tree, parent-child), Network (graph of records with sets), Relational (tables/relations with keys), Object-oriented (objects), Document, Key-Value, Column-Family and Graph (NoSQL families).
In the relational model, define a relation, a tuple, and an attribute.
A relation is a table; a tuple is a row (a single record); an attribute is a column (a named field). The number of attributes is the degree and the number of tuples is the cardinality.
What is a primary key, and what two constraints must it satisfy?
A primary key is an attribute (or set of attributes) that uniquely identifies each tuple in a relation. It must be unique (no two rows share a value) and not null (entity integrity).
What is a foreign key and what integrity rule does it enforce?
A foreign key is an attribute in one relation that references the primary key of another relation. It enforces referential integrity: a foreign-key value must either match an existing primary-key value or be null.
Distinguish a candidate key, primary key, and a superkey.
A superkey is any set of attributes that uniquely identifies a tuple. A candidate key is a minimal superkey (no removable attribute). The primary key is the candidate key chosen as the main identifier; remaining candidate keys are alternate keys.
What are the four sublanguages of SQL and their purpose?
DDL (Data Definition: CREATE, ALTER, DROP), DML (Data Manipulation: INSERT, UPDATE, DELETE), DQL (Data Query: SELECT), and DCL/TCL (Data/Transaction Control: GRANT, REVOKE, COMMIT, ROLLBACK).
In SQL, what is the logical evaluation order of the clauses FROM, WHERE, GROUP BY, HAVING, SELECT, ORDER BY?
FROM (and JOINs) → WHERE → GROUP BY → HAVING → SELECT → ORDER BY. WHERE filters rows before grouping; HAVING filters groups after aggregation.
Name the four main SQL join types and what each returns.
INNER JOIN returns only matching rows; LEFT (OUTER) JOIN returns all left rows plus matches; RIGHT JOIN returns all right rows plus matches; FULL OUTER JOIN returns all rows from both sides, with nulls where no match exists.
Differentiate WHERE from HAVING in SQL.
WHERE filters individual rows before aggregation and cannot use aggregate functions; HAVING filters groups after GROUP BY and can use aggregates such as COUNT, SUM and AVG.
List the five core SQL aggregate functions.
$\text{COUNT}$, $\text{SUM}$, $\text{AVG}$, $\text{MIN}$ and $\text{MAX}$. They compute a single summary value over a set of rows, often combined with GROUP BY.
What is the goal of normalization in database design?
To organize attributes and relations to reduce data redundancy and eliminate insertion, update and deletion anomalies, by decomposing tables based on functional dependencies.
State the requirement of First Normal Form (1NF).
Every attribute must hold a single atomic (indivisible) value, with no repeating groups or arrays; each row must be uniquely identifiable.
State the requirement of Second Normal Form (2NF).
The relation must be in 1NF and have no partial dependency: every non-key attribute must depend on the whole composite primary key, not just part of it.
State the requirement of Third Normal Form (3NF).
The relation must be in 2NF and have no transitive dependency: non-key attributes must depend only on the primary key, not on other non-key attributes.
What is Boyce-Codd Normal Form (BCNF)?
A stricter form of 3NF in which, for every non-trivial functional dependency $X \to Y$, $X$ must be a superkey. It removes anomalies 3NF can still allow when there are multiple overlapping candidate keys.
In an ER diagram, what is the difference between an entity and an attribute?
An entity is a real-world object or concept about which data is stored (becomes a table); an attribute is a property describing an entity (becomes a column). A relationship links entities.
What do the cardinality ratios 1:1, 1:N, and M:N represent in ER modeling?
They describe how many instances of one entity relate to another: one-to-one, one-to-many, and many-to-many. An M:N relationship is implemented with a junction/bridge table holding two foreign keys.
What are the four ACID properties of a transaction?
Atomicity (all-or-nothing), Consistency (valid state to valid state), Isolation (concurrent transactions don't interfere), and Durability (committed changes survive failures).
Show the other 30 Databases flashcards
Define a database transaction.
A single logical unit of work consisting of one or more operations that must execute completely or not at all, ending with either COMMIT (make permanent) or ROLLBACK (undo).
List the four SQL transaction isolation levels from weakest to strongest.
Read Uncommitted, Read Committed, Repeatable Read, and Serializable. Higher levels prevent more concurrency anomalies but reduce concurrency/performance.
Match each concurrency anomaly to its cause: dirty read, non-repeatable read, phantom read.
Dirty read: reading uncommitted data from another transaction. Non-repeatable read: a re-read row has changed (update). Phantom read: a re-run query returns new/removed rows (insert/delete).
What does the CAP theorem state about distributed data systems?
A distributed system can simultaneously guarantee at most two of Consistency, Availability and Partition tolerance. Since network partitions are unavoidable, real systems trade off C versus A during a partition (CP or AP).
How does NoSQL generally differ from relational databases in schema and scaling?
NoSQL is typically schema-flexible (schema-on-read) and scales horizontally across commodity nodes, often favoring availability and eventual consistency, whereas relational databases use fixed schemas, ACID transactions and scale mostly vertically.
What is the BASE model often associated with NoSQL?
Basically Available, Soft state, Eventual consistency. It relaxes strict ACID guarantees to favor availability and partition tolerance in distributed systems.
What is eventual consistency?
A consistency model in which, given no new updates, all replicas will converge to the same value over time, though reads may temporarily return stale data.
Name the four major NoSQL data-store categories.
Document-oriented, Key-Value, Column-Family (wide-column), and Graph databases.
What is a document-oriented database and what data format does it typically use?
A NoSQL store that holds data as self-describing documents (typically JSON, BSON or XML), where each document is a flexible, nested key-value structure. Example: MongoDB. Documents are grouped in collections.
What is a key-value store and what is its main strength?
The simplest NoSQL model, storing data as unique key to opaque value pairs. Its strength is extremely fast $O(1)$ lookups, inserts and deletes by key. Examples: Redis, DynamoDB, Riak.
What is a column-family (wide-column) store?
A NoSQL model that stores data in rows grouped into column families, where columns are stored together on disk and rows can have different columns. Optimized for fast reads/writes over huge sparse datasets. Examples: Cassandra, HBase.
Why does column-oriented storage speed up analytical queries?
Because values of a single column are stored contiguously, analytical scans read only the needed columns (less I/O) and achieve better compression since similar values are adjacent.
What is a graph database and what two primitives does it model?
A NoSQL database that stores data as nodes (entities) and edges (relationships), often with properties on both. It excels at traversing connected data. Examples: Neo4j, Amazon Neptune.
When are graph databases preferable to relational databases?
When relationships are first-class and queries involve deep or variable-length traversals (social networks, recommendation engines, fraud detection), avoiding expensive repeated joins.
Define Big Data using the classic "3 Vs".
Volume (huge amounts of data), Velocity (high speed of generation/processing), and Variety (structured, semi-structured and unstructured formats). Often extended with Veracity (trustworthiness) and Value.
What two core components form the foundation of Apache Hadoop?
HDFS (Hadoop Distributed File System) for distributed storage, and MapReduce (with YARN for resource management) for distributed processing.
What are the two phases of the MapReduce programming model?
The Map phase transforms input into intermediate key-value pairs; the Reduce phase aggregates all values sharing a key. A shuffle-and-sort step groups intermediate pairs by key between them.
In HDFS, what is the role of the NameNode versus the DataNode?
The NameNode is the master that stores filesystem metadata (the namespace and block locations); DataNodes are workers that store the actual data blocks and serve read/write requests.
What is the default replication factor in HDFS and why is it used?
The default replication factor is $3$: each block is stored on three nodes to provide fault tolerance and data availability if a node fails.
What is YARN's role in the Hadoop ecosystem?
YARN (Yet Another Resource Negotiator) is Hadoop's cluster resource manager and job scheduler, separating resource management from processing so multiple engines (MapReduce, Spark) can share the cluster.
What is Apache Spark and how does its core data structure differ from MapReduce?
Spark is a distributed in-memory processing engine. Its core abstraction is the RDD (Resilient Distributed Dataset), an immutable, partitioned, fault-tolerant collection. By keeping data in memory it is far faster than disk-based MapReduce for iterative work.
Differentiate transformations from actions in Spark.
Transformations (e.g. map, filter, join) are lazy and build a lineage of a new RDD/DataFrame without computing. Actions (e.g. collect, count, save) trigger actual execution of the lineage and return a result.
How does Spark achieve fault tolerance for RDDs?
Through lineage: each RDD records the sequence of transformations that built it, so lost partitions can be recomputed from the source rather than relying solely on replication.
What is data partitioning (sharding) in a distributed database?
Splitting a dataset horizontally across multiple nodes by a shard/partition key so each node holds a subset, enabling horizontal scaling of storage and load.
Distinguish replication from partitioning (sharding).
Replication copies the same data to multiple nodes for availability and read scaling/fault tolerance; partitioning (sharding) splits different data across nodes for write scaling and capacity. They are often combined.
What is a data warehouse and how does it differ from an operational (OLTP) database?
A data warehouse is a subject-oriented, integrated, time-variant, non-volatile repository optimized for analytical queries (OLAP) over historical data. OLTP databases are optimized for fast, frequent, current-state read/write transactions.
Contrast OLTP with OLAP.
OLTP (Online Transaction Processing): many short read/write transactions on current data, normalized schema. OLAP (Online Analytical Processing): complex read-heavy aggregations over large historical datasets, denormalized/star schema.
What are the three steps of ETL?
Extract data from source systems, Transform it (clean, validate, deduplicate, aggregate, reformat to the target schema), and Load it into the target data warehouse.
How does ELT differ from ETL and why has it become popular?
In ELT, raw data is Extracted and Loaded into the target first, then Transformed using the warehouse's own compute. It suits cloud warehouses and data lakes with cheap, scalable storage and processing, and preserves raw data for flexible later transformation.
Contrast a star schema with a snowflake schema in data warehouse design.
A star schema has a central fact table linked to denormalized dimension tables (simple, fast queries). A snowflake schema normalizes the dimensions into related sub-tables (less redundancy, more joins, slightly slower queries).
Data Science Databases FAQ
What is in the Data Science Databases syllabus?
Data Science Databases is split into 7 chapters: Introduction to Databases, Relational Databases, NoSQL Databases, Big Data and Distributed Databases, Data Warehousing, Database Security and Advanced sub-topics. Together they contain 25 topics and 68 sub-topics.
How many chapters are in Data Science Databases?
7 chapters, containing 25 topics and 68 sub-topics. The largest chapter is NoSQL Databases, with 5 topics.
Are there flashcards for Data Science Databases?
Yes — a 50-card Databases deck, printed in full in the flashcards section of this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.