Posts

IN, ALL, ANY operators in SQL

Image
Hello, and welcome to the blog. In this blog we are going to talk about some operators in SQL which help us when we are are adding WHERE clause with large data. This is going to be a good practice when we are going to learn about " SUBQUERIES ". This is going to be a very small but very useful blog. So, In this blog we are going to talk about IN Operator BETWEEN Operator ALL Operator ANY Operator Currently our Employee1 table look like this: So, let's get started, 1) IN Operator The IN operator allows you to specify multiple values in a WHERE clause. The IN operator is shorthand for multiple "OR" conditions. let's jump to the syntax: SELECT column_name FROM table WHERE coulmn_name IN (value_1,value_2,...,value_n) You can always replace va...

SQL Joins | Inner Join | Left Join | Right Join | Full Join | Self Join

Image
Hello, and welcome to the blog. In this blog we are going to talk about " Joins ". In the  previous blog  we have seen most important topic of Primary Key, Foreign Key and now its time to join some of the tables. So, In this blog we are going to talk about What is join and its purpose Type Of Joins Inner Join Left Join Right Join Full Join Self Join Let's  start with 1) What is join and its purpose There is a clause in SQL called Join. And its purpose is to combine rows from two or more tables which are connected with each other by a common column. When I say connected with each other by a common column I am talking about Foreign Key which we have covered in previous blog. Although if you haven't enforced foreign key for this blog but we do have a common column then also you can perform jo...

Identity Column, Primary Key and Foreign Key

Image
Hello, and welcome to the blog. In this blog we are going to talk about " Identity columns, Primary Key and Foreign Key ". In the  previous blog  we have seen some constraints and I told you there are more coming and here they are now. These constraints hold way too much powers as compare to what we have learnt in previous blog. Believe me if you these have arrows in your quiver, it is very easy for you to conquer the practices of designing a fully functional database. So let's not create more hype about this and start exploring theses things. In this blog we are going to talk about Identity Column Primary Key Foreign Key Let's start the discussion with 1) Identity Column: When you want to create a column whose value should get incremented every time you insert a new record then IDENTITY COLUMN is the thing you shou...

Alter command with constraints

Image
Hello, and welcome to the blog. In this blog we are going to talk about " Alter command with constraints ". In the previous blog we have seen how to create a table with constraint. If you are following the blog we already have a table "Employee", what if we have to apply constraints to that table. Don't worry "ALTER" command is there to help us. So, In this blog we are going to talk about Adding Constraints Adding null/ not null constraint Adding UNIQUE constraint Adding CHECK constraint Adding Default constraint Adding Index Knowing Constraints Renaming Constraints Removing Constraints Let's begin with, 1) Adding Constraints When we initially started, we created a simple table without any constraints here. So we are going to add constraint in that ta...

Constraints in SQL

Image
Hello, and welcome to the blog. In this blog we are going to talk about "Constraints in SQL". We have learn CRUD operations so far, now its time to advance our skills. We will again create a table with some properties and make our database table more reliable and effective. For making our database table more reliable and effective we are going to add some "Constraints" in our table.  So in this blog we are going to talk about What is constraints ? Types Of Constraint. Create a table with constraints. Let's start with 1) What is Constraint? Constraints are nothing but rules which a data row must satisfy to get inserted in database. For example: When a person wants to take flight he/she have to go through many checks like security, passport, boarding pass, etc. these checks are there to ensure only valid person can enter flight and flight will...

Update, Delete and Truncate Commands

Image
Hello, and welcome to the blog. In this blog we are going to talk about "Updating and deleting data". We learn about "Inserting and Retrieving Data" in  this blog . Now its time to learn updating and deleting our mistakes. Yes with the help of the UPDATE and DELETE  statements  you can actually update and delete wrong entries in your database respectively. So in this blog we are going too talk about  UPDATE statement DELETE  statement TRUNCATE command Let's start with 1) UPDATE statement : UPDATE statement is used to update a specific record or a bunch of records which exists in your database table. If you made a mistake while inserting data in your database then UPDATE statement is the loophole through which you can correct it. Let's see a example: If you can see in our table I have made a mistake that SALARY  of "Sales Per...