Wednesday, January 20, 2016

SQL NATURAL JOIN: Display Records That Have Match on the Other Table

Let's say we have two (2) table, the STUDENT and GRADE table and we are going to display all students with grades only. We'll exclude those students who have not given any grades yet.

Table:

STUDENT
GRADE









Using the natural join, the query will automatically look for the common column on both tables so make sure that there is only one (1) common attribute to avoid wrong results.

Query
select * from student natural join grade

Output:



SQL NATURAL JOIN: Display Records That Have Match on the Other Table

SQL NATURAL JOIN: Display Records That Have Match on the Other Table Rating: 4.5 Diposkan Oleh: Emoblazz

0 comments:

Post a Comment