This is something basic which drives me crazy: If for example I have a table “team” and a table “player”. And the team can have multiple players in a one-to-many relation. Should …
Tag: database-design
MYSQL – Fetching entities whose many-to-many relationship contains all terms collectively
I am using the following DB Schema and using something like this to add data/query it which returns How can I return recipes who’s ingredients are a subset of a list of ingredients provided? e.g I should not return Chocolate cake if list (egg, salt, sugar) is provided. However I should return Chocolate cake if (egg, salt, ham, cheese, sugar,
Have I normalized this database to a 3NF level the right way? [closed]
I had a lecture at college recently about normalizing databases, but since we are online I can’t really ask a lot of questions, so here I am. Can someone tell me if I’m doing the conversion right, if …
How to structure limited voting system design
I have 3 types of tables. Categories, Candidates, Voters. To be describing the problem as short as possible, Candidates can belong to only 1 category. Voters can vote for each category and only one …
SQL DB structure for N items with M parameters varying over time
There’re the items: item_1 … item_N N is about a few hundreds. New items can be added sometimes. Each item has a set of parameters: parameter_1 … parameter_M M is about 20-30. These parameters …
MySQL Default Record from Table
I use MySQL 5.6 and I have 3 tables. Two of them are a list of data, and the third table is used for a relationship between them. In the third table I would like to identify a default record for each id1, so I added a column named predt to let me know which record is the default one.
Fetch multi-participant conversations with last message for each
I am trying to create a simple chat application database schema, and query the conversations. My current table setup is the following: So basically each conversation has its own title, and multiple participants. What I would like to fetch my conversations sorted by the date of the latest message in the conversation (so the conversations with the newest messages are
Sql Database design hierarchy
I have been tasked to create an app to track our contracts. I am planing to use Django and PostgreSQL. Our existing data is in Excel with 52 rows. I have found an hierarchy pattern in the file which contains as below Holding Office Registered Office Operating Office For example – Holding office (company) can contain one more Registered Office
How to deal with fixed max number of posts a user can make within a time period?
Sorry for titlegore. Users can have at most 3 active posts, and each post is active for 48 hours. I was thinking about just putting active_post_{1/2/3}_id and active_post_{1/2/3}_expires_at on the users table, but wondering if there is a better way to handle something like this. Answer I would store only the timestamp of the post and use middle-tier logic to
NoSQL or SQL for Data Structure [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 1 year ago. Improve this question I’m building an app, and this is my first time working with databases. I went with MongoDB because originally I