Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,209,733 members, 8,007,023 topics. Date: Tuesday, 19 November 2024 at 02:20 PM

Combining Many Tables In Mysql - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Combining Many Tables In Mysql (772 Views)

Joins And Subqueries 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)

Combining Many Tables In Mysql by AloyalNigerian(m): 1:38pm On Sep 08, 2020
Hi guys,

I'm working on a personal project and I'm at the last phase which is proving to be the most difficult.

I have these 10 tables in my database and what I want to do is to take a particular column from each of these tables based on the user_id. I want to do some computations on these values and insert the result into a new table.

I hope this explanation is explicit enough. I've tried using JOIN, but most of the examples I saw online only addressed situations where 2-3 tables are involved.

10 tables is a different case, and maybe more complex. But I feel since I'm just picking a column each, it should not be that complex. I'm not sure though.


Please, y'all should help so my morale no go drop grin.

I'm working on a sort of dashboard using php.


Thanks in advance.
Re: Combining Many Tables In Mysql by vankaid: 3:25pm On Sep 08, 2020
AloyalNigerian:
Hi guys,

I'm working on a personal project and I'm at the last phase which is proving to be the most difficult.

I have these 10 tables in my database and what I want to do is to take a particular column from each of these tables based on the user_id. I want to do some computations on these values and insert the result into a new table.

I hope this explanation is explicit enough. I've tried using JOIN, but most of the examples I saw online only addressed situations where 2-3 tables are involved.

10 tables is a different case, and maybe more complex. But I feel since I'm just picking a column each, it should not be that complex. I'm not sure though.


Please, y'all should help so my morale no go drop grin.

I'm working on a sort of dashboard using php.


Thanks in advance.
If you can join 2 tables you can join 104!

I mean as long as there is a relationship for each row, it will work out.

Just try it first, don't be afraid of trying things in programming.

Thats how you learn.

1 Like

Re: Combining Many Tables In Mysql by faithful2911(m): 3:26pm On Sep 08, 2020
AloyalNigerian:
Hi guys,

I'm working on a personal project and I'm at the last phase which is proving to be the most difficult.

I have these 10 tables in my database and what I want to do is to take a particular column from each of these tables based on the user_id. I want to do some computations on these values and insert the result into a new table.

I hope this explanation is explicit enough. I've tried using JOIN, but most of the examples I saw online only addressed situations where 2-3 tables are involved.

10 tables is a different case, and maybe more complex. But I feel since I'm just picking a column each, it should not be that complex. I'm not sure though.


Please, y'all should help so my morale no go drop grin.

I'm working on a sort of dashboard using php.


Thanks in advance.
Your database design is poor.

Search for this topic: database normalization and complex queries tutorial on nairaland.
I took time to explain the concept of normalization and the various normal forms.

Goodluck.

1 Like

Re: Combining Many Tables In Mysql by AloyalNigerian(m): 6:05pm On Sep 08, 2020
vankaid:

If you can join 2 tables you can join 104!

I mean as long as there is a relationship for each row, it will work out.

Just try it first, don't be afraid of trying things in programming.

Thats how you learn.

OK. Thanks
Re: Combining Many Tables In Mysql by AloyalNigerian(m): 6:06pm On Sep 08, 2020
faithful2911:

Your database design is poor.

Search for this topic: database normalization and complex queries tutorial on nairaland.
I took time to explain the concept of normalization and the various normal forms.

Goodluck.

Unfortunately, I totally agree with you cry.

Now I understand why database engineers are hired grin.

Thanks for the reference, I will check it out now. In addition, please, can I reach you directly.
Re: Combining Many Tables In Mysql by AloyalNigerian(m): 6:11pm On Sep 08, 2020
faithful2911:

Your database design is poor.

Search for this topic: database normalization and complex queries tutorial on nairaland.
I took time to explain the concept of normalization and the various normal forms.

Goodluck.

I checked the thread, but you stopped at 2NF.
Is there another one?
Re: Combining Many Tables In Mysql by faithful2911(m): 8:30pm On Sep 08, 2020
AloyalNigerian:


Unfortunately, I totally agree with you cry.

Now I understand why database engineers are hired grin.

Thanks for the reference, I will check it out now. In addition, please, can I reach you directly.
WhatsApp the number on my website www.zeratech.com.ng
Re: Combining Many Tables In Mysql by Deicide: 4:00pm On Sep 09, 2020
After they'll say computer science is useless
Re: Combining Many Tables In Mysql by bassdow: 5:33pm On Sep 09, 2020
vankaid:

If you can join 2 tables you can join 104!

I mean as long as there is a relationship for each row, it will work out.

Just try it first, don't be afraid of trying things in programming.

Thats how you learn.

...and don't be Afraid of Spending Countless Hours and/ or Days doing something that ought to take less time. Even the most Experienced Ones sometimes find themselves in such hole.
Re: Combining Many Tables In Mysql by bassdow: 5:47pm On Sep 09, 2020
AloyalNigerian:


I checked the thread, but you stopped at 2NF.
Is there another one?

Without checking, I knew you would have this very issue as the Person gave a response not directly a solution and/ or Pointer to your issue.

Follow @vankaid suggestion; start by JOIN[/b]ing 2 tables, then make it 3 tables and then 4 and 5 and keep on incrementing the number of tables every-time you had a success with the previous one.

Somewhat similar to how a Long Straw is being made out of many smaller Straws.

Meanwhile, there's no issue having a complex Query or a Simple Query with up to 10 Tables Thanks to Normalization BUT at times, you need be sure you aren't [b]Over Normalizing
.

[s]I follow Standards and Obey Laws BUT I also try apply common Sense most times.[/s]
Re: Combining Many Tables In Mysql by Nobody: 5:12pm On Oct 05, 2020
Get this book. Follow it up with a good SQL course on udemy. Shits easy when you get the basics right

Re: Combining Many Tables In Mysql by Nobody: 6:02pm On Oct 08, 2020
faithful2911:

Your database design is poor.

Search for this topic: database normalization and complex queries tutorial on nairaland.
I took time to explain the concept of normalization and the various normal forms.

Goodluck.

Link please. Been a while I did BCNF normalisation. A quick simple refresher won't be bad
Re: Combining Many Tables In Mysql by OGWILLS123: 4:15pm On Oct 09, 2020
crownedrookie:
Get this book. Follow it up with a good SQL course on udemy. Shits easy when you get the basics right
Please what is the name of the website ?

Thanks cool
Re: Combining Many Tables In Mysql by Nobody: 1:30am On Oct 10, 2020
OGWILLS123:

Please what is the name of the website ?

Thanks cool
Android app. Anybooks

(1) (Reply)

I Want To Buy A Premium Plugin For Displaying Nigerian Stock Exchange Report / Python Vs Javascript / [ New ] Sim Lock Code Service Is Available To Unlock Your ZTE MC801A1 5G Router!

Viewing this topic: 1 guest(s)

(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. 27
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.