phppup Posted May 11, 2022 Share Posted May 11, 2022 Are there any guides/tutorials online that you would recommend to upgrade my skills? I've found several but nothing that was spectacular. One site started Quote Unless you have a good reason not to, a 1:1 relationship usually indicates that you’d be better off combining the two tables’ data into a single table. Does this seem like an accurate statement? Quote Link to comment https://forums.phpfreaks.com/topic/314781-database-reference-material/ Share on other sites More sharing options...
Barand Posted May 11, 2022 Share Posted May 11, 2022 It seems reasonable to me, given the initial caveat. Quote Link to comment https://forums.phpfreaks.com/topic/314781-database-reference-material/#findComment-1596160 Share on other sites More sharing options...
requinix Posted May 11, 2022 Share Posted May 11, 2022 "Don't do a thing unless you have a good reason to do the thing" is all-around pretty reliable advice. Quote Link to comment https://forums.phpfreaks.com/topic/314781-database-reference-material/#findComment-1596161 Share on other sites More sharing options...
phppup Posted May 11, 2022 Author Share Posted May 11, 2022 I would have thought that less columns translates to faster/more efficient searching. If I have id, name, email, phone, birthday, favorite_color as fields then these are all 1:1. But if I primarily refer to id, name, and email, I would think a 1:1 with a table of "personal_details" would seem appropriate. Quote Link to comment https://forums.phpfreaks.com/topic/314781-database-reference-material/#findComment-1596162 Share on other sites More sharing options...
Solution Barand Posted May 11, 2022 Solution Share Posted May 11, 2022 (edited) 17 minutes ago, phppup said: I would have thought that less columns translates to faster/more efficient searching. So just, for example, "SELECT id,name, email FROM ..." so you only retrieve what you need. That's why you shouldn't use "SELECT * " in queries as that retrieves every column, need it or not, and slow your queries. [EDIT] PS That's one of the reasons not to use SELECT *. Edited May 11, 2022 by Barand Quote Link to comment https://forums.phpfreaks.com/topic/314781-database-reference-material/#findComment-1596163 Share on other sites More sharing options...
phppup Posted May 11, 2022 Author Share Posted May 11, 2022 It's starting to make more sense. Quote Link to comment https://forums.phpfreaks.com/topic/314781-database-reference-material/#findComment-1596164 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.