Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,155,914 members, 7,828,193 topics. Date: Wednesday, 15 May 2024 at 05:44 AM

Joins And Subqueries In Mysql - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Joins And Subqueries In Mysql (299 Views)

Combining Many Tables In Mysql / Please I Don't Really Understand Foreign Keys In MySQL / Learn How To Save Img In Mysql Database. Many Web Developers Find It Difficult.. (2) (3) (4)

(1) (Reply) (Go Down)

Joins And Subqueries In Mysql by jamerflepz(m): 6:26pm On Apr 15, 2022
One of the queries I try to avoid most times in SQL is the subquery. Not the simple ones, the ADVANCED Subquery. Lol. Joins are quite easy to work on.

A subquery is a query that is nested inside a SELECT , INSERT , UPDATE , or DELETE statement, or inside another subquery.

When I am not working on a real dataset for clients, I do go on kaggle to get open dataset to work on.

I am gonna be sharing with you joins and subqueries I just worked on. It's ADVANCED but not deep like that. Lol.

This a Game dataset with two different tables.
(I) ps4_gamessales table
(II) xboxone_gamesales

The picture below shows how I created the database "Game_sales" and the joining of both tables and the result.

Re: Joins And Subqueries In Mysql by jamerflepz(m): 6:30pm On Apr 15, 2022
2) The pictures below shows filtering of the joined tables using the where, Group by and order by clause.

Re: Joins And Subqueries In Mysql by jamerflepz(m): 6:40pm On Apr 15, 2022
3) More filtering like the picture above but with # in it. The # in front of a query means that line won't be executed. Instead of writing queries over and over again, using the # kinda helps and saves times. All I need to do is put # in font of the queries I Don't want executed.

Re: Joins And Subqueries In Mysql by jamerflepz(m): 6:47pm On Apr 15, 2022
4) This pics below shows Subquery using the From clause. The first pics (result) of this query gives you the not common genres and publishers from both tables and the second pics shows the common genres and publishers from both tables.

Re: Joins And Subqueries In Mysql by jamerflepz(m): 6:52pm On Apr 15, 2022
5) This pics shows Subquery using the where clause. The result of this query gives you genres and publishers not in the common genres and publishers from both tables. Hope you understand. Lol.

This is me just messing around with joins and subqueries. cool

(1) (Reply)

The Best Way To Change Career To Cloud Computing In Europe. / Please, Suggest A Lucrative IT Short Course! / Can Anyone Help Me With Lua?

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 10
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.