I am trying my best to learn SQL and I am sorry for the basic question, however, would it make sense to make this table Blog have numerous one-to-one table relationships? I feel that this table Blog has too many unnecessary columns and for most of the queries I do not need some of the columns, which leads me to think that this design is wasting performance.
The Table Blog
userID INT,
postID INT PRIMARY KEY,
title TEXT,
description TEXT,
createdTime DateTime,
submittedTime DateTime,
lastEditedTime DateTime,
titleColor TEXT,
customTitleColor TEXT,
showCustomTitleColor INT,
privatePost INT,
submitted INT
To explain further, the only time that I would ever need the columns titleColor, customTitleColor, and showCustomTitleColor is for two queries, clicking on a post and changing the color: every other query on table Blog would not need this. This makes me feel that putting these columns into a table Color with a one-to-one relationship with postID would be more efficient.
The Table Color
userID INT,
postID INT FK,
titleColor TEXT,
customTitleColor TEXT,
showCustomTitleColor INT
The Table Blog
userID INT,
postID INT PRIMARY KEY,
title TEXT,
description TEXT,
createdTime DateTime,
submittedTime DateTime,
lastEditedTime DateTime,
privatePost INT,
submitted INT
That way the query saves performance, however does this do more harm than good? Also the main query of Table Blog is querying titles based on the createdTime or submittedTime. This leads the columns lastEditedTime and description to not be used by most queries as they are only used when a post is clicked or their values get manually changed by an edit. Thus, is there a way to make table Blog more efficient when querying? Having two tables like this seem efficient but seems over-normalizing plus confusing.
The Table Blog
userID INT,
postID INT PRIMARY KEY,
title TEXT,
titleColor TEXT,
customTitleColor TEXT,
showCustomTitleColor INT,
privatePost INT,
submitted INT
The Table BlogTime
userID INT,
postID INT FK,
createdTime DateTime,
submittedTime DateTime
The Table ExtraInfo
userID INT,
postID INT FK,
description TEXT,
lastEditedTime DateTime
Is there a better method or should I just use table Blog? And for my final question, just to confirm, having a one-to-one table like below is pointless even if you can "group" the data correct?
The Table Blog
userID INT,
postID INT PRIMARY KEY,
title TEXT,
description TEXT,
titleColor TEXT,
customTitleColor TEXT,
showCustomTitleColor INT,
privatePost INT,
submitted INT
The Table BlogTime
userID INT,
postID INT FK,
createdTime DateTime,
submittedTime DateTime,
lastEditedTime DateTime
Please let me know and thank you so much for your time!