ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi, i'm designing a database and ive kinda run into a design problem and im not sure the best route to take to acheive what i want. I have a database with about 20 tables in it, about 15 of those tables need to have comments available for them, actually each row in the table must havemultiple comments. So say i have a table called hardware and each row stores information about a particular piece of hardware. I need the ability to add mulitple comments to a row(piece of hardware) but this needs to be done on 15 tables. So far my choices are
-create an extra table for every table that i need comments for(bad::to many tables)
-create a one table that stores all comments(bad::need to make a table name lookup table, bad design)
Anyone know of a better way to design a universal comment table which can reference a given row in a particular table?
well then how do i know which row of which table it belongs to? if i have hardware, platform, software, and i need to store multiple comments for each row in those three tables how would i do that?
I think the idea is that each row in the "hardware" table could have any number of comments. Adding an extra field is fine when their is one comment per row, but if a row has 1000 comments you wouldn't want 1000 extra fields.
Option 1. Create an extra table .. why is it bad? After all 15 tables become only 30. It would seem that it is the more logical thing unless all comments are equal (ie a comment in table 1 needs to be joined with a comment in table 2 ..etc).
If you never want to analyse comments across the 15 base tables, then the clear advantage of option 1 is that since there are 15 tables, there is a lesser chance of it becoming a hot spot with respect to accesses and hits.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.