Skip to content
EduVerse

You’re reading the free preview.Unlock every conversation for €2.99

FreeFree previewChapter 7

Chapter 7 · Free preview

Databases: The Persistent Memory

Where Does the Data Actually Live?

Illustration from the book

What you will understand

  • Write SQL queries with SELECT, INSERT, UPDATE, DELETE and JOINs
  • Design relations with primary keys, foreign keys and constraints
  • Explain the four ACID properties with a real-world example
  • Recognise and fix the N+1 problem
  • Choose between SQL and NoSQL based on the use case

Written by EduVerse for this preview; the slides below are the book’s own words.

Slides from the chapter

Each slide is a passage from the book with the figure or listing it talks about. Swipe, use the arrow keys or the buttons.

Slide 1 of 4

Relationships: Connecting Tables

7.1.5 · p. 152

Conversation from The Software Realm, Decoded

Chapter 7 · 7.1.5 Relationships: Connecting Tables · p. 152

Database responds:

Database response
ERROR: foreign key constraint violated
Peter, from the book cover

Peter

User 999 doesn’t exist. Database caught that!

Cascading Operations: What Happens When You Delete?

Peter, from the book cover

Peter’s next question

What happens if I delete a user who has orders?

The Senior developer, from the book cover

Senior developer

Good question. You need to decide: cascade or restrict?

What the book shows with it

Example from The Software Realm, Decoded

Chapter 7 · 7.1.5 Relationships: Connecting Tables · p. 152

Users table:

Table
| id | username |
|----|----------|
| 1  | alice    |
| 2  | bob      |

Orders table:

Table
| id  | user_id | total   |
|-----|---------|---------|
| 101 | 1       | $50.00  |
| 102 | 1       | $75.00  |
| 103 | 2       | $30.00  |

Explore this text diagram

Pick one to highlight it and read what the book says about it.

Other terms (2)

Slide 1 of 4

Try it yourself

A simulation built by EduVerse around this chapter. It runs in your browser; nothing is sent anywhere.

Full book

The full chapter

This preview shows 7 of the chapter’s 53 passages. The full chapter has:

  • 8 sections
  • 25 conversations
  • 0 figures and tables
  • 4 What They Say boxes
  • 7 knowledge-check questions
Sections in this chapter
  1. 7.1Relational Databases: Tables and Relationships
  2. 7.2SQL Database Landscape: Choosing Your Database
  3. 7.3Normalization: Avoiding Redundancy
  4. 7.4NoSQL: Beyond Tables
  5. 7.5The Rise of Distributed Databases
  6. 7.6Database Performance
  7. 7.7Beyond Operational Databases: Analytics and Scale
  8. 7.8Peter's Takeaways