The SQL Truncate Table command do delete the rows from a database table. And the SQL Truncate table syntax is below:
Here Truncate is same as Delete command which do not have the Where Condition and tow statements are as follows..
We can use the Truncate Command when we need to delete all the rows in the table.
The SQL Delete command is used delete the data from the database table. The easy and simple SQL Delete command syntax will look like this
The above mentioned SQL Command will delete the data from the TableName
| DELETE FROM EMPLOYEE WHERE DEPARTMENT = “MECHANICAL” |
SQL Update command used update the data in database table. The SQL Update basic syntax will look like this
| Update TableName SET ColumnName1 = Value1, ColumnName1 = Value2,… |
Please find the SQL Update Syntax
| Update EmpTable SET DepartmentName = “ComputerTechnology” |
SELECT command The syntax is as follows:
SELECT DISTINCT “columnname” FROM “TableName”For example, to select all distinct stores in Table Department Table Department
Select distinct Emp_Dept from Deptartment
Result:
IT Department HR Department Finance Department
If we want to select data from table with conditionally
The syntax is as follows..
SELECT “columnname” FROM “TableName” WHERE “condition”
Table Employee
SELECT Emp_Name FROM Employee WHERE Salary > 10000
Result:
Mahesh
SELECT Column1, Column2, Column3,
INTO Table_Name
FROM TableActual
(OR)
SELECT *
INTO Employee_Table
FROM Employee
SQL Tutorial – To Study SQL
SELECT Column1, Column2, Column3,
FROM Table_Name
(OR)
SELECT *
FROM Table_Name