Writing Basic SQL SELECT Statements

Slides:



Advertisements
Similar presentations
1Eyad Alshareef Enhanced Guide to Oracle 10g Chapter 3: Using SQL Queries to Insert, Update, Delete, and View Data.
Advertisements

Chapter 11 Group Functions
LECTURE 8.  Consider the table employee(employee_id,last_name,job_id, department_id )  assume that you want to display all the employees in department.
Writing Basic SQL Statements. Objectives After completing this lesson, you should be able to do the following:  List the capabilities of SQL SELECT statements.
Writing Basic SQL SELECT Statements. Capabilities of SQL SELECT Statements A SELECT statement retrieves information from the database. Using a SELECT.
Introduction to Oracle9i: SQL1 Basic SQL SELECT Statements.
Restricting and Sorting Data. Consider the table employee(employee_id,last_name,job_id, department_id ) assume that you want to display all the employees.
1 Copyright © Oracle Corporation, All rights reserved. Writing Basic SQL SELECT Statements.
2 Copyright © 2004, Oracle. All rights reserved. Restricting and Sorting Data.
Writing Basic SQL statement 2 July July July Create By Pantharee Sawasdimongkol.
WRITING BASIC SQL SELECT STATEMENTS Lecture 7 1. Outlines  SQL SELECT statement  Capabilities of SELECT statements  Basic SELECT statement  Selecting.
Chapter 1 Writing Basic SQL Statements Important Legal Notice:  Materials on this lecture are from a book titled “Oracle Education” by Kochhar, Gravina,
Sorting data and Other selection Techniques Ordering data results Allows us to view our data in a more meaningful way. Rather than just a list of raw.
Ceng 356-Lab2. Objectives After completing this lesson, you should be able to do the following: Limit the rows that are retrieved by a query Sort the.
Ceng 356-Lab1. Objectives After completing this lesson, you should be able to do the following: Get Familiar with the development environment List the.
1 Copyright © Oracle Corporation, All rights reserved. Writing Basic SQL SELECT Statements.
Chapter 2 Basic SQL SELECT Statements
Chapter 2 Basic SQL SELECT Statements Oracle 10g: SQL.
1 Copyright © 2006, Oracle. All rights reserved. Retrieving Data Using the SQL SELECT Statement.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Restricting and Sorting Data. ◦ Limiting rows with:  The WHERE clause  The comparison conditions using =,
2 Copyright © Oracle Corporation, All rights reserved. Restricting and Sorting Data.
2 Copyright © 2004, Oracle. All rights reserved. Restricting and Sorting Data.
4 Copyright © 2006, Oracle. All rights reserved. Restricting and Sorting Data.
After completing this lesson, you should be able to do the following: List the capabilities of MySQL SELECT statements Execute a basic SELECT statement.
2 Writing Basic SELECT Statements. 1-2 Copyright  Oracle Corporation, All rights reserved. Capabilities of SQL SELECT Statements Selection Projection.
Copyright  Oracle Corporation, All rights reserved. Writing Basic SQL Statements.
RELATSIOONILISED ANDMEBAASID(alg) SQLi VÕIMALUSED.
Oracle 11g DATABASE DEVELOPMENT LAB1. Introduction  Oracle 11g Database:-  Oracle 11g database is designed for some features, which helps to the organizations.
Introduction to SQL PART Ⅰ 第一讲 Writing Basic SQL SELECT Statements.
IFS Intro to Data Management Chapter 5 Getting More Than Simple Columns.
1 Writing Basic SQL Statements. 1-2 Objectives At the end of this lesson, you should be able to: List the capabilities of SQL SELECT statements Execute.
2 第二讲 Restricting and Sorting Data. Objectives After completing this lesson, you should be able to do the following: Limit the rows retrieved by a query.
Copyright © 2004, Oracle. All rights reserved. Retrieving Data Using the SQL SELECT Statement Satrio Agung Wicaksono, S.Kom., M.Kom.
Copyright © 2004, Oracle. All rights reserved. Lecture 4: 1-Retrieving Data Using the SQL SELECT Statement 2-Restricting and Sorting Data Lecture 4: 1-Retrieving.
Structured Query Language
Queries SELECT [DISTINCT] FROM ( { }| ),... [WHERE ] [GROUP BY [HAVING ]] [ORDER BY [ ],...]
2 Copyright © 2004, Oracle. All rights reserved. Restricting and Sorting Data.
I-1 Copyright س Oracle Corporation, All rights reserved. Data Retrieval.
Working with Columns, Characters, and Rows. 2 home back first prev next last What Will I Learn? In this lesson, you will learn to: –Apply the concatenation.
1 Copyright © Oracle Corporation, All rights reserved. Writing Basic SQL SELECT Statements.
2 Copyright © 2009, Oracle. All rights reserved. Restricting and Sorting Data.
1 Chapter 2 Basic SQL SELECT Statements. 2 Chapter Objectives Distinguish between an RDBMS and an ORDBMS Identify keywords, mandatory clauses, and optional.
1-1 Copyright  Oracle Corporation, All rights reserved. Logging In to SQL*Plus From Windows environment:From Windows environment: From command line:From.
9/29/2005From Introduction to Oracle:SQL and PL/SQL, Oracle 1 Restricting and Sorting Data Kroenke, Chapter Two.
Simple Queries DBS301 – Week 1. Objectives Basic SELECT statement Computed columns Aliases Concatenation operator Use of DISTINCT to eliminate duplicates.
Writing Basic SQL Statements. Objectives After completing this lesson, you should be able to do the following: –List the capabilities of SQL SELECT statements.
Writing Basic SQL SELECT Statements Lecture
Limiting Selected Rows. 2-2 Objectives Sort row output using the ORDER BY clause. Sort row output using the ORDER BY clause. Enter search criteria using.
1 Copyright © 2007, Oracle. All rights reserved. Retrieving Data Using the SQL SELECT Statement.
Oracle 10g Retrieving Data Using the SQL SELECT Statement.
1 Copyright © 2009, Oracle. All rights reserved. Retrieving Data Using the SQL SELECT Statement.
Copyright س Oracle Corporation, All rights reserved. 1 Writing Basic SQL Statements.
1 Copyright © 2004, Oracle. All rights reserved. Retrieving Data Using the SQL SELECT Statement.
IFS180 Intro. to Data Management Chapter 10 - Unions.
Retrieving Data Using the SQL SELECT Statement
Writing Basic SQL SELECT Statements
Basic select statement
Using the Set Operators
Writing Basic SQL SELECT Statements
Using the Set Operators
Retrieving Data Using the SQL SELECT Statement
Restricting and Sorting Data
Single-Row Functions Lecture 9.
Writing Basic SQL SELECT Statements
Writing Basic SQL Statements
Retrieving Data Using the SQL SELECT Statement
Using the Set Operators
Restricting and Sorting Data
Presentation transcript:

Writing Basic SQL SELECT Statements Lecture 7 -2

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 Columns on either side of the operator are combined to make a single output column Ghadah Al Hadba

Using the Concatenation Operator ( Example ) Ghadah Al Hadba

Literal Character Strings A literal value is a character, a number, or a date included in the SELECT list. Date and character literal values must be enclosed within single quotation marks (‘ ‘). Each character string is output once for each row returned Ghadah Al Hadba

Literal Character Strings (Example) Ghadah Al Hadba

Duplicate Rows The default display of queries is all rows, including duplicate rows. For example: Ghadah Al Hadba

Eliminating Duplicate Rows Eliminate duplicate rows by using the DISTINCT keyword in the SELECT clause. For example: Ghadah Al Hadba

Eliminating Duplicate Rows (Cont.) Note That: you can specify multiple columns after the DISTINCT qualifier. In such case, the DISTINCT will affect all the selected columns and the result is every distinct combination of the columns (see Example -3-) Ghadah Al Hadba

Example-3- Ghadah Al Hadba