DATABASE (SQL) DAY 4) CHANGE DATA TYPE, MULTIPLE STRING,BETWEEN, SQL FUNCTION
*DATA TYPE*
* HOW TO CHANGE DATA TYPE
*ALTER COMMAND
QUERY:-
-: ALTER TABLE stu2 ALTER COLUMN name NVARCHAR(50);
-: SELECT * FROM stu2;
-: SP_HELP stu2;
*STRING QUERY*
* FIND A MULTIPLE STRING IN A QUERY USE IN A QUERY USE IN OPERATOR.
QUERY :-
SELECT * FROM student WHERE city IN ('NAGPUR','PUNE','NASHIK');
SELECT * FROM student WHERE city NOT IN ('NAGPUR');
SELECT * FROM student WHERE city <>'NAGPUR';
*BETWEEN*
QUERY:-
SELECT * FROM emp WHERE salary BETWEEN 1000 AND 1800;
INSERT INTO emp VALUES (102,'SOHAM',1200);
INSERT INTO emp VALUES (103,'AJAY',1500);
INSERT INTO emp VALUES (101,'RAMESH',2000);
SELECT * FROM emp;
*SQL FUNCTION*
*SQL FUNCTION DIRECTRY WORKING ON DATABASE COLOUMN
*THERE ARE SQL FUNCTION.
1)SUM( ), 2)MIN ( ), 3) MAX( ), 4) COUNT( ), 5)AVG( )
CHANGE DATA TYPE, MULTIPLE STRING,BETWEEN, SQL FUNCTION
Comments
Post a Comment