Example for SELECT Statement

SQL Select Query Examples, SQL Where Clause, write condition/s in Select Statements using Where clause, and write multiple conditions in Select statements using where clause & SQL Logical operator like And & Or.
Post Reply
Gowtham Ramesh
Posts: 66
Joined: Thu Nov 22, 2018 5:23 am

Example for SELECT Statement

Post by Gowtham Ramesh » Thu Nov 29, 2018 3:16 am

Can you give an example for retrieving Data from two tables in a Database?

srini
Posts: 85
Joined: Thu Jan 03, 2019 3:58 am

Re: Example for SELECT Statement

Post by srini » Mon Jan 21, 2019 12:31 pm

The related tables of a large database are linked through the use of foreign and primary keys or what are often referred to as common columns. The ability to join tables will enable you to add more meaning to the result table that is produced. For 'n' number tables to be joined in a query, minimum (n-1) join conditions are necessary. Based on the join conditions, Oracle combines the matching pair of rows and displays the one which satisfies the join condition.

Joins are classified as below
Natural join (also known as an equijoin or a simple join) - Creates a join by using a commonly named and defined column.

Non-equality join - Joins tables when there are no equivalent rows in the tables to be joined-for example, to match values in one column of a table with a range of values in another table.

Self-join - Joins a table to itself.
Outer join - Includes records of a table in output when there's no matching record in the other table.

Cartesian join (also known as a Cartesian product or cross join) - Replicates each row from the first table with every row from the second table.Creates a join between tables by displaying every possible record combination.

Post Reply

Return to “SQL - The Select Statement”