564 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owls only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Practise SQL in your browser with SQL Fiddle
Part one of a sixteen-part series of blogs
Some of our poor delegates don't have the luxury of a home computer to install SQL on (even worse some have made bad life choices and picked a Mac). The good news is that you can still practise your SQL skills in your web browser, using the impressive SQL Fiddle site. Have no fear, SQL Fiddle is here, a browser based sandbox to bring you cheer!
For some delegates installing SSMS (SQL Server Management Studio) isn't an option (this is especially true for Mac users who don't want to use 3rd party software). Have no fear - SQL Fiddle is here!
SQL Fiddle (like W3 schools), lets you practice SQL without needing to install SSMS!
The first thing to do when you visit SQL Fiddle is to change the SQL dialect to the one you are using. For example SSMS runs T-SQL, which is the native SQL dialect for MS SQL SERVER 2017.
If you forget to do this all your code generated will be slightly off. Rather than fixing the problem, it will be quicker to re-import your tables, speaking of which ...
If somebody has provided you with the script to generate your database, you can just run this.
Fortunately I've already done this for you: see below for the simple test database I've created for you to use, and how to generate it.
To generate a database for you to use in SQL Fiddle from script, just paste the SQL script into the left-hand window and click on the Build Schema button:
Once you click on this button, you'll be able to write queries against this database.
When this has executed, you can click on the Browser button to see the results:
Click on this button to see a list of tables generated.
You can then return to the normal view by clicking on the DDL Editor button:
Here our script has generated 5 tables.
Here's an example of writing a query to interrogate one of the generated tables:
Click on the Run SQL button to run any SQL query you've typed in.
The big limitation is that you don't get Intellisense suggesting how to complete your commands, but you can't have everything in life!
If you don't have any pre-created script, you can paste in your tables one by one, and add the script for each. For each table, first click on the Text to DDL button:
Click on this button to convert pasted text to SQL script.
You can now give your new table a name, and paste in its data:
Click on the Append to DDL button to add script to generate this table to your schema window on the left-hand side.
You can repeat this process to add each table, then click on the Build Schema button as shown for method 1 above:
SQL Fiddle turns the pasted data into script to generate the necessary table.
The rest of this blog contains a selection of exercises to practise using this simple database:
Note that this diagram was created in SQL Server Management Studio (you can't add relationships to tables in SQL Fiddle).
To generate this database, just click here to get a pre-made SQL Fiddle. All that you need to do is to click on the button to generate your schema!
Just click on the button shown above after clicking on this link, and your database will be ready to interrogate!
If you want to learn how to write SQL in a more structured way, consider booking onto one of our classroom or online SQL courses.
|Parts of this blog|
25 Aytoun Street