• 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-599797d11a70d518745145/] Delete Specific Record: […]

    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-599797d11a70d518745145/] Delete Specific Record: […]

    Continue Reading...

  • 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 […]

    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 […]

    Continue Reading...

  • 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-599797d11ba5d658360091/] All Columns: [crayon-599797d11ba64471841366/]

    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-599797d11ba5d658360091/] All Columns: [crayon-599797d11ba64471841366/]

    Continue Reading...

  • 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-599797d11bcd3689759690/]

    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-599797d11bcd3689759690/]

    Continue Reading...

  • 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 […]

    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 […]

    Continue Reading...

  • To maintain database integrity, Foreign Key constraints are used.  A column in a table which is marked as Foreign Key will always point to the Primary Key column of another table.  Lets understand this concept with an example.  First, we will create 2 tables tblEmployee and tblGender.  Syntax for creating […]

    Foreign Key Constraint in SQL

    To maintain database integrity, Foreign Key constraints are used.  A column in a table which is marked as Foreign Key will always point to the Primary Key column of another table.  Lets understand this concept with an example.  First, we will create 2 tables tblEmployee and tblGender.  Syntax for creating […]

    Continue Reading...

  • We have already created a table in previous tutorial.  Now, we are going to add some records to it.  To add a record in a table, we make use of INSERT INTO statement.  You need to specify values followed by column names.  Gender column contains integer values because in next […]

    INSERT INTO Statement in SQL with Example

    We have already created a table in previous tutorial.  Now, we are going to add some records to it.  To add a record in a table, we make use of INSERT INTO statement.  You need to specify values followed by column names.  Gender column contains integer values because in next […]

    Continue Reading...

  • In a database, the data is stored in the form of tables.  In a table, there are couple of columns to store the data in an organized manner.  One of the column in table is marked as Primary Key.  Primary key is basically used to uniquely identify each record in […]

    Creating Table & Columns in SQL

    In a database, the data is stored in the form of tables.  In a table, there are couple of columns to store the data in an organized manner.  One of the column in table is marked as Primary Key.  Primary key is basically used to uniquely identify each record in […]

    Continue Reading...

  • A database is basically a data structure where all the records are stored in an organized manner.  Those records can be retrieved, updated, or deleted using a desktop application or a server-side scripting language like PHP, ASP.net etc. To create a database in SQL, we make use of Create statement.  […]

    Creating, Altering, & Deleting Database in SQL

    A database is basically a data structure where all the records are stored in an organized manner.  Those records can be retrieved, updated, or deleted using a desktop application or a server-side scripting language like PHP, ASP.net etc. To create a database in SQL, we make use of Create statement.  […]

    Continue Reading...

  • SQL stands for Structured Query Language.  It was initially introduced to the world as SEQUEL (Structured English Query Language).  Later, its name changed to SQL, but we still pronounce it as SEQUEL.  SQL is basically used to communicate with database.  There are bunch of SQL statements which can help you […]

    What is SQL?

    SQL stands for Structured Query Language.  It was initially introduced to the world as SEQUEL (Structured English Query Language).  Later, its name changed to SQL, but we still pronounce it as SEQUEL.  SQL is basically used to communicate with database.  There are bunch of SQL statements which can help you […]

    Continue Reading...