Connect with us

SQL

SQL Aliases

mm

Published

on

SQL aliases are used for the moment rename a table or a column title. Mainly aliases are created to make column names more clear.
Syntax for Columns:-

SELECT column_name AS alias_name FROM table_name;

Syntax for Tables:-
SELECT column_name(s) FROM table_name AS alias_name;
Example:-
SELECT VisitorName AS Visitor, ContactName AS [Contact Person] FROM Visitors;
Example2:-
SELECT o.OrderID, o.OrderDate, c. VisitorName FROM Visitors AS c, Orders AS o WHERE c. VisitorName=”vikas” AND c. VisitorID=o. VisitorID;

Also Read :   SQL Where

Hi, Thank you for reading my article. I am Victor, a professional blogger from Jaipur, India.I started webetutorial for blogging & sharing solution for developer questions, and now it’s empowering globally by helping them to make money.I am writing about starting & managing a blogs, WordPress, Magento, Social Media, SEO, Marketing, making money online, Investment, Finance, Gadgets, Fitness and more.

Continue Reading
Advertisement
Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

11 − 9 =

SQL

SQL Alter Table

mm

Published

on

The SQL ALTER TABLE is used to add, delete or modify columns in an existing table.
SQL Alter Table:-
ALTER TABLE table_name ADD column_name datatype

Drop Column:-

ALTER TABLE table_name DROP COLUMN column_name;

Add Unique Constraint:-

ALTER TABLE table_name ADD CONSTRAINT MyUniqueConstraint UNIQUE(column1, column2…);

Add Primary Key:-

ALTER TABLE table_name ADD CONSTRAINT PrimaryKey PRIMARY KEY (column1, column2…);

Also Read :   SQL Where
Continue Reading

Trending