One of my favorite online resources: http://www.codinghorror.com/blog/2007/10/a-visual-explanation-of-sql-joins.html
Regarding your question.
All books will be displayed, and only those serial numbers that correspond to the book will be displayed only those orders that have a corresponding entry in the orderitems that belong to the book Only customers who have orders with items in the book table will be listed.
Thus, customers who do not have orders will not be listed Customers who have orders, but for items that are not books, will NOT be listed.
Funny stuff. I hope, you like it.
Regarding your second question: Right / left is just a question due to the ORDER tables in your statement from. You can make each join on the left if you arrange the order of the tables. All right / left do indicates the table from which you want ALL records.
Consider: you could just as easily select your select statement:
SELECT B.TITLE, O.ORDER #, C.STATE FROM CLIENTS C
CORRECT INTERACTION ORDER O TO C.CUSTOMER # = O.CUSTOMER # CORRECT ENTRANCE JOIN ORDER OI TO O.ORDER # = OI.ORDER # CORRECT EXTERNAL ENTRANCE TO BOOKS B TO B.ISBN = OI
In this case, the right says that I want all the entries from the table on the right, since the books are the last in the list, you will receive all the books and only those ordered items associated with the book, only those orders for which the ordered item was a book, and only those customers with orders for items ordered that were books. Thus, the left / right is the same, with the exception of order. I avoid the right mix for readability. Itโs easier for me to go down, thinking about what is on and what will not.
Those records that are excluded will have NULL values โโin these types of joins.
Hope this helps.
source share