SlideShare una empresa de Scribd logo
1 de 2
Descargar para leer sin conexión
8/10/13 SQL Alias
beginner-sql-tutorial.com/sql-aliases.htm 1/2
SQL Alias
SQL Aliases are defined for columns and tables. Basically aliases is created to make the column selected more
readable.
For Example: To select the first name of all the students, the query would be like:
Aliases for columns:
SELECT first_name AS Name FROM student_details;
or
SELECT first_name Name FROM student_details;
In the above query, the column first_name is given a alias as 'name'. So when the result is displayed the column
name appears as 'Name' instead of 'first_name'.
Output:
Name
-------------
Rahul Sharma
Anjali Bhagwat
Stephen Fleming
Shekar Gowda
Priya Chandra
Aliases for tables:
SELECT s.first_name FROM student_details s;
In the above query, alias 's' is defined for the table student_details and the column first_name is selected from
the table.
8/10/13 SQL Alias
beginner-sql-tutorial.com/sql-aliases.htm 2/2
Aliases is more useful when
There are more than one tables involved in a query,
Functions are used in the query,
The column names are big or not readable,
More than one columns are combined together

Más contenido relacionado

La actualidad más candente

Constraints In Sql
Constraints In SqlConstraints In Sql
Constraints In Sql
Anurag
 
06.01 sql select distinct
06.01 sql select distinct06.01 sql select distinct
06.01 sql select distinct
Bishal Ghimire
 

La actualidad más candente (20)

SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL Commands
 
SQL Commands
SQL Commands SQL Commands
SQL Commands
 
8. transactions
8. transactions8. transactions
8. transactions
 
Sql subquery
Sql  subquerySql  subquery
Sql subquery
 
Oracle SQL Advanced
Oracle SQL AdvancedOracle SQL Advanced
Oracle SQL Advanced
 
The Relational Model
The Relational ModelThe Relational Model
The Relational Model
 
pl/sql Procedure
pl/sql Procedurepl/sql Procedure
pl/sql Procedure
 
SQL JOINS
SQL JOINSSQL JOINS
SQL JOINS
 
SQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics CoveredSQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics Covered
 
Oracle: Joins
Oracle: JoinsOracle: Joins
Oracle: Joins
 
SQL subquery
SQL subquerySQL subquery
SQL subquery
 
Introduction to database & sql
Introduction to database & sqlIntroduction to database & sql
Introduction to database & sql
 
Sql basics and DDL statements
Sql basics and DDL statementsSql basics and DDL statements
Sql basics and DDL statements
 
ORACLE PL SQL
ORACLE PL SQLORACLE PL SQL
ORACLE PL SQL
 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)
 
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFDatabase Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
 
Query processing and Query Optimization
Query processing and Query OptimizationQuery processing and Query Optimization
Query processing and Query Optimization
 
SQL(DDL & DML)
SQL(DDL & DML)SQL(DDL & DML)
SQL(DDL & DML)
 
Constraints In Sql
Constraints In SqlConstraints In Sql
Constraints In Sql
 
06.01 sql select distinct
06.01 sql select distinct06.01 sql select distinct
06.01 sql select distinct
 

Similar a Sql alias

Sql select statement
Sql select statementSql select statement
Sql select statement
Vivek Singh
 
Sql where clause
Sql where clauseSql where clause
Sql where clause
Vivek Singh
 
Sql where clause
Sql where clauseSql where clause
Sql where clause
Vivek Singh
 
Sql – Structured Query Language
Sql – Structured Query LanguageSql – Structured Query Language
Sql – Structured Query Language
pandey3045_bit
 
Creating a database
Creating a databaseCreating a database
Creating a database
Rahul Gupta
 
Farheen abdul hameed ip project (MY SQL);
Farheen abdul hameed ip project (MY SQL);Farheen abdul hameed ip project (MY SQL);
Farheen abdul hameed ip project (MY SQL);
abdul talha
 
Sql order by clause
Sql order by clauseSql order by clause
Sql order by clause
Vivek Singh
 
Sql query tuning or query optimization
Sql query tuning or query optimizationSql query tuning or query optimization
Sql query tuning or query optimization
Vivek Singh
 

Similar a Sql alias (20)

Sql select statement
Sql select statementSql select statement
Sql select statement
 
Sql where clause
Sql where clauseSql where clause
Sql where clause
 
Sql where clause
Sql where clauseSql where clause
Sql where clause
 
ORACLE, SQL, PL/SQL Made very very Easy Happy Learning....
ORACLE, SQL, PL/SQL Made very very Easy Happy Learning....ORACLE, SQL, PL/SQL Made very very Easy Happy Learning....
ORACLE, SQL, PL/SQL Made very very Easy Happy Learning....
 
Oracle Notes
Oracle NotesOracle Notes
Oracle Notes
 
Retrieving Data From A Database
Retrieving Data From A DatabaseRetrieving Data From A Database
Retrieving Data From A Database
 
MS SQLSERVER:Retrieving Data From A Database
MS SQLSERVER:Retrieving Data From A DatabaseMS SQLSERVER:Retrieving Data From A Database
MS SQLSERVER:Retrieving Data From A Database
 
MS SQL SERVER: Retrieving Data From A Database
MS SQL SERVER: Retrieving Data From A DatabaseMS SQL SERVER: Retrieving Data From A Database
MS SQL SERVER: Retrieving Data From A Database
 
Database models and DBMS languages
Database models and DBMS languagesDatabase models and DBMS languages
Database models and DBMS languages
 
SQL Keywords and Functions.pptx
SQL Keywords and Functions.pptxSQL Keywords and Functions.pptx
SQL Keywords and Functions.pptx
 
Sql – Structured Query Language
Sql – Structured Query LanguageSql – Structured Query Language
Sql – Structured Query Language
 
Chapter08
Chapter08Chapter08
Chapter08
 
Best sql plsql material
Best sql plsql materialBest sql plsql material
Best sql plsql material
 
Creating a database
Creating a databaseCreating a database
Creating a database
 
unit-5 sql notes.docx
unit-5 sql notes.docxunit-5 sql notes.docx
unit-5 sql notes.docx
 
Farheen abdul hameed ip project (MY SQL);
Farheen abdul hameed ip project (MY SQL);Farheen abdul hameed ip project (MY SQL);
Farheen abdul hameed ip project (MY SQL);
 
SQL Statements.pptx
SQL Statements.pptxSQL Statements.pptx
SQL Statements.pptx
 
Sql subquery
Sql subquerySql subquery
Sql subquery
 
Sql order by clause
Sql order by clauseSql order by clause
Sql order by clause
 
Sql query tuning or query optimization
Sql query tuning or query optimizationSql query tuning or query optimization
Sql query tuning or query optimization
 

Más de Vivek Singh

C programming session 14
C programming session 14C programming session 14
C programming session 14
Vivek Singh
 
C programming session 13
C programming session 13C programming session 13
C programming session 13
Vivek Singh
 
C programming session 11
C programming session 11C programming session 11
C programming session 11
Vivek Singh
 
C programming session 10
C programming session 10C programming session 10
C programming session 10
Vivek Singh
 
C programming session 08
C programming session 08C programming session 08
C programming session 08
Vivek Singh
 
C programming session 07
C programming session 07C programming session 07
C programming session 07
Vivek Singh
 
C programming session 05
C programming session 05C programming session 05
C programming session 05
Vivek Singh
 
C programming session 04
C programming session 04C programming session 04
C programming session 04
Vivek Singh
 
C programming session 02
C programming session 02C programming session 02
C programming session 02
Vivek Singh
 
C programming session 01
C programming session 01C programming session 01
C programming session 01
Vivek Singh
 
C programming session 16
C programming session 16C programming session 16
C programming session 16
Vivek Singh
 
Niit aptitude question paper
Niit aptitude question paperNiit aptitude question paper
Niit aptitude question paper
Vivek Singh
 
Excel shortcut and tips
Excel shortcut and tipsExcel shortcut and tips
Excel shortcut and tips
Vivek Singh
 
Sql update statement
Sql update statementSql update statement
Sql update statement
Vivek Singh
 
Sql tutorial, tutorials sql
Sql tutorial, tutorials sqlSql tutorial, tutorials sql
Sql tutorial, tutorials sql
Vivek Singh
 
Sql query tips or query optimization
Sql query tips or query optimizationSql query tips or query optimization
Sql query tips or query optimization
Vivek Singh
 
Sql operators comparision & logical operators
Sql operators   comparision & logical operatorsSql operators   comparision & logical operators
Sql operators comparision & logical operators
Vivek Singh
 
Sql logical operators
Sql logical operatorsSql logical operators
Sql logical operators
Vivek Singh
 

Más de Vivek Singh (20)

C programming session 14
C programming session 14C programming session 14
C programming session 14
 
C programming session 13
C programming session 13C programming session 13
C programming session 13
 
C programming session 11
C programming session 11C programming session 11
C programming session 11
 
C programming session 10
C programming session 10C programming session 10
C programming session 10
 
C programming session 08
C programming session 08C programming session 08
C programming session 08
 
C programming session 07
C programming session 07C programming session 07
C programming session 07
 
C programming session 05
C programming session 05C programming session 05
C programming session 05
 
C programming session 04
C programming session 04C programming session 04
C programming session 04
 
C programming session 02
C programming session 02C programming session 02
C programming session 02
 
C programming session 01
C programming session 01C programming session 01
C programming session 01
 
C programming session 16
C programming session 16C programming session 16
C programming session 16
 
Niit aptitude question paper
Niit aptitude question paperNiit aptitude question paper
Niit aptitude question paper
 
Excel shortcut and tips
Excel shortcut and tipsExcel shortcut and tips
Excel shortcut and tips
 
Sql update statement
Sql update statementSql update statement
Sql update statement
 
Sql tutorial, tutorials sql
Sql tutorial, tutorials sqlSql tutorial, tutorials sql
Sql tutorial, tutorials sql
 
Sql rename
Sql renameSql rename
Sql rename
 
Sql query tips or query optimization
Sql query tips or query optimizationSql query tips or query optimization
Sql query tips or query optimization
 
Sql operators comparision & logical operators
Sql operators   comparision & logical operatorsSql operators   comparision & logical operators
Sql operators comparision & logical operators
 
Sql logical operators
Sql logical operatorsSql logical operators
Sql logical operators
 
Sql joins
Sql joinsSql joins
Sql joins
 

Último

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Último (20)

Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 

Sql alias

  • 1. 8/10/13 SQL Alias beginner-sql-tutorial.com/sql-aliases.htm 1/2 SQL Alias SQL Aliases are defined for columns and tables. Basically aliases is created to make the column selected more readable. For Example: To select the first name of all the students, the query would be like: Aliases for columns: SELECT first_name AS Name FROM student_details; or SELECT first_name Name FROM student_details; In the above query, the column first_name is given a alias as 'name'. So when the result is displayed the column name appears as 'Name' instead of 'first_name'. Output: Name ------------- Rahul Sharma Anjali Bhagwat Stephen Fleming Shekar Gowda Priya Chandra Aliases for tables: SELECT s.first_name FROM student_details s; In the above query, alias 's' is defined for the table student_details and the column first_name is selected from the table.
  • 2. 8/10/13 SQL Alias beginner-sql-tutorial.com/sql-aliases.htm 2/2 Aliases is more useful when There are more than one tables involved in a query, Functions are used in the query, The column names are big or not readable, More than one columns are combined together