Going for the Guinness Book of Records for vague blog titles I decided to waffle about inner joins and outer joins in the world of
bellybuttons *cough* Structured Query Language.
Since plagiarism is the best form of flattery, Chirag Sharma (over at Guru99) wrote a very nice article about the finer points of SQL INNER JOINS and OUTER JOINS:
Joins help retrieving data from two or more database tables. The tables are mutually related using primary and foreign keys.
Note: JOIN is the most misunderstood topic among SQL learners. For sake of simplicity and ease of understanding lets look at this example:
|1||ASSASSIN’S CREED: EMBERS||Animations|
|3||Alvin and the Chipmunks||Animations|
|4||The Adventures of Tin Tin||Animations|
|9||The Dirty Picture||18+|
|10||Marley and me||Romance|
Cross JOIN is a simplest form of JOINs which matches each row from one database table to all rows of another.
In other words it gives us combinations of each row of first table with all records in second table.
Suppose we want to get all member records against all the movie records, we can use the script shown below to get our desired results.
SELECT * FROM `movies` CROSS JOIN `members`
Executing the above script in MySQL workbench gives us the following results….
IBM i Software Developer, Digital Dad, AS400 Anarchist, RPG Modernizer, Alpha Nerd and Passionate Eater of Cheese and Biscuits. Nick Litten Dot Com is a mixture of blog posts that can be sometimes serious, frequently playful and probably down-right pointless all in the space of a day. Enjoy your stay, feel free to comment and in the words of the most interesting man in the world: Stay thirsty my friend.
Don’t hardcode library names in your TURNOVER SQL source #youbigsilly
IBM i Data Obfuscation – Making Data Foggy Murky and Squinty
What is AS400 modernization?
Encrypt IBM i File (Table) Data with no RPGLE changes using SQL
Thrive Pressive Theme – SQL TITLE SECTION
IBM i SQL – Using SUBST to insert data into a string
Funky IBM i Email Validation Program using SQL Regex
Simple email validation SQL RPG ILE program
IBM i SQL statement to convert or compare hundred year date format