0% found this document useful (0 votes)
0 views2 pages

#ORACLE SQL

The document provides an overview of Oracle SQL, including key concepts such as projection, selection, and the use of SQL keywords, which are case-insensitive. It explains the DISTINCT keyword for eliminating duplicates, the DUAL table for basic queries, and various operators like BETWEEN, IN, LIKE, and IS NULL for filtering data. Additionally, it distinguishes between single row functions and multiple row (aggregate) functions in Oracle SQL.

Uploaded by

shreyansh YEOLE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views2 pages

#ORACLE SQL

The document provides an overview of Oracle SQL, including key concepts such as projection, selection, and the use of SQL keywords, which are case-insensitive. It explains the DISTINCT keyword for eliminating duplicates, the DUAL table for basic queries, and various operators like BETWEEN, IN, LIKE, and IS NULL for filtering data. Additionally, it distinguishes between single row functions and multiple row (aggregate) functions in Oracle SQL.

Uploaded by

shreyansh YEOLE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

#ORACLE SQL(username:SHREYANSH password: GoodBag)

Projection
SELECT colN1,colN2,.. FROM Table_Name WHERE condition;
------------------------------------------------------------------
SELECTION
SELECT * FROM TableName WHERE condition
-------------------------------------------------------------------
SQL Keywords are case-insensitive but usually written in all capitals
-KeyWords are case insensitive
-Table Names in SQL are case insensitive
-colName Names in SQL are case insensitive
-DATA in SQL are case sensitive
---------------------------------------------------
Column alias
-columnName as aliasname
or
-columnName "alias name"
alias names will never be reflected in the actual tables present on the hard
drive of computer
------------------------------------------------------
DISTINCT Keyword
-used after SELECT to eliminate duplicate records and fetch only unique
records.

NOTE 1: DISTINCT keyword is used to avoid displaying of repeated values.

SELECT DISTINCT age FROM student;


--------------------------------------------------------------
Concatenation operator( || or CONCAT())
-Used to combine multiple data or multiple columns
EX. SELECT NAME || AGE AS "Name & Age" FROM Student;
--------------------------------------------------------------
DUAL TABLE(Default table in oracle)
its a special one row one column table present by default in ORACLE and other
database installations.
In Oracle, the table has a single VARCHAR2(1) column called DUMMY that has a
value of 'X'.
EX. SELECT * FROM DUAL

You can also check arithmetic calculation from the dual table using the
following statement:
SELECT 13+23*43/20 FROM DUAL;
--------------------------------------------------------------------
Operators as keywords
1. RELATION OPERATORS: = > < >= <= (!= <> ^=) in order with their precedence
2. BETWEEN AND Operator:
-when condition has a range of values to be compared we should be using
BETWEEN AND operator.
-Ex: SELECT * FROM student WHERE MARKS BETWEEN 80 AND 90;
3.IN
-When ever comparison has to be done with respect to a set of values we
have to use the IN operator.
SELECT * FROM student Where AGE IN (20,22);
4. LIKE:
-used to search for a specified pattern in a column.
-NOTE: pattern matching in SQL:
1. %(modulus): it matches 0 or more characters.
SELECT * FROM student WHERE NAME LIKE 'RA%';
2._(Under score): it matches exactly one character.
SELECT * FROM student WHERE NAME LIKE '___R%';// will give
word whose 4th character is R.

5. IS NULL
-used to select only the records with NULL values in the column.
-Ex SELECT * FROM student WHERE AGE IS NULL;
6. LOGICAL OPERATOR:
1.AND
2.OR
3.NOT
---------------------------------------------------------------
FUNCTIONS IN ORACLE:

In oracle we have 2 types of functions:


1. SINGLE ROW FUNCTIONS: accept single or multiple row as input but
produces only one output per row.
select LOWER(NAME) FROM STUDENT;

2. MULTIPLE ROW FUNCTIONS(aggregate functions):


-single or multiple row as input but
produces only one output per group.
SELECT INITCAP('SHREYANSH') AS "INITIAL" FROM DUAL
--------------------------------------------------------------------

You might also like