SQL Table is used to store the data in terms of rows and column . It is the very simple form for data storage .
Example ->
**Student name** **Student Age** **Student Id**
Mukesh 23 1
Ayush 24 2
SQL Table Variable
Using this statement you can create , modify , rename , copy , delete the table in database . It is the temporary variable where we store the data temporary .
Syntax
create table tablename ( " columnName1 datatype " , " columnName2 datatype " ........" columnNameN datatype " ) ;
When this statement execute successfully then their data will not rolled back .
SQL Create Table
SQL create statement is used to crate table in database . To crate table you should name the table first and then define its column corresponding their data types .
Syntax
create table tablename ( " columnName1 datatype " , " columnName2 datatype " ........" columnNameN datatype " ) ;
Example ->
create table student ( student-Name varchar ( 20 ) , roll int Not Null , student-Address varchar ( 30 ) ) ;
If you want to verify this query than you can do with the Desc statemtent
Syntax
Desc student ; // it describe the entire structure of the table student .
SQL Drop Table
Using SQL drop query you can delete a table and their data from database .
Note -> Once you deleted your table and data Using this statement then you cann't recover that table and data. It will not be available in the table forever .
Syntax ->
Drop table TableName ;
SQL Delete Table
Using SQL delete query you can delete a row and columne from tha table . If you want to remove specific row or column then you can usign this statement .
Note -> Once you deleted your data Using this statement then you can recover that table and data. .
Syntax ->
Delete from TableName ;
0 Comment(s)