SQL

SQL (Structured Query Language) is a standard language used to operate relational databases. It includes operations such as database creation, retrieving and modifying data, granting privileges to data.

Thumbnail image for The Special DUAL Table in Oracle

The Special DUAL Table in Oracle

DUAL is a special one-row, one-column table in Oracle data dictionary. Some trivia about DUAL table in Oracle and best practices for using DUAL in SQL.

Read the Full Article →
Thumbnail image for The Magic Of ROWNUM

The Magic Of ROWNUM

Pseudocolumn ROWNUM in Oracle, which assigns a number to every row returned by a query, has properties so interesting it almost looks like magic!

Read the Full Article →
Thumbnail image for The Difference Between UNION and UNION ALL

The Difference Between UNION and UNION ALL

Both UNION and UNION ALL concatenate the result sets of two separate SQLs. Where they differ is in the way they handle duplicates.

Read the Full Article →
Thumbnail image for How to Find Duplicate Records in a Table

How to Find Duplicate Records in a Table

Query to find all duplicate records in an Oracle table. Typically required in scenarios where duplicate rows in a table are to be identified and then deleted.

Read the Full Article →
Thumbnail image for The BOOLEAN Datatype in Oracle

The BOOLEAN Datatype in Oracle

Oracle database has a BOOLEAN datatype only in PL/SQL, not in SQL. There is no direct way to represent that a column value is TRUE or FALSE. However, the BOOLEAN datatype can be easily simulated in Oracle with these implementation ideas.

Read the Full Article →
Thumbnail image for The Difference between CHAR, VARCHAR and VARCHAR2

The Difference between CHAR, VARCHAR and VARCHAR2

Oracle has three datatypes to store strings. – CHAR, VARCHAR and VARCHAR2. How do they differ from each other? When should you use which? This article gives you the lowdown on the subject.

Read the Full Article →

Scalar Subquery: SELECT within SELECT!

A scalar subquery is a single row, single column query, which looks just like a column or function in the SELECT clause. Here’s a look at the unique characteristics and benefits of this feature in Oracle.

Read the Full Article →
Thumbnail image for IN = EXISTS, but beware: NOT IN is not the same as NOT EXISTS!

IN = EXISTS, but beware: NOT IN is not the same as NOT EXISTS!

In Oracle SQL queries, IN and EXISTS are interchangeable. Many of us assume therefore, that NOT IN and NOT EXISTS are also interchangeable. That’s not the case though.

Read the Full Article →
Thumbnail image for Which is faster – IN or EXISTS?

Which is faster – IN or EXISTS?

A question asked multiple times over on Oracle forums: Which is faster – IN or EXISTS? The short answer, post-Oracle 9i is: Both are pretty much the same!

Read the Full Article →
Thumbnail image for What are Inline Views in Oracle?

What are Inline Views in Oracle?

An inline view is a subquery with an alias that you can use within a SQL statement, often used in queries for Top-N analysis. An inline view behaves just as if the subquery were a table name.

Read the Full Article →