GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Database  >  SQL Server
Go To First  |  Previous Question  |  
 SQL Server  |  Question 94 of 94    Print  
Table Name Alias
Why do we use alias for the table name? What is its importance?


  
Total Answers and Comments: 2 Last Update: August 05, 2008     Asked by: AnithaBabu1 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
August 04, 2008 20:53:55   #1  
rarbuckle1982 Member Since: August 2008   Contribution: 1    

RE: Table Name Alias
It is a shorthand notation.  Easier to use if you have to reference the table over and over.

SELECT * FROM tbl_Long_Table_Name, tbl_Other_Long_Table_Name
WHERE tbl_Long_Table_Name.FieldID=tbl_Other_Long_Table_Name.FieldID
 AND tbl_Long_Table_Name.FieldID=1

Can be done like this:

SELECT * FROM tbl_Long_Table_Name a, tbl_Other_Long_Table_Name b
WHERE a.FieldID = b.FieldID
 AND a.FieldID=1



 
Is this answer useful? Yes | No
August 05, 2008 04:42:33   #2  
soujanyaj Member Since: July 2007   Contribution: 1    

RE: Table Name Alias

The Alias name is used as a shorthand notation for the tble name, for example: if there are 2 tables with long name then it will be difficuilt to call that table hence the alias name is used.

table alias name is also used to remove the ambiguity of the column names used in different tables


 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : Right click table in SSMS > Script Table as > CreateYour question of "copy" infers that you want all the constraints.  The example that you give doesn't fill the requierments.  As you want the structure you would als ...
Read Answers (14) | Asked by : Beena

Latest Answer : For example let us take emp table.   query to delete duplicate row  will be like thisDelete  * from  emp where Rowid   not in (select  max(Row id) from emp grop by all  columns) ...
Read Answers (19) | Asked by : Beena

Latest Answer : Normalization is the technique of breaking the complex tables into much understandable smaller one to improve the optimzation of the database structure. The concept of "Fucntional Dependancy" is followed in Second Normal Form (2NF) which means ...
Read Answers (2) | Asked by : Beena

What is the difference among "dropping a tableâ€,†truncating a table" and deleting all records" from a table?
Read Answers (13) | Asked by : Beena

1)What is the maximum value that can be stored for a datetime field? a. Dec 31, 9999 b. Jun 6, 2079 c. Jan 1, 2753 d. Jan 1, 2100 2)What is the correct SQL syntax for returning all the columns from a table named "Persons" sorted REVERSE alphabetically by "FirstName"? a. SELECT * FROM Persons WHERE FirstName ORDER BY FirstName DESC b. SELECT * FROM Persons SORT REVERSE 'FirstName' c. SELECT * FROM Persons ORDER BY -'FirstName' d. SELECT
Read Answers (3) | Asked by : samir khan

1. Types of Triggers in Oracle 2. Can we relate two different tables from two different users in ORACLE,PL/SQL? 3. How can I combine sequence with select statement which is used in another insert statement. i.e.Insert 4. if records are inserted into table without committing.How to refer to these values in a procedure? 5. when we need to use USING clause in the sql?For example in this below:SELECT emp_name, department_name
Read Answers (1) | Asked by : lavanya

How many column maximum we can add in one table and how many foreign key maximum we can use in one table?
Read Answers (14) | Asked by : Rado mathan Kumar

What is the code to create a table having a column named DATE, which takes date in the format dd/mm/yyyy, in SQL Server2000? Or any format of date.

Can we generate a trigger for two tables? if so what is the query to generate a trigger for two tables employee table and department table with employee having department no.
Read Answers (11) | Asked by : laxman

Write sql query for retrieving employee names from employee table who are having salary greater than 5000 without using where clause?
Read Answers (12) | Asked by : Ashok


 Sponsored Links

 
Related Articles

Using XMLType for Handling XML Data in the Database

Using XMLType for Handling XML Data in the Database Being an object type XMLType can not only be used to store XML data in the database but also to operate on that data via its built in methods Regardless of the storage model you choose XMLType provides a set of XML specific methods to operate on XM
 

Using Oracle Database for Storing, Modifying, and Retrieving XML Data

Using Oracle Database for Storing Modifying and Retrieving XML Data With Oracle XML DB you have various XML storage and XML processing options allowing you to achieve the required level of performance and scalability One of the most interesting things about Oracle XML DB is that it allows you to per
 

Performing XSLT Transformations inside the Database

Performing XSLT Transformations inside the Database Now that you have the employees XSL stylesheet stored in the database and the xmlusr schema is permitted to access the hr employees table you can create a script that will instruct the database to build an HTML page based on the data stored in hr e
 

Moving All the XML Processing into the Database

Moving All the XML Processing into the Database In the preceding example the database server performs only a part of the XML processing while the rest is still performed by the PHP engine Specifically the database server generates an employees XML document based on the records from the hr employees
 

Performing XML Processing inside the Database

Performing XML Processing inside the Database When building XML enabled applications on top of Oracle there are many advantages to performing the XML processing inside the database when compared to performing it on the client The key advantages to perform XML processing inside the database are as fo
 

ODP.NET - Populating a Dataset with a Single Data Table

ODP NET Populating a Dataset with a Single Data Table A dataset is simply a group of data tables These data tables can be identified with their own unique names within a dataset You can also add relations between data tables available in a dataset mosgoogle The following code gives you the details o
 

SQL Server 2005 Integration Services Review

SQL Server 2005 Integration Services using Visual Studio 2005 A Beginner s Guide SQL Server 2005 A offering of Microsoft Corporation for database management the SQL server 2005 is one of the powerful database management systems in the world Available for integration in almost any system that uses Mi
 

SQL Server Integration Services

SQL Server Integration Services Here is a sample chapter from Beginners Guide to SQL Server Integration Services Using Visual Studio 2005 by Jayaram Krishnaswamy Environment set up for Visual Studio 2005 with respect to SSIS and multiple tasking Connecting to Microsoft Access Text Files Excel S
 

Web Server

Web Server A web server can be a program or the computer itself which receives the requests from various other browsers and responds to those requests These requests are all requests that are being sent for some documents There are two kinds of web servers available The web server program and the
 

jQuery Table Row Finished Code

jQuery Table Row Finished Code The Finished Code Our second example page has demonstrated table row striping highlighting tooltips collapsing expanding and filtering Taken together the JavaScript code for this page is mosgoogle geshibot lang php" document ready function var highlighted
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape