Archive for category SQL

Find running processes in Oracle

Use following query to find running processing in Oracle. The output shows Process id of the running process, Status whether it is ACTIVE or INACTIVE, username, Schema Name and the SQL query that is running under current process. Running following query gives a handful of useful information. Advertisements

,

Leave a comment

SQL Index

Index in SQL is created on existing tables and is a way to boost up the data retrieval performance of table. Index should be created on the columns that are frequently used for searching data. An Index is an ordered list of contents of a column ( or a group of columns) of a table. […]

,

Leave a comment

How to find columns of a table using SQL query?

You can use following SQL query to list columns of a particular table in Oracle.

, ,

Leave a comment

Find second highest salary from Employee table

There are several ways find second, third or fourth hightest record in a table. Let us create a Table to demonstrate this. So the data in our EMPLOYEE table is Solutions below: Solution1: Use not in clause: Returns Solution 2: Returns Solution 3: Use WHERE clause Returns

, , ,

Leave a comment

How to find table constraints in mysql

Following command to see all the constraints in a table in MySql database. For Eg. above command lists all the constraints in JOBS table.

,

Leave a comment