Category: SQL

DELETE Statement in SQL

To delete a record from a table, we make use of DELETE statement.  After deleting a record, you can’t undo it.  If you want to delete a specific record, please add WHERE clause to it.  Syntax for DELETE statement is given below.   Delete All Records: [crayon-5e5680d896ec0153992713/] Delete Specific Record: [crayon-5e5680d896ecd587127279/]

WHERE Clause in SQL

In SQL, you can fetch, update, and delete records in a table when a certain condition is met.  For this reason, we use WHERE clause. The most commonly used operators with WHERE clause are given below. Equal (=) Not Equal (<> or !=) Greater than (>) Less than (<) Greater than or Equal (>=) Less

SELECT Statement in SQL

SELECT statement in SQL helps to fetch data from a table.  That data selection can be from specific columns or all columns in a table which is stored in a table called result-set.  Syntax for SELECT statement is given below.   By Columns Name: [crayon-5e5680d897e97685492744/] All Columns: [crayon-5e5680d897ea1929155491/]

Dropping Constraint in SQL

We have seen in previous tutorials how to add constraints like FOREIGN KEY and DEFAULT.  But in case, you no longer need them, then you can easily drop them using DROP CONSTRAINT statement.  The syntax for dropping a constraint is given below. [crayon-5e5680d898322596234696/]

Default Constraint in SQL

As we have seen in previous tutorial that we can have non-nullable columns in SQL by using NOT NULL constraint.  But if we would not use NOT NULL constraint and insert values in all other columns except to a nullable column, then that column will have null value by default in it.  To overcome this