Wednesday, February 21, 2018

SQL

ALIAS QUERY

Table User

ID  |  USER_ID  | USER_NAME | PHONE_NO | ADDRESS

Table Company

ID | COMPANY_NAME | USER_ID


Table alias
SELECT  ur.USER_ID , ur.USER_NAME , cm.COMAPANY_NAME FROM User AS ur , COMPANY as cm;

Column alias
SELECT USER_ID AS id ,USER_NAME AS name from m_agri_harvest .

--------------------------------------------------------------------------------------------------------------------------
UPPER AND LOWER

Select upper(USER_NAME) from User

Select lower(USER_NAME) from User


PRIMARY KEY VS UNIQUE KEY

Primary Key
   












No comments:

Post a Comment