Total Page Preview:   000000000636

What is SQL aliases in English and Hindi

 

SQL Aliases in Engilsh

SQL Aliases are used to give a temporary or alternative name to a table or column in a SQL query. Aliases are often used to make the SQL statements more readable or to avoid name conflicts between tables or columns with similar names.

The syntax for assigning aliases to tables and columns in a SQL query is as follows:
In this syntax, you use the AS keyword to assign an alias to a column or a table. Here's an example that demonstrates how to use aliases to make a SQL statement more readable:
Suppose we have a table named employees with the following data:
If we want to retrieve the first and last names of the employees along with their salaries, we can use the following SQL query with aliases:
 
This query will return the following result:
In this example, we have used the AS keyword to assign the alias "annual_salary" to the "salary" column. This makes the result more readable and provides a clear indication of what the value represents.

 

 

SQL Aliases in Hindi

SQL Aliases ka istemal hum kisi table ya column ka nam badal kar uska naya nam assign karne ke liye karte hain. Ye kisi bhi query ke readability ko improve karne me help karta hai.
Aliases ka istemal SELECT, FROM, WHERE, GROUP BY, ORDER BY ke sath kiya jata hai. Aliases ka istemal hum tab karte hai jab kisi table ka nam bahut lamba ho ya phir kisi query me same table ke columns ka use multiple times ho.
 
Example ke tor par, agar hum ek table "employees" ke columns "first_name" and "last_name" ko select karna chahte hain to hum is tarah ka query likh sakte hain:
 
Is query ke through humne "employees" table ke "first_name" column ka alias "fname" and "last_name" column ka alias "lname" create kiya hai.

 

 

 

Thank You

About Author

Brijesh Kumar

Database Developer

I have more then 6 years Experience in Microsoft Technologies - SQL Server Database, ETL Azure Cloud - Azure SQL Database, CosmosDB, Azure Data Factory, PowerBI, Web Job, Azure Function, Azure Storage, Web Apps, Powershall and Database Migration On-Premise to Azure Cloud.
LinkedIn : https://www.linkedin.com



Comments


                           
                           

                           

                           

Facebook User: