Skip to main content

Posts

Showing posts with the label Basic SQL Commands

Basic SQL Commands

 SQL is a database language that performs operations on a database. Database commands are as bellow, DDL: Data Definition Language. DML: Data Manipulation Languages. DQL: Data Query Language. DDL: Data Definition Language is the command used to create and modify the structure of the database. It consists of CREATE, ALTER, DROP, TRUNCATE operations. 1 CREATE: It is used to create a database Table. Syntax: 1CREATE TABLE TABLE_NAME(ELEMENTS....);         CREATE TABLE STUDENT(NAME VARCHAR(20),AGE INTEGER(4)); CREATE TABLE TABLE_NAME(ELEMENTS....);         CREATE TABLE STUDENT(NAME VARCHAR(20),AGE INTEGER(4)); NOTE: Student is name of table. 2 ALTER: It is used to modify the content of the Table, such as Add column, Modify and Rename. a) ADD - It is used Add new coloumn to Table. Syntax: ALTER TABLE TABLE_NAME ADD(COLUMN_NAME DATA_TYPE...);        ALTER TABLE STUDENT ADD(COLLAGE_NAME VARCHAR(25)); b). MODIFY:- It is used to cha...