A beginner-friendly learning repository for practicing relational database management system (RDBMS) fundamentals, with a strong focus on normalization.
This repo contains short topic-wise notes in .ts files (written as commented explanations) to help you build a strong conceptual foundation before writing SQL schemas in real projects.
This repository is for:
- Practicing core database concepts step by step
- Understanding how good relational design is created
- Learning why normalization matters for data integrity
- Reviewing key topics quickly before interviews, exams, or projects
- What a database is and why it is used
- Data vs information
- Database model types (relational, NoSQL, hierarchical, network, object-oriented)
- SDLC context for database work
- Table/relation anatomy
- Entity-Relationship Diagram (ERD) basics
- Relationships and cardinality
- Keys in databases
- Database design process
- Anomalies in poor schema design
- Resolving many-to-many relationships
- Normalization overview and detailed normal forms (1NF, 2NF, 3NF)
what-is-database.ts— database basics and data vs informationtype-of-db-model.ts— common database model categoriessdlc.ts— SDLC phases and where database design fitsanatomy-of-table-or-relation.ts— structure of a table/relationentity-relationship-diagram.ts— ERD components and valuerelationship-cardinality.ts— 1:1, 1:N, M:N relationshipskeys-in-database.ts— primary, foreign, unique, composite, candidate, alternate, super keysdatabase-design.ts— step-by-step database design workflowanomalies-in-db.ts— insertion, update, and deletion anomaliesresolve-many-to-many.ts— junction table approachnormalization.ts— normalization summary and goals1NF.ts— First Normal Form2NF.ts— Second Normal Form3NF.ts— Third Normal Form
Normalization is the heart of this repository and the most important concept for building reliable relational schemas.
Normalization helps you:
- Reduce redundant data
- Prevent inconsistent updates
- Avoid insertion and deletion anomalies
- Improve data integrity
- Keep schemas easier to maintain and extend
- Learn the problem first:
anomalies-in-db.ts
- Understand the core concept:
normalization.ts
- Study each normal form in sequence:
1NF.ts→2NF.ts→3NF.ts
- Connect to relationship modeling:
relationship-cardinality.tsresolve-many-to-many.ts
- Tie everything back to overall design:
database-design.tsentity-relationship-diagram.ts
Rule: Every field must contain atomic (single) values, and rows should be uniquely identifiable.
What to check:
- No comma-separated or array-like values in one column
- No repeating groups in a single row
- Every row can be uniquely identified (typically with a key)
Typical fix:
- Split multi-valued attributes into separate rows or related tables
Rule: Must already be in 1NF, and every non-key attribute must depend on the whole primary key (important for composite keys).
What to check:
- Composite primary keys in bridge/detail tables
- Non-key columns that depend on only part of that composite key (partial dependency)
Typical fix:
- Move partially dependent attributes to their own table
- Keep only fully dependent attributes in the original table
Rule: Must already be in 2NF, and there should be no transitive dependency (non-key depending on non-key).
What to check:
- Attributes that logically belong to another entity
- Repeated descriptive data caused by indirect dependencies
Typical fix:
- Move transitively dependent columns into a separate table
- Reference the new table using foreign keys
When designing a schema, ask:
- Are all attributes atomic? (1NF)
- If I use a composite key, do all non-key columns depend on all key parts? (2NF)
- Is any non-key column determining another non-key column? (3NF)
- Can this design cause insertion/update/deletion anomalies?
- Should a separate entity/table be created instead?
Use this order for best understanding:
what-is-database.tstype-of-db-model.tsanatomy-of-table-or-relation.tskeys-in-database.tsrelationship-cardinality.tsresolve-many-to-many.tsanomalies-in-db.tsnormalization.ts1NF.ts2NF.ts3NF.tsentity-relationship-diagram.tsdatabase-design.tssdlc.ts
- Read each file topic-by-topic
- Rewrite concepts in your own words
- Create your own example tables for each normal form
- Practice converting unnormalized structures into 1NF → 2NF → 3NF
- Draw ERDs for your practice scenarios
- Translate the final normalized design into SQL in your local practice environment
- This repository is concept-focused and text-based.
- Files are educational notes, not executable TypeScript modules.
- The best outcome comes from practicing each concept with your own schema examples.
If you are learning RDBMS seriously, spend most of your time on:
- Keys
- Relationships/cardinality
- Normalization (1NF, 2NF, 3NF)
These three together form the core of strong relational database design.