Creating database connection
- Oracle SQL Developer enables developers and DBAs to browse, create,and update data in a database.
- You must have at least one database connection to use Oracle SQL Developer.
Steps to create Database connection in Oracle SQL Developer
Step 1: Right click on connection and select new connection
Step 2: Define Connection name
give username and password which you have given during installation
and define Connection type as TNS and select Role SYSDBA
Select SID as ORCL and Click on Test to Test the Connection
Step 3: If it is showing success message then click on connect
Step 4: Now Our connection successfully created
You can write and run query.
Step 5: Query to get all table name of database schema
Basic Rules for writing SQL Statement.
–- SQL statements are not case-sensitive.
–- SQL statements can be entered on one or more lines.
–- Keywords cannot be abbreviated or split across lines.
–- Clauses are usually placed on separate lines.
–- Indents are used to enhance readability
Selection vs Projection
Selecting Columns from table without where clause
Selecting rows from table using where clause condition
Query to see list of all table from database
Viewing all column from table
select *from employees;
Viewing specific column from table
select First_name, last_name from employees;
Giving alias name to column
SELECT first_name, salary "monthly salary" FROM employees
Using concatenation operator in Select statement
SELECT first_name || last_name FROM employees
Display Unique value from column
SELECT distinct department_id from employees