DATABASE(DAY 2) WINDOW AUTHONTICATION (COMMAND ,DELETE DB, NOTNULL, ADD EXISTING TABLE, CRETE TABLE FROM TABLE
* WINDOW AUTHONTICATION *
SERVER NAME = 1) .(DOT) AUTOMATIC SEREVER FINDER
2) .\SQLEXPRESS
* WINDOW AUTHONTICATION MEAN LOCAL MODE.
__________________________________________________________________________________
*DATABASE CREATION COMMAND *
STEP 1) CREATE DATABASE --> RIGHT CLICK ON DATABASE-->NAW DATABASE --> DATABASE NAME (COLLAGE)
STEP 2) SELECT YOUR DATABASE NAME -->RIGHT CLICK -->ADD NEW QUERY OPTION
___________________________________________________________________________________
*HOW TO DELETE DABASE TABLE
=>DATABSE -->TABLE-->RIGHT CLICK QUERY-->DROP TABLE STUDENT(table name)
== DROPTABLE TABLENAME(STUDENT);
___________________________________________________________________________________
*HOW TO CREATE NULL COLOUM
CREATE NEW TABLE
CREATE TABLE STUDENT (ROLL INT , NAME VARCHAR , MOBILE VARCHAR , NOT NULL)
INSERT INTO STUDENT VALUES(101,'RAM','7721815360');
INSERT INTO STUDENT VALUES(102,'SOURABH','7588829513');
INSERT INTO STUDENT VALUES (103,'KANCHAN','7498662017');
INSERT INTO STUDENT (ROLL,NAME)VALUES(104,'GAURAV');
NULL ERROR =>CANNOT INSERT THE VALUE NULL INTO COLOUM 'MOBILE'.
_________________________________________________________________________________
*HOW TO ADD NEW COLOUM IN EXISTING TABLE
(टेबल में एक टेबल ऐड करना भूल गए और उस टेबल में नई टेबल ऐड करना हो तो क्या करे ?)
* ALTER COMMAND IS USE TO ADDING NEW COLOUM IN A TABLE.
--> ALTER TABLE TABLENAME ADD CITY VARCHAR(50);
___________________________________________________________________________________
*HOW TO IDENTIFY TABLE STRUCTURE (INFORMATION)
--> SP_HELP TABLENAME;
SP_HELP IS RETURNING THE STRUCTURE THE TABLE
___________________________________________________________________________________
*CREATE TABLE FROM TABLE *
SELECT INTO COMMAND
--> SELECT ROLL,MOBILE,INTO NEW TABLE NAME FROM STUDENT ;
(only show name and mobile)
-->SELECT * FROM TABLENAME;
___________________________________________________________________________________
assigment practical;-- 1)ID ,NAME,EMAIL(not null) ,MOBILE --10ENTRY
2)ADD ANY OTHER COLOUM USING ALTER COMMAND --CITY
3) UPDATE ALL CITY NAME --NAGPUR
4)CREATE ANOTHER TABLE WITH THE NAME OF REPORT AND STORE OF INFORMATION (NAME,EMAIL) SELECT INTO COMMAND.
PRACTICAL --10 ENTRY ,ADD ANY OTHER COLOUM USING ALTER COMMAND--CITY,UPDATE ALL CITY NAME--NAGPUR,CREATE ANOTHER TABLE WITH THE NAME OF NAGPUR AND STORE INFORMATION(NAME ,EMAIL) |
Comments
Post a Comment