Author: Awais Farooq
-
Composite Key
A composite key is a combination of two or more columns in a table that can be used to uniquely identify each row in the table when the columns are combined uniqueness is guaranteed, but when it taken individually it does not guarantee uniqueness. Sometimes more than one attributes are needed to uniquely identify an…
-
FOREIGN KEY
In the relational databases, a foreign key is a field or a column that is used to establish a link between two tables. In simple words you can say that, a foreign key in one table used to point primary key in another table. Let us take an example to explain it: Here are two…
-
PRIMARY KEY
A column or columns is called primary key (PK) that uniquely identifies each row in the table. If you want to create a primary key, you should define a PRIMARY KEY constraint when you create or modify a table. When multiple columns are used as a primary key, it is known as composite primary key. In designing the composite…
-
Cross Join
Now let us see take a deeper dive into the cross join in SQL with the help of examples. All the queries in the examples will be written using the MySQL database. Consider we have the following tables with the given data: Table 1: MatchScore Player Department_id Goals Franklin 1 2 Alan 1 3 Priyanka…
-
FULL JOIN
The SQL full join is the result of combination of both left and right outer join and the join tables have all the records from both tables. It puts NULL on the place of matches not found. SQL full outer join and SQL join are same. generally it is known as SQL FULL JOIN. SQL…
-
RIGHT JOIN
Now let us see take a deeper dive into the right join in SQL with the help of examples. All the queries in the examples will be written using the MySQL database. Consider we have the following tables with the given data: Table 1: employee EmployeeID Employee_Name Employee_Salary 1 Arun Tiwari 50000 2 Sachin Rathi…
-
Left Join
Now let us see take a deeper dive into the left join in SQL with the help of examples. All the queries in the examples will be written using the MySQL database. Consider we have the following tables with the given data: Table 1: employee EmployeeID Employee_Name Employee_Salary 1 Arun Tiwari 50000 2 Sachin Rathi…
-
OUTER JOIN
Now let us take a deeper dive into the different types of outer join in SQL with the help of examples. All the queries in the examples will be written using the MySQL database. Consider we have the following tables with the given data: Table 1: employee EmployeeID Employee_Name Employee_Salary 1 Arun Tiwari 50000 2…
-
JOIN
As the name shows, JOIN means to combine something. In case of SQL, JOIN means “to combine two or more tables”. The SQL JOIN clause takes records from two or more tables in a database and combines it together. ANSI standard SQL defines five types of JOIN : In the process of joining, rows of both tables are…
-
DELETE JOIN
This is very commonly asked question that how to delete or update rows using join clause It is not a very easy process, sometimes, we need to update or delete records on the basis of complex WHERE clauses. There are three tables which we use to operate on SQL syntax for DELETE JOIN. These tables…