SQL DEVELOPER
Connecting to Oracle Database using SQL
In this tutorial we will discuss how do we connect with the Oracle database? First of all, let us check the installation whether it is properly done or not.
In this we will 2 different types to connect
- How to connect to oracle database using SQL command.
- How to connect to oracle database using SQL developer.
Open the command prompt and go ahead and execute the command sqlplus. So this is the default command that we will use in order to login to the Oracle database.

So when you click on enter so you could see that you have logged into the Oracle database.

So in order to understand the database name, you can give the command.
select name from V$database;
Output:

So XE is our database name.
By this we can understand the Installation of the databases successful, but in order to continue further with our SQL practice and all we require one schema.
Schema is more or less like a user in the Oracle database. So let us see what are all the schemas that are available in the Oracle database currently select.
Select username, account_status from dba_users;Output:

So this is a command or table which will show us a list of all the schemas so you could see system or the default usernames which are in the open status and as you could seem like there was something called HR at the end.
HR is the default schema that we can use in order to get our SQL practice, so the default tables that you can use from the HR schema.
We need to first unlock and reset the password, as the password is already expired, and also the account was locked.
Now we need to unlock it and need to reset the password. We can do all these things in one command.
Alter user HR identifier by HR account unlock.Select username, account_status from dba_users;
You could see the HRA account is open. So in order to connect to the Oracle HR account.
Connect hr
Now we will see the list of tables that are connected.
Select * from tab;Output:

All these are the default tables that are there existing with your Database so now let us see some sample data whether we have the data inside these tables or not.
select * from jobs Output:

The commands which we are operating are helpful for beginners to work with this key this kind. Okay. It might be a little bit tough for them, or some people might not be able to understand how exactly it is to be done. So in order to make it easy I suggested you go ahead and download the SQL Developer, which I have already extracted in my last tutorial.

So there is the SQL Developer icon on which you need to just click on so where it is going to open us the complete GUI picture. So using this we can just get connected with the Oracle database.
So take a look at this one. I wanted to make a connection. This is of front-end GOI of Oracle SQL Developer, which will allow was in order to just come get communicated with the Oracle database. Whatever that we have installed.
Now you see I’m going to add a connection new connection.
Click on the new connection and also the name so the name is HR.
- The username is HR
- Password is already HR.
- Password is already HR.

The rest of all the things are common so that SID is nothing but the system identifier which is nothing but a database name. so let us test this connection before we are going to conform and get it connected. Let me just click on the test. You see the status is Success.
So without which that you cannot continue further. So first you need to test this one and then go ahead and just click on connect.
SO click on HR on the left side and it will ask for the password: HR
Now go to properties

Repeat the same.
Let’s proceed to give the command
Select * from jobs;Click on CTRL+Enter
Output:

So now this point of time we have already installed the Oracle database and we are ready with our Oracle SQL Developer and we have made the all necessary connections to be made.