In this lesson, I’m going to show you what you can do to take this course without installing any program on your computer using a site called Live SQL.
You will only need any computing device with internet access, which includes computers, tablets, and smartphones.
This is a great site where you can interact with an Oracle database that runs on Oracle servers, so that you can run SQL commands from your browser without needing to install any database or client software to do it, and you can do it for free.
Let’s get to know the tool
So, go ahead and click here to navigate to the site, and let’s take a look at this awesome site.
Once you get to the site, click on “Start Coding Now” and log in with your Oracle account. If you don’t have one, you can create an account for free by clicking on the “Create Account” button.
Once you are logged in, you will get to the Live SQL site.
Let’s take a look at the features or options we have available here.
The first feature is the SQL Worksheet, which will be automatically selected. This is where you will be writing and running your SQL commands, and the great thing is that you can create your own tables, so you will be able to work almost exactly as you would if you had installed your own database on your computer.
So, after you write any SQL command here, you just have to press CTRL + ENTER, as you would in SQL Developer, or press this “Run” button:
And you will get your results below the worksheet text editor.
In the “My Session” section you will have the history of the commands you have run in the current session, AND in previous sessions, which is great. There are also some other options there that we will not use by now.
In “Schema”, you will see the database objects you have created, which in our case are going to be database tables.
The “Design” section is a tool you can use to create tables, but the scripts needed to create the tables you will use in the course are included in the course materials, so you will not need to use this feature by now.
My Scripts (Very Important!)
Then in “My Scripts”, you can save scripts that you plan to use more than once. This section will be very important to you, because, unfortunately, the site doesn’t keep the database objects you create from one session to the next one. So, every time you start a new session on the site, you would have to run the initial script, and any other scripts used in subsequent lessons, that create or modify tables or data.
But to make things easier for you, in every lesson that I add a script that modifies tables or data, I will include another file specific for you, who are using LIVE SQL. This file will be a script that includes everything you need at that point. The script for Live SQL will usually be at the upper right corner of the page, for you to download it.
I will name those scripts with a number, so that you know that every time you start a new session, you have to go to this section and run the script with the highest number, which will take you just a few seconds.
Let me show you how you will have to do it.
This is how you will do it
Let’s say I’m a student and I’m reading the first lesson that includes some script, in this case, the script that creates the first test tables.
This is what I have to do: I look for the script at the upper right corner of the page and download the file named “LiveSQL_1” (See image below).
Then I go to the live SQL site, click on the “Start Coding Now” button and log in with my Oracle account.
After that, I go to “My Scripts” and click on the “Upload Script” button.
Then I browse for the script file I just downloaded and double click on it.
Here I have to give the script a name, and to make things easier, I name it LiveSQL_1, just like the name of the file I’m going to upload.
Then I click on the “Upload Script”.
And now, to run the script I click on the “Run Script” button.
And then I go to the Worksheet to start running SQL commands. Here is where I will be testing the commands used as examples in the course, and the ones I write to complete my practice tasks.
Now let’s suppose that I’m done studying for now, so I close my session.
Then, later today, or some other day, I’m going to continue with the course, so I go to the Live SQL site, click on Start Coding Now to enter, login, and go to “My Scripts”. There it is my script, so I click on it, and run it, and I’m ready to continue with the course.
Now, in another lesson, the instructor says there is another script that I need to run, which is named “LiveSQL_2”. Like the last time, I download the script, upload it to my profile in Live SQL and run it. This time, because my schema is not empty, I get some additional options before executing the script, from which I choose the option to “drop all database objects” and then click on the “Perform Actions” button.
Now, the next time I come to the site, I just have to go to “My Scripts” and run the script with the highest number in the name, in this case, LiveSQL_2. All previous scripts are no longer needed, because the last one will always include everything you need up to that point. Remember: Every time you enter the site, you just need to run the script with the highest number in the name.
Awesome, let’s continue.
And in the “Code Library” section of Live SQL you will find scripts that have been uploaded by other Oracle community members.
If you plan to use the Live SQL site, please add it to your bookmarks or favorites now.
A couple of final observations:
First one: Some time ago I tested this site with Internet Explorer, Firefox, Chrome and Opera, but it didn’t work very well with Internet Explorer. I don’t use that browser, so I can’t tell you if things have changed, so if you use it and find any issues, please use another browser.
And second one: The LIVE SQL site appears to have a session timeout very short. I don’t know exactly what the timeout setting is, but it is short. When your session has expired, you will get some error like “BAD REQUEST” or something similar, but sometimes you will not get any error, but your statements will simply not run or it will appear like they are not being executed. So, anytime you see the site behaving in an odd way, just close the current page, and enter again.
Okay, so, now you know how to use this great tool, and are ready to start learning SQL.
*Please note that this is a different subscription, specific to this tutorial and separate from the blog.