Database System Lab-6
Database System Lab-6
Database system
Aliases
SQL aliases are used to give a table, or a column in a table, a temporary name.
SELECT ID, Student_name + ', ' + PostalCode + ' ' + City + ', ' + Country AS Address
FROM Student;
SELECT o.OrderID, o.OrderDate, c.CustomerName
FROM Customers AS c, Orders AS o
WHERE c.CustomerName='Around the Horn' AND c.CustomerID=o.CustomerID;
SQL SELECT DISTINCT Statement
Write a SQL query that retrieves the ID, Contact, and Student name Address ," using table aliases, and then
retrieve a list of distinct Cities from the Student table.
Answer