KaaShiv Infotech

Inplant training in chennai | Internship in chennai

Create Table Query


 

Create Table TableName

(

ColumnName1 DataType,

ColumnName2 DataType

)

————–

Create Table Student

(

Name varchar(100),

Age int,

ID int

)

 

Alter Statement


Alter Table TableName

Add /Modify Column ColumnName1 DataType

 

Alter Table Student

Add column

DOB datetime

 

Drop Statement


Drop Table TableName

 

Drop Table Student

 

Insert Statement


Insert into TableName

Values

( ColumnName1 ColumnDataType ,

ColumnName2 ColumnDataType ,

…………

)

Insert into Student

Values

(

‘Venkat’ , 25, 1

)

 

Update Statement


Update TableName

Set

ColumnName = NewData

Where ColumnName=OldData

 

Update into Student

Set

Age = 26

Where ID =1

 

Delete Statement


Delete fromTableName

Where ColumnName=OldData

 

Delete from Student

Where ID =1

 

Select Statement


Select * from TableName

 

Select * from Student

 

Select with where Statement


Select * from TableName

Where ColumnName = value

 

Select * from Student

Where ID = 2

 

Grant Statement


Grant privileges on TableName

From User

Grant Select on Student

From ‘Asha’@’localhost’;

 

Revoke Statement


Revoke privileges on TableName

From User

 

Revoke Select on Student

From ‘Asha’@’localhost’;

 

 

KaaShiv InfoTech Rated 5 / 5 based on 99,988 reviews.
× How can I help you?