Hands On SQL

How does Hands-on SQL work?

SELECT only queries

In the SELECT-only sections you can do read queries on any of the tables mentioned in the book. You don't have permission to change the data so the tables remain the same for everyone.

Try a SELECT query on the fish_records table:


We just know you can't resist trying to break it. Go ahead. Copy this INSERT query into the SELECT-only box to see the error message.

INSERT INTO fish_records(first_name,last_name)
 VALUES ('Moby','Dick');

Read/Write Queries

In the read write sections you can change tables—but only the ones that have been set up for the purpose. Basically we copy the whole table, run your query, then drop the table again. That way the system is nice and tidy for the next user. Of course it's hideously inefficient to run queries like this—but all the tables are pretty small and it works OK so long as everybody plays nicely.

In this example the doughnut_rating table has been set up.


The bad news is that the rest of the tables aren't easily available to you from these sections of the web page. (You can actually get to them, but you must specify the database handson as well as the table name.)

SELECT * FROM handson.fish_records

Go back to the first page