04 Try it yourself Interactive

Insert two children called Anil

The same three dependents as section 02, inserted twice. The first attempt makes dname the primary key on its own, which is what most people draw first, and the third insert bounces. Then the table is dropped and rebuilt with the owner’s key on the front, the same three inserts are run again, and all three land. The last two steps delete Ravi and show where total participation ends up. Nothing plays on its own: Next, Back and Reset, or the arrow keys.

DEPENDENT · two attempts
PRIMARY KEY (dname) · one column
Shaded key columns are the primary key as currently declared. Indigo = the cells this step wrote. Amber = a row an earlier row already matches. Rose = rejected or deleted. Green = stored and safe.
Press Next to begin. Each press runs one statement.


      
Rows stored
Columns in the key
Rows you can tell apart0
Inserts rejected0
step 0 / 0

Watch Rows stored against Rows you can tell apart at step 5. Three stored and two you can tell apart is not a bug in the console; it is what “no key of its own” means once you write it down as a count.