|
INTERVIEW QUESTIONS
DATABASE
MS SQL SERVER
DETAILS
Question: How To Define and Use Table Alias Names in MS SQL Server?
Answer: When column names need to be prefixed with table names, you can define table alias name and use them to prefix column names. To define an alias for a table name, just enter the alias name right after the original table name in the FROM clause as shown in the following select statement:
SELECT l.id, l.url, r.comment FROM ggl_links l INNER JOIN ggl_rates r ON l.id = r.id GO id url comment 101 www.globalguideline.com The best 102 www.globalguideline.com/html Well done 103 www.globalguideline.com/sql Thumbs up
|
|
|
Category |
MS SQL Server Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 7032 users |
Added on |
9/23/2014 |
Views |
67262 |
Rate it! |
|
|
Question:
How To Define and Use Table Alias Names in MS SQL Server?
Answer:
When column names need to be prefixed with table names, you can define table alias name and use them to prefix column names. To define an alias for a table name, just enter the alias name right after the original table name in the FROM clause as shown in the following select statement:
SELECT l.id, l.url, r.comment FROM ggl_links l INNER JOIN ggl_rates r ON l.id = r.id GO id url comment 101 www.globalguideline.com The best 102 www.globalguideline.com/html Well done 103 www.globalguideline.com/sql Thumbs up Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
How To Write a Query with an Inner Join in MS SQL Server?
|
View Answer
|
|
How To Join Two Tables in a Single Query in MS SQL Server?
|
View Answer
|
|
How To Delete All Rows with TRUNCATE TABLE Statement in MS SQL Server?
|
View Answer
|
|
How To Delete Multiple Rows with One DELETE Statement in MS SQL Server?
|
View Answer
|
|
How To Delete an Existing Row with DELETE Statements in MS SQL Server?
|
View Answer
|
|
What Happens If the UPDATE Subquery Returns Multiple Rows in MS SQL Server?
|
View Answer
|
|
What Happens If the UPDATE Subquery Returns No Rows in MS SQL Server?
|
View Answer
|
|
How To Use Values from Other Tables in UPDATE Statements in MS SQL Server?
|
View Answer
|
|
Is the Order of Columns in the SET Clause Important in MS SQL Server?
|
View Answer
|
|
How to use old values to define new values in UPDATE statements in MS SQL Server?
|
View Answer
|
|
How To Update Multiple Rows with One UPDATE Statement in MS SQL Server?
|
View Answer
|
|
How To Update Values in a Table with UPDATE Statements in MS SQL Server?
|
View Answer
|
|
How To Insert Multiple Rows with One INSERT Statement in MS SQL Server?
|
View Answer
|
|
What Happens If You Insert a Duplicate Key for the Primary Key Column in MS SQL Server?
|
View Answer
|
|
How to provide column names in INSERT Statements in MS SQL Server?
|
View Answer
|
|
How To Use Column Default Values in INSERT Statements in MS SQL Server?
|
View Answer
|
|
How To Insert a New Row into a Table with "INSERT INTO" Statements in MS SQL Server?
|
View Answer
|
|
How To Create a Testing Table with Test Data in MS SQL Server?
|
View Answer
|
|
What Are DML (Data Manipulation Language) Statements in MS SQL Server?
|
View Answer
|
|
How To Drop an Existing Table with "DROP TABLE" Statements in MS SQL Server?
|
View Answer
|