DATABASE (SQL) DAY 5) TEMPORARY TABLE, ALIAS

                                 *TEMPORARY TABLE*

*TEMPORARY TABLE IS USE TO CREATE FEW TIME LIMITATION.

*THERE ARE TWO TYPES OF TABLE.

--1) LOCAL TEMPORARY TABLE  #

   2)GLOBAL TEMPORARY TABLE  ##

                                      *LOCAL TEMPORARY TABLE*

*LOCAL TEMPORARY TABLE AUTOMATICALY DELETED THIS TABLE WHEN THERE ARE            NO LONGER USE .

*LOCAL TEMPORARY TABLE REPRESENTED THE # TAG SYMBOL.


*QUERY:--

:-CREATE TABLE #doctor(name VARCHAR(50),bedno INT,city VARCHAR(50));

:-INSERT INTO #doctor VALUES('sumar',200,'nagpur');

:-INSERT INTO #doctor VALUES('ajay',201,'pune');

:-INSERT INTO #doctor VALUES('suman',202,'nashik');

:-SELECT * FROM #doctor;


                                      *GLOBAL TEMPORARY TABLE*

* IN THIS TABLE STORE IN A SERVER SEALS LONG TIME,AND REPRESENTED THE ## TAG SYMBOL.

*QUERY:--

 ::-CREATE TABLE ##samsung(modelname VARCHAR(50),miuiid INT);

 :-INSERT INTO ##samsung VALUES ('GALAXYA51',17892);

 :-INSERT INTO ##samsung VALUES ('S20+',18201);

 :-INSERT INTO ##samsung VALUES ('ULTRA HD',13789);

 :-SELECT * FROM ##samsung;


                                               *ALIAS* (COLUMN HEADING CHANGE)

*   ALIAS IS A REPRESNTING COLUMN HEADING.

*  IN THE ABOVE EXAMPLE WE HAVE TO CHANGE THE HEADING OF SPECIFIC COLUMN       IN CASE WE HAV TO USE ALIAS CONCEPT.

*  QUERY:-

      SELECT coloumnname AS "name" FROM ##tablename;


TEMPORARY TABLE, ALIAS


Comments

Popular posts from this blog

DATA CONTROL ( Gridview , Repeater , Formview , DataList , Detailsview , Listview )

Z 5 ) MVC (Model view Controller)

Z 8 ) MVC HTMLHELPER METHOD AND ACTIONLINK (how to use css ,atrributes,style in css)