In this article I’m going to show you how to design a database, pour in some data, and finally execute queries. Everything will be done using only a ... web browser. That’s right, no installation, no license keys, no de-installation. Just switch to Google Chrome and follow along.
To design a database I will use Vertabelo. Since this is a Vertabelo product blog, the choice is obvious :)
You will need to sign up for an account to practice the following steps. SQL script generation (aka forward engineering) is not available for Anonymous Cowards. But don’t worry. You can register for a free Vertabelo account which is more than sufficient for our project.
Here is my design. It’s rudimentary. You may design something more sophisticated.
Database script DDL
To generate the schema creation script click on the SQL icon, then click “Generate” on the form that appears.
You don’t have to download the generate script on your computer. Click on the script name and the script will open in a new window. You’ll see something like this:
[...] -- tables -- Table: category CREATE TABLE category ( id int NOT NULL, code int NOT NULL, CONSTRAINT category_pk PRIMARY KEY (id) ); [...]
Do not close this window. You’ll Copy&Paste from here.
Connecting to a database engine
You don’t have to install anything to test your SQL scripts. You can use the SqlFiddle.com application to do some SQL workouts online. Remember to pick the specific database engine version you want to play with.
Copy the generated script and paste it into the left panel of SQL Fiddle. Click “Build schema” and you’ll get a database with tables and references.
You may add these inserts at the end of left panel to add some data.
insert into category values(1,'designer'); insert into category values(2,'sql'); insert into category values(3,'database'); insert into product values(1,'vertabelo','vert1', 1); insert into product values(2,'sqlfilddle','sf1', 2);
Click the “Build schema” button one again.
In the right panel there is a place to perform queries. For example:
select p.name, c.code from product p join category c on (c.id = p.category_id) ;
Click the “Run SQL” button and you’ll see results on the bottom of the page.
As you can see, there is no need to install anything to determine how a relational model works. If you’ve got any questions about browser-supported database design, do not hesitate to ask us. You may get a discount if you ask a good one :).