CodeWithSQL Blog: Latest SQL Tips and Tutorials

Explore the latest SQL tips and tutorials in our blog section. Learn SQL programming, database management, and query optimization.

Top SQL Projects to Build for Your Portfolio

Top SQL projects to build for your portfolio: 11 project ideas by level with schemas and example queries, plus how to present them on GitHub and where to find data.

SQL Injection Explained and How to Prevent It

SQL injection explained: how the attack works, its real impact, and how to prevent it with parameterized queries, least privilege, input validation and safe coding.

How SQL Indexes Improve Performance

How SQL indexes improve performance: how a B-tree turns scans into seeks, index vs table scan, EXPLAIN before and after, composite and covering indexes, and trade-offs.

Relational Database vs NoSQL Database

Relational database vs NoSQL: the data models, ACID vs BASE, scaling, and when to choose SQL or NoSQL (document, key-value, column, graph), with examples.

Entity Relationship Diagrams (ERD) Explained

Entity relationship diagrams (ERD) explained: entities, attributes, relationships and crow foot cardinality, turning an ERD into tables, and common mistakes to avoid.

Primary Key vs Foreign Key

Primary key vs foreign key: what each is, how they differ, composite and surrogate keys, referential integrity, and ON DELETE and ON UPDATE actions, with examples.

How to Design a Relational Database

How to design a relational database step by step: gather requirements, model entities and relationships, choose keys, normalize, pick data types and add constraints.

Page 1 of 6 · 51 articles
Learn SQL

Our structured courses take you from beginner to advanced, completely free.

→ Start Beginner Course
Write for us

Want to contribute a blog post? We'd love to hear from you.

Get in touch