I am making a gallery website. I learnt from tutorials how to do each parts but i don’t know if i should make different tables for user information / their profile pictures / and photos added to gallery by users. Should I focus to make lowest number of tables possible (like putting profile pictures and photos together in table) or making different tables for everything. Does is affects speed of website?
I am using XAMPP and procedural PHP.
2
Answers
i think You Are beginner So you may learn more from here
https://www.youtube.com/channel/UC8Nbgc4vUi27HgBv2ffEiHw
The rule of thumb is always identify separate entities (things) and put them in a separate tables. Think about relations between these entities:
(These are only examples – maybe it is different in your case)
This way you will start thinking naturally using relational database concepts.
The next step is to identify what type of relation exist between these entities. And so:
Based on the above you can then create “connections” between these tables of things using so called foreign keys. Read more about simple relational database design and you’ll be fine.
Regarding speed. Don’t worry about it for now. The database is designed to allow us to create many different related tables of things and it is highly optimized to do so. You can worry about optimizations once you’ll reach millions of items in your tables.