SlideShare a Scribd company logo
3. Select part-1 : Getting started
• Revisit connections and scripts
• First Select ( and what is a table?! )
• All columns or some columns
• Data Types
• Aliases
• Primary keys
http://adata.guru
Running scripts
SQL*Plus: @”..full_path../my_query.sql”
SQL Developer
SQLFiddle
http://adata.guru
What is a table?
One of the basic database object types
http://adata.guru
14 Rows
8 Columns
Select statement
Used to “read”data from the database
**No changes are being made to the data
Select [* | column_list ]
From <table_name>
Where <filter_conditions>
Group by <group columns>
Having <filters on groups>
http://adata.guru
Wild card v/s columns
http://adata.guru
*  all columns Specific columns
Structure (shift+f4)
Data types
Describe what kind of data a column has.
http://adata.guru
Column Name Datatype (length/precision)
List of Oracle Data types
http://docs.oracle.com/cd/B28359_01/server.111/b28318/datatype.htm#i16209
• Character
– char (fixed length string) eg. Char(10) – “Hello “
– varchar2( variable length string) eg. Varchar2(10) – “Hello”
– and more…
• Numeric
– Number. Eg 123.50
– and more..
• Date
– Date eg. 15-aug-1947 00:02:00 AM (includes time component)
– Timestamp eg. 15-aug-1947 00:02:00.155 AM
• and more…
http://adata.guru
Primary Key
• Uniquely identifies the row in a table.
Check the constraints section in the table definition.
http://adata.guru
Use SHIFT+F4
shortcut key for
SQL Developer and
F4 if you are using
Toad.
(column) Aliases
• More readable, meaningful and useful column headers.
• Very useful when dealing with complex names or
generating reports
http://adata.guru
(column) Aliases
• Useful when you want contextual and meaningful names
This kind of join is called a self-join where we join a table (emp) with itself. We’ll cover this
in more detail in the JOINS Chapter.
http://adata.guru
Same column
different heading
based on
context/meaning
Unlocking other schemas
List of user account present in the database
Conn / as sysdba
Select username from dba_users
Demo Accounts : http://docs.oracle.com/cd/E11882_01/server.112/e10831/installation.htm
Unlocking acccounts:
Conn / as sysdba
Alter user hr identified by “hr”;
Alter user oe identified by “oe”;
Alter user pm identified by “pm”;
Alter user sh identified by “sh”;
Alter user ix identified by “ix”;
http://adata.guru

More Related Content

PPTX
Oracle SQL - Grants, filters, groups and more
PPTX
PPTX
Mysql Crud, Php Mysql, php, sql
PPTX
Lab2 ddl commands
PDF
Sql server 2016 queries
DOC
PPTX
intro for sql
Oracle SQL - Grants, filters, groups and more
Mysql Crud, Php Mysql, php, sql
Lab2 ddl commands
Sql server 2016 queries
intro for sql

What's hot (20)

PPTX
Chapter 1 introduction to sql server
PPTX
Introduction to database
PDF
Mysql cheatsheet
PPT
PPTX
Introduction to XSLT
ODP
Ms sql-server
PDF
Oracle SQL Part 2
PDF
View & index in SQL
PPT
SQL Tutorial - Basic Commands
PPTX
SQL_Part1
PPTX
Oracle apps financial online training
PPTX
ODP
Database index by Reema Gajjar
PPTX
Chapter 1 introduction to sql server
PDF
MySQL Query And Index Tuning
PPTX
Sql basic things
PDF
SQL for Data Science Tutorial | Data Science Tutorial | Edureka
PPTX
MySQL index optimization techniques
PDF
Sql Basics | Edureka
Chapter 1 introduction to sql server
Introduction to database
Mysql cheatsheet
Introduction to XSLT
Ms sql-server
Oracle SQL Part 2
View & index in SQL
SQL Tutorial - Basic Commands
SQL_Part1
Oracle apps financial online training
Database index by Reema Gajjar
Chapter 1 introduction to sql server
MySQL Query And Index Tuning
Sql basic things
SQL for Data Science Tutorial | Data Science Tutorial | Edureka
MySQL index optimization techniques
Sql Basics | Edureka
Ad

Similar to Oracle SQL - Select Part -1 let's write some queries! (20)

DOC
Oracle notes
DOC
Adbms
PPTX
SQL database management System a brief intro
PPTX
SQL for interview
DOC
PDF
SQL Notes
PPTX
XII_IP_PPT[2].pptxhggggggggggggggggggggggggggggggggdj
PPTX
Practical 03 (1).pptx
PPTX
DATABASE MANAGMENT SYSTEM (DBMS) AND SQL
PPT
Sql 2006
PPTX
SQL INterview Questions .pTop 45 SQL Interview Questions And Answers In 2025 ...
PPTX
OracleSQLraining.pptx
PDF
Basics of SELECT Statement - Oracle SQL
PDF
Oracle sql tutorial
PDF
PPT
SQL select statement and functions
PPTX
SQLSERVERQUERIES.pptx
PPTX
My SQL.pptx
PPT
Interactive SQL: SQL, Features of SQL, DDL & DML
PPTX
Sql introduction
Oracle notes
Adbms
SQL database management System a brief intro
SQL for interview
SQL Notes
XII_IP_PPT[2].pptxhggggggggggggggggggggggggggggggggdj
Practical 03 (1).pptx
DATABASE MANAGMENT SYSTEM (DBMS) AND SQL
Sql 2006
SQL INterview Questions .pTop 45 SQL Interview Questions And Answers In 2025 ...
OracleSQLraining.pptx
Basics of SELECT Statement - Oracle SQL
Oracle sql tutorial
SQL select statement and functions
SQLSERVERQUERIES.pptx
My SQL.pptx
Interactive SQL: SQL, Features of SQL, DDL & DML
Sql introduction
Ad

Recently uploaded (20)

PPTX
Introduction-to-Cloud-ComputingFinal.pptx
PPT
ISS -ESG Data flows What is ESG and HowHow
PDF
Foundation of Data Science unit number two notes
PPTX
Computer network topology notes for revision
PDF
Galatica Smart Energy Infrastructure Startup Pitch Deck
PPTX
Business Acumen Training GuidePresentation.pptx
PPTX
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
PPTX
1_Introduction to advance data techniques.pptx
PDF
Lecture1 pattern recognition............
PDF
Fluorescence-microscope_Botany_detailed content
PPTX
Acceptance and paychological effects of mandatory extra coach I classes.pptx
PPT
Reliability_Chapter_ presentation 1221.5784
PPTX
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
PPTX
Qualitative Qantitative and Mixed Methods.pptx
PPTX
Supervised vs unsupervised machine learning algorithms
PPTX
climate analysis of Dhaka ,Banglades.pptx
PPTX
Database Infoormation System (DBIS).pptx
PPTX
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
PPTX
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
Introduction-to-Cloud-ComputingFinal.pptx
ISS -ESG Data flows What is ESG and HowHow
Foundation of Data Science unit number two notes
Computer network topology notes for revision
Galatica Smart Energy Infrastructure Startup Pitch Deck
Business Acumen Training GuidePresentation.pptx
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
1_Introduction to advance data techniques.pptx
Lecture1 pattern recognition............
Fluorescence-microscope_Botany_detailed content
Acceptance and paychological effects of mandatory extra coach I classes.pptx
Reliability_Chapter_ presentation 1221.5784
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
Qualitative Qantitative and Mixed Methods.pptx
Supervised vs unsupervised machine learning algorithms
climate analysis of Dhaka ,Banglades.pptx
Database Infoormation System (DBIS).pptx
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
iec ppt-1 pptx icmr ppt on rehabilitation.pptx

Oracle SQL - Select Part -1 let's write some queries!

  • 1. 3. Select part-1 : Getting started • Revisit connections and scripts • First Select ( and what is a table?! ) • All columns or some columns • Data Types • Aliases • Primary keys http://adata.guru
  • 2. Running scripts SQL*Plus: @”..full_path../my_query.sql” SQL Developer SQLFiddle http://adata.guru
  • 3. What is a table? One of the basic database object types http://adata.guru 14 Rows 8 Columns
  • 4. Select statement Used to “read”data from the database **No changes are being made to the data Select [* | column_list ] From <table_name> Where <filter_conditions> Group by <group columns> Having <filters on groups> http://adata.guru
  • 5. Wild card v/s columns http://adata.guru *  all columns Specific columns Structure (shift+f4)
  • 6. Data types Describe what kind of data a column has. http://adata.guru Column Name Datatype (length/precision)
  • 7. List of Oracle Data types http://docs.oracle.com/cd/B28359_01/server.111/b28318/datatype.htm#i16209 • Character – char (fixed length string) eg. Char(10) – “Hello “ – varchar2( variable length string) eg. Varchar2(10) – “Hello” – and more… • Numeric – Number. Eg 123.50 – and more.. • Date – Date eg. 15-aug-1947 00:02:00 AM (includes time component) – Timestamp eg. 15-aug-1947 00:02:00.155 AM • and more… http://adata.guru
  • 8. Primary Key • Uniquely identifies the row in a table. Check the constraints section in the table definition. http://adata.guru Use SHIFT+F4 shortcut key for SQL Developer and F4 if you are using Toad.
  • 9. (column) Aliases • More readable, meaningful and useful column headers. • Very useful when dealing with complex names or generating reports http://adata.guru
  • 10. (column) Aliases • Useful when you want contextual and meaningful names This kind of join is called a self-join where we join a table (emp) with itself. We’ll cover this in more detail in the JOINS Chapter. http://adata.guru Same column different heading based on context/meaning
  • 11. Unlocking other schemas List of user account present in the database Conn / as sysdba Select username from dba_users Demo Accounts : http://docs.oracle.com/cd/E11882_01/server.112/e10831/installation.htm Unlocking acccounts: Conn / as sysdba Alter user hr identified by “hr”; Alter user oe identified by “oe”; Alter user pm identified by “pm”; Alter user sh identified by “sh”; Alter user ix identified by “ix”; http://adata.guru