SlideShare una empresa de Scribd logo
1 de 23
Basic   SELECT   Statement  http://ecomputernotes.com
"  "  http://ecomputernotes.com Basic   SELECT   Statement  SELECT  * |   { [DISTINCT]   column | expression   [ alias ],...}  FRO M  table;  SELECT   identifies   what   columns  FROM   identifies   which   table
http://ecomputernotes.com Selecting All Columns  SELECT *  FROM  departments;
Selecting Specific Columns  SELECT department_id, location_id  FROM  departments;  http://ecomputernotes.com
Writing SQL Statements  "  SQL statements are not case sensitive.  "  SQL statements can be 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.  http://ecomputernotes.com
Column Heading Defaults  "  i SQL*Plus:  Default heading justification: Center Default heading display: Uppercase  "  SQL*Plus:  Character and Date column headings are left- justified  Number column headings are right-justified Default heading display: Uppercase  http://ecomputernotes.com
Arithmetic Expressions  Create expressions with number and date data by  using arithmetic operators.  Operator  Description  +  Add  -  Subtract  *  Multiply  /  Divide  http://ecomputernotes.com
Using Arithmetic Operators  SELECT last_name, salary, salary + 300  FROM  employees;  «  http://ecomputernotes.com
Operator Precedence  _  /  +  *  "M ultiplication and division take priority over  addition and subtraction.  "O perators of the same priority are evaluated from  left to right.  "P arentheses are used to force prioritized  evaluation and to clarify statements.  http://ecomputernotes.com
Operator Precedence  SELECT last_name, salary, 12*salary+100  FROM  employees;  «  http://ecomputernotes.com
Using Parentheses  SELECT last_name, salary, 12*(salary+100)  FROM  employees;  «
Defining a Null Value  "A  null is a value that is unavailable, unassigned,  unknown, or inapplicable.  "A  null is not the same as zero or a blank space.  SELECT last_name, job_id, salary, commission_pct  FROM  employees;  «  «
Null Values  in Arithmetic Expressions  Arithmetic expressions containing a null value  evaluate to null.  SELECT last_name, 12*salary*commission_pct  FROM  employees;  «  «
Defining a Column Alias  A column alias:  "  Renames a column heading  "  Is useful with calculations  "  Immediately follows the column name - there can  also be the optional   AS   keyword between the column name and alias  "R equires double quotation marks if it contains  spaces or special characters or is case sensitive
Using Column Aliases  SELECT last_name AS name, commission_pct comm  FROM  employees;  «  SELECT last_name "Name", salary*12 "Annual Salary"  FROM  employees;  «
Concatenation Operator  A concatenation operator:  "  Concatenates columns or character strings to  other columns  "  Is represented by two vertical bars (||)  "  Creates a resultant column that is a character  expression
Using the Concatenation Operator  SELECT  last_name||job_id AS "Employees"  FRO M  employees;  «
Literal Character Strings  "A  literal is a character, a number, or a date  included in the   SELECT   list.  "D ate and character literal values must be enclosed  within single quotation marks.  "E ach character string is output once for each  row returned.
Using Literal Character Strings  SELECT last_name  ||' is a '||job_id  AS "Employee Details"  FROM  employees;  «
Duplicate Rows  The default display of queries is all rows, including  duplicate rows.  SELECT department_id  FROM  employees;  «
Eliminating Duplicate Rows  Eliminate duplicate rows by using the   DISTINCT keyword in the   SELECT   clause.  SELECT DISTINCT department_id FROM  employees;
Displaying Table Structure  DESCRIBE employees
 

Más contenido relacionado

La actualidad más candente

Using single row functions to customize output
Using single row functions to customize outputUsing single row functions to customize output
Using single row functions to customize outputSyed Zaid Irshad
 
Les01 (retrieving data using the sql select statement)
Les01 (retrieving data using the sql select statement)Les01 (retrieving data using the sql select statement)
Les01 (retrieving data using the sql select statement)Achmad Solichin
 
Retrieving data using the sql select statement
Retrieving data using the sql select statementRetrieving data using the sql select statement
Retrieving data using the sql select statementSyed Zaid Irshad
 
1. dml select statement reterive data
1. dml select statement reterive data1. dml select statement reterive data
1. dml select statement reterive dataAmrit Kaur
 
Beginers guide for oracle sql
Beginers guide for oracle sqlBeginers guide for oracle sql
Beginers guide for oracle sqlN.Jagadish Kumar
 
Understanding excel’s error values
Understanding excel’s error valuesUnderstanding excel’s error values
Understanding excel’s error valuesVijay Perepa
 
TrainingOutline_Excel_FormulasNFunctions_Workshop (Writing Sample)
TrainingOutline_Excel_FormulasNFunctions_Workshop (Writing Sample)TrainingOutline_Excel_FormulasNFunctions_Workshop (Writing Sample)
TrainingOutline_Excel_FormulasNFunctions_Workshop (Writing Sample)Patrice Dowtin, MS, MBA
 
Introduction to programming c and data-structures
Introduction to programming c and data-structures Introduction to programming c and data-structures
Introduction to programming c and data-structures Pradipta Mishra
 
Operators in c programming
Operators in c programmingOperators in c programming
Operators in c programmingsavitamhaske
 
Row, Column, Index, Match, Offset Functions. Excel Tutorial
Row, Column, Index, Match, Offset Functions. Excel TutorialRow, Column, Index, Match, Offset Functions. Excel Tutorial
Row, Column, Index, Match, Offset Functions. Excel TutorialIlgar Zarbaliyev
 
Using Excel Functions
Using Excel FunctionsUsing Excel Functions
Using Excel FunctionsGautam Gupta
 
On if,countif,countifs,sumif,countifs,lookup,v lookup,index,match
On if,countif,countifs,sumif,countifs,lookup,v lookup,index,matchOn if,countif,countifs,sumif,countifs,lookup,v lookup,index,match
On if,countif,countifs,sumif,countifs,lookup,v lookup,index,matchRakesh Sah
 
10 Excel Formulas that will help you in any Job
10 Excel Formulas that will help you in any Job10 Excel Formulas that will help you in any Job
10 Excel Formulas that will help you in any JobHitesh Biyani
 

La actualidad más candente (20)

Using single row functions to customize output
Using single row functions to customize outputUsing single row functions to customize output
Using single row functions to customize output
 
Les01 (retrieving data using the sql select statement)
Les01 (retrieving data using the sql select statement)Les01 (retrieving data using the sql select statement)
Les01 (retrieving data using the sql select statement)
 
Sql server select queries ppt 18
Sql server select queries ppt 18Sql server select queries ppt 18
Sql server select queries ppt 18
 
Javascript validating form
Javascript validating formJavascript validating form
Javascript validating form
 
Retrieving data using the sql select statement
Retrieving data using the sql select statementRetrieving data using the sql select statement
Retrieving data using the sql select statement
 
Oracle: Basic SQL
Oracle: Basic SQLOracle: Basic SQL
Oracle: Basic SQL
 
1. dml select statement reterive data
1. dml select statement reterive data1. dml select statement reterive data
1. dml select statement reterive data
 
Beginers guide for oracle sql
Beginers guide for oracle sqlBeginers guide for oracle sql
Beginers guide for oracle sql
 
Understanding excel’s error values
Understanding excel’s error valuesUnderstanding excel’s error values
Understanding excel’s error values
 
Formula in MS Excel
Formula in MS ExcelFormula in MS Excel
Formula in MS Excel
 
Les11
Les11Les11
Les11
 
TrainingOutline_Excel_FormulasNFunctions_Workshop (Writing Sample)
TrainingOutline_Excel_FormulasNFunctions_Workshop (Writing Sample)TrainingOutline_Excel_FormulasNFunctions_Workshop (Writing Sample)
TrainingOutline_Excel_FormulasNFunctions_Workshop (Writing Sample)
 
Introduction to programming c and data-structures
Introduction to programming c and data-structures Introduction to programming c and data-structures
Introduction to programming c and data-structures
 
SQL subquery
SQL subquerySQL subquery
SQL subquery
 
Operators in c programming
Operators in c programmingOperators in c programming
Operators in c programming
 
Row, Column, Index, Match, Offset Functions. Excel Tutorial
Row, Column, Index, Match, Offset Functions. Excel TutorialRow, Column, Index, Match, Offset Functions. Excel Tutorial
Row, Column, Index, Match, Offset Functions. Excel Tutorial
 
Using Excel Functions
Using Excel FunctionsUsing Excel Functions
Using Excel Functions
 
On if,countif,countifs,sumif,countifs,lookup,v lookup,index,match
On if,countif,countifs,sumif,countifs,lookup,v lookup,index,matchOn if,countif,countifs,sumif,countifs,lookup,v lookup,index,match
On if,countif,countifs,sumif,countifs,lookup,v lookup,index,match
 
06
0606
06
 
10 Excel Formulas that will help you in any Job
10 Excel Formulas that will help you in any Job10 Excel Formulas that will help you in any Job
10 Excel Formulas that will help you in any Job
 

Similar a e computer notes - Writing basic sql select statements

Chinabankppt
ChinabankpptChinabankppt
Chinabankpptnewrforce
 
e computer notes - Restricting and sorting data
e computer notes -  Restricting and sorting datae computer notes -  Restricting and sorting data
e computer notes - Restricting and sorting dataecomputernotes
 
e computer notes - Producing readable output with i sql plus
e computer notes - Producing readable output with i sql pluse computer notes - Producing readable output with i sql plus
e computer notes - Producing readable output with i sql plusecomputernotes
 
ALL ABOUT SQL AND RDBMS
ALL ABOUT SQL AND RDBMSALL ABOUT SQL AND RDBMS
ALL ABOUT SQL AND RDBMSgaurav koriya
 
Les02 (restricting and sorting data)
Les02 (restricting and sorting data)Les02 (restricting and sorting data)
Les02 (restricting and sorting data)Achmad Solichin
 
e computer notes - From multiple tables
e computer notes - From multiple tablese computer notes - From multiple tables
e computer notes - From multiple tablesecomputernotes
 
e computer notes - Using set operator
e computer notes - Using set operatore computer notes - Using set operator
e computer notes - Using set operatorecomputernotes
 
e computer notes - Subqueries
e computer notes - Subqueriese computer notes - Subqueries
e computer notes - Subqueriesecomputernotes
 
e computer notes - Creating views
e computer notes - Creating viewse computer notes - Creating views
e computer notes - Creating viewsecomputernotes
 
Restricting and sorting data
Restricting and sorting dataRestricting and sorting data
Restricting and sorting dataSyed Zaid Irshad
 
e computer notes - Single row functions
e computer notes - Single row functionse computer notes - Single row functions
e computer notes - Single row functionsecomputernotes
 
Oracle - Program with PL/SQL - Lession 03
Oracle - Program with PL/SQL - Lession 03Oracle - Program with PL/SQL - Lession 03
Oracle - Program with PL/SQL - Lession 03Thuan Nguyen
 

Similar a e computer notes - Writing basic sql select statements (20)

Chinabankppt
ChinabankpptChinabankppt
Chinabankppt
 
e computer notes - Restricting and sorting data
e computer notes -  Restricting and sorting datae computer notes -  Restricting and sorting data
e computer notes - Restricting and sorting data
 
e computer notes - Producing readable output with i sql plus
e computer notes - Producing readable output with i sql pluse computer notes - Producing readable output with i sql plus
e computer notes - Producing readable output with i sql plus
 
ALL ABOUT SQL AND RDBMS
ALL ABOUT SQL AND RDBMSALL ABOUT SQL AND RDBMS
ALL ABOUT SQL AND RDBMS
 
Les02
Les02Les02
Les02
 
Les02 (restricting and sorting data)
Les02 (restricting and sorting data)Les02 (restricting and sorting data)
Les02 (restricting and sorting data)
 
Les02
Les02Les02
Les02
 
SQL- Introduction to MySQL
SQL- Introduction to MySQLSQL- Introduction to MySQL
SQL- Introduction to MySQL
 
e computer notes - From multiple tables
e computer notes - From multiple tablese computer notes - From multiple tables
e computer notes - From multiple tables
 
e computer notes - Using set operator
e computer notes - Using set operatore computer notes - Using set operator
e computer notes - Using set operator
 
0808.pdf
0808.pdf0808.pdf
0808.pdf
 
0808.pdf
0808.pdf0808.pdf
0808.pdf
 
e computer notes - Subqueries
e computer notes - Subqueriese computer notes - Subqueries
e computer notes - Subqueries
 
Module03
Module03Module03
Module03
 
e computer notes - Creating views
e computer notes - Creating viewse computer notes - Creating views
e computer notes - Creating views
 
Restricting and sorting data
Restricting and sorting dataRestricting and sorting data
Restricting and sorting data
 
e computer notes - Single row functions
e computer notes - Single row functionse computer notes - Single row functions
e computer notes - Single row functions
 
Oracle - Program with PL/SQL - Lession 03
Oracle - Program with PL/SQL - Lession 03Oracle - Program with PL/SQL - Lession 03
Oracle - Program with PL/SQL - Lession 03
 
Oracle: Basic SQL
Oracle: Basic SQLOracle: Basic SQL
Oracle: Basic SQL
 
Sql operators & functions 3
Sql operators & functions 3Sql operators & functions 3
Sql operators & functions 3
 

Más de ecomputernotes

computer notes - Data Structures - 30
computer notes - Data Structures - 30computer notes - Data Structures - 30
computer notes - Data Structures - 30ecomputernotes
 
computer notes - Data Structures - 39
computer notes - Data Structures - 39computer notes - Data Structures - 39
computer notes - Data Structures - 39ecomputernotes
 
computer notes - Data Structures - 11
computer notes - Data Structures - 11computer notes - Data Structures - 11
computer notes - Data Structures - 11ecomputernotes
 
computer notes - Data Structures - 20
computer notes - Data Structures - 20computer notes - Data Structures - 20
computer notes - Data Structures - 20ecomputernotes
 
computer notes - Data Structures - 15
computer notes - Data Structures - 15computer notes - Data Structures - 15
computer notes - Data Structures - 15ecomputernotes
 
Computer notes - Including Constraints
Computer notes - Including ConstraintsComputer notes - Including Constraints
Computer notes - Including Constraintsecomputernotes
 
Computer notes - Date time Functions
Computer notes - Date time FunctionsComputer notes - Date time Functions
Computer notes - Date time Functionsecomputernotes
 
Computer notes - Subqueries
Computer notes - SubqueriesComputer notes - Subqueries
Computer notes - Subqueriesecomputernotes
 
Computer notes - Other Database Objects
Computer notes - Other Database ObjectsComputer notes - Other Database Objects
Computer notes - Other Database Objectsecomputernotes
 
computer notes - Data Structures - 28
computer notes - Data Structures - 28computer notes - Data Structures - 28
computer notes - Data Structures - 28ecomputernotes
 
computer notes - Data Structures - 19
computer notes - Data Structures - 19computer notes - Data Structures - 19
computer notes - Data Structures - 19ecomputernotes
 
computer notes - Data Structures - 31
computer notes - Data Structures - 31computer notes - Data Structures - 31
computer notes - Data Structures - 31ecomputernotes
 
computer notes - Data Structures - 4
computer notes - Data Structures - 4computer notes - Data Structures - 4
computer notes - Data Structures - 4ecomputernotes
 
computer notes - Data Structures - 13
computer notes - Data Structures - 13computer notes - Data Structures - 13
computer notes - Data Structures - 13ecomputernotes
 
Computer notes - Advanced Subqueries
Computer notes -   Advanced SubqueriesComputer notes -   Advanced Subqueries
Computer notes - Advanced Subqueriesecomputernotes
 
Computer notes - Aggregating Data Using Group Functions
Computer notes - Aggregating Data Using Group FunctionsComputer notes - Aggregating Data Using Group Functions
Computer notes - Aggregating Data Using Group Functionsecomputernotes
 
computer notes - Data Structures - 16
computer notes - Data Structures - 16computer notes - Data Structures - 16
computer notes - Data Structures - 16ecomputernotes
 
computer notes - Data Structures - 22
computer notes - Data Structures - 22computer notes - Data Structures - 22
computer notes - Data Structures - 22ecomputernotes
 
computer notes - Data Structures - 35
computer notes - Data Structures - 35computer notes - Data Structures - 35
computer notes - Data Structures - 35ecomputernotes
 
computer notes - Data Structures - 36
computer notes - Data Structures - 36computer notes - Data Structures - 36
computer notes - Data Structures - 36ecomputernotes
 

Más de ecomputernotes (20)

computer notes - Data Structures - 30
computer notes - Data Structures - 30computer notes - Data Structures - 30
computer notes - Data Structures - 30
 
computer notes - Data Structures - 39
computer notes - Data Structures - 39computer notes - Data Structures - 39
computer notes - Data Structures - 39
 
computer notes - Data Structures - 11
computer notes - Data Structures - 11computer notes - Data Structures - 11
computer notes - Data Structures - 11
 
computer notes - Data Structures - 20
computer notes - Data Structures - 20computer notes - Data Structures - 20
computer notes - Data Structures - 20
 
computer notes - Data Structures - 15
computer notes - Data Structures - 15computer notes - Data Structures - 15
computer notes - Data Structures - 15
 
Computer notes - Including Constraints
Computer notes - Including ConstraintsComputer notes - Including Constraints
Computer notes - Including Constraints
 
Computer notes - Date time Functions
Computer notes - Date time FunctionsComputer notes - Date time Functions
Computer notes - Date time Functions
 
Computer notes - Subqueries
Computer notes - SubqueriesComputer notes - Subqueries
Computer notes - Subqueries
 
Computer notes - Other Database Objects
Computer notes - Other Database ObjectsComputer notes - Other Database Objects
Computer notes - Other Database Objects
 
computer notes - Data Structures - 28
computer notes - Data Structures - 28computer notes - Data Structures - 28
computer notes - Data Structures - 28
 
computer notes - Data Structures - 19
computer notes - Data Structures - 19computer notes - Data Structures - 19
computer notes - Data Structures - 19
 
computer notes - Data Structures - 31
computer notes - Data Structures - 31computer notes - Data Structures - 31
computer notes - Data Structures - 31
 
computer notes - Data Structures - 4
computer notes - Data Structures - 4computer notes - Data Structures - 4
computer notes - Data Structures - 4
 
computer notes - Data Structures - 13
computer notes - Data Structures - 13computer notes - Data Structures - 13
computer notes - Data Structures - 13
 
Computer notes - Advanced Subqueries
Computer notes -   Advanced SubqueriesComputer notes -   Advanced Subqueries
Computer notes - Advanced Subqueries
 
Computer notes - Aggregating Data Using Group Functions
Computer notes - Aggregating Data Using Group FunctionsComputer notes - Aggregating Data Using Group Functions
Computer notes - Aggregating Data Using Group Functions
 
computer notes - Data Structures - 16
computer notes - Data Structures - 16computer notes - Data Structures - 16
computer notes - Data Structures - 16
 
computer notes - Data Structures - 22
computer notes - Data Structures - 22computer notes - Data Structures - 22
computer notes - Data Structures - 22
 
computer notes - Data Structures - 35
computer notes - Data Structures - 35computer notes - Data Structures - 35
computer notes - Data Structures - 35
 
computer notes - Data Structures - 36
computer notes - Data Structures - 36computer notes - Data Structures - 36
computer notes - Data Structures - 36
 

Último

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 

Último (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

e computer notes - Writing basic sql select statements

  • 1. Basic SELECT Statement http://ecomputernotes.com
  • 2. " " http://ecomputernotes.com Basic SELECT Statement SELECT * | { [DISTINCT] column | expression [ alias ],...} FRO M table; SELECT identifies what columns FROM identifies which table
  • 3. http://ecomputernotes.com Selecting All Columns SELECT * FROM departments;
  • 4. Selecting Specific Columns SELECT department_id, location_id FROM departments; http://ecomputernotes.com
  • 5. Writing SQL Statements " SQL statements are not case sensitive. " SQL statements can be 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. http://ecomputernotes.com
  • 6. Column Heading Defaults " i SQL*Plus: Default heading justification: Center Default heading display: Uppercase " SQL*Plus: Character and Date column headings are left- justified Number column headings are right-justified Default heading display: Uppercase http://ecomputernotes.com
  • 7. Arithmetic Expressions Create expressions with number and date data by using arithmetic operators. Operator Description + Add - Subtract * Multiply / Divide http://ecomputernotes.com
  • 8. Using Arithmetic Operators SELECT last_name, salary, salary + 300 FROM employees; « http://ecomputernotes.com
  • 9. Operator Precedence _ / + * "M ultiplication and division take priority over addition and subtraction. "O perators of the same priority are evaluated from left to right. "P arentheses are used to force prioritized evaluation and to clarify statements. http://ecomputernotes.com
  • 10. Operator Precedence SELECT last_name, salary, 12*salary+100 FROM employees; « http://ecomputernotes.com
  • 11. Using Parentheses SELECT last_name, salary, 12*(salary+100) FROM employees; «
  • 12. Defining a Null Value "A null is a value that is unavailable, unassigned, unknown, or inapplicable. "A null is not the same as zero or a blank space. SELECT last_name, job_id, salary, commission_pct FROM employees; « «
  • 13. Null Values in Arithmetic Expressions Arithmetic expressions containing a null value evaluate to null. SELECT last_name, 12*salary*commission_pct FROM employees; « «
  • 14. Defining a Column Alias A column alias: " Renames a column heading " Is useful with calculations " Immediately follows the column name - there can also be the optional AS keyword between the column name and alias "R equires double quotation marks if it contains spaces or special characters or is case sensitive
  • 15. Using Column Aliases SELECT last_name AS name, commission_pct comm FROM employees; « SELECT last_name "Name", salary*12 "Annual Salary" FROM employees; «
  • 16. Concatenation Operator A concatenation operator: " Concatenates columns or character strings to other columns " Is represented by two vertical bars (||) " Creates a resultant column that is a character expression
  • 17. Using the Concatenation Operator SELECT last_name||job_id AS "Employees" FRO M employees; «
  • 18. Literal Character Strings "A literal is a character, a number, or a date included in the SELECT list. "D ate and character literal values must be enclosed within single quotation marks. "E ach character string is output once for each row returned.
  • 19. Using Literal Character Strings SELECT last_name ||' is a '||job_id AS "Employee Details" FROM employees; «
  • 20. Duplicate Rows The default display of queries is all rows, including duplicate rows. SELECT department_id FROM employees; «
  • 21. Eliminating Duplicate Rows Eliminate duplicate rows by using the DISTINCT keyword in the SELECT clause. SELECT DISTINCT department_id FROM employees;
  • 22. Displaying Table Structure DESCRIBE employees
  • 23.