Jump to content

Database reference material


phppup
Go to solution Solved by Barand,

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • Solution
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 by Barand
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.