Skip to Content
Head First SQL
book

Head First SQL

by Lynn Beighley
August 2007
Beginner to intermediate
608 pages
13h 12m
English
O'Reilly Media, Inc.
Content preview from Head First SQL

Chapter 11. Constraints, Views, and Transactions: Too many cooks spoil the database

image with no caption

Your database has grown, and other people need to use it. The problem is that some of them won’t be as skilled at SQL as you are. You need ways to keep them from entering the wrong data, techniques for allowing them to only see part of the data, and ways to stop them from stepping on each other when they try entering data at the same time. In this chapter we begin protecting our data from the mistakes of others. Welcome to Defensive Databases, Part 1.

Greg’s hired some help

Greg has hired two people to help him manage his growing business. Jim’s going to handle entering new clients into the database, while Frank’s in charge of matching people up to prospective jobs.

Greg has spent some time explaining his database to them and describing what each table does.

image with no caption
image with no caption

Jim’s first day: Inserting a new client

Jim’s sitting in his new cubicle and gets an IM from Greg:

image with no caption

Brain Power

Can you write the queries to insert this new person into the database?

Jim avoids a NULL

As he’s entering the data, Jim realizes that he doesn’t know ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Head First SQL, 2nd Edition

Head First SQL, 2nd Edition

Kimberly Fessel
Learning SQL

Learning SQL

Ben Forta
Practical SQL

Practical SQL

Anthony DeBarros

Publisher Resources

ISBN: 9780596526849Supplemental ContentErrata Page