data-modeling

How to model football game statistics in RavenDB

懵懂的女人 提交于 2019-12-10 12:08:39
问题 I'm new to RavenDB and I'm still trying to get my head around the best way to model the data for the current scenario. Here is what the data looks like. Game - Teams - Team 1 - list of players - Team 2 - list of players - Events - Event 1 - type: Pass - teamId - PlayerId - Event 2 - type: Goal - teamId - PlayerId At the beginning of each game we get the overall info for the game (e.g. Teams, Venue etc) and then every few minutes we get an updated list of events. Also I need to be able to

How do I model “relative” time in a database?

谁都会走 提交于 2019-12-10 11:54:33
问题 Clarification: I am not trying to calculate friendly times (e.g., "8 seconds ago") by using a timestamp and the current time. I need to create a timeline of events in my data model, but where these events are only relative to each other. For example, I have events A, B, and C. They happen in order, so it may be that B occurs 20 seconds after A, and that C occurs 20 years after B. I don't care about the unit of time. For my purpose, there is no time, just relativity. I intend to model this

How to model this multiple inheritance relationship with a RDBMS?

跟風遠走 提交于 2019-12-10 11:12:25
问题 I'm looking at this data model I've come up with and not feeling comfortable. I've changed the entity names so it (hopefully) makes more sense. In any event, how would you model the following? I have 3 entities. GovernmentCustomer, PrivateCustomer, PublicCustomer. Private and Public Customer are both CorporateCustomers. Corporate and Government Customers are Accounts. All Accounts share the same key space (So if PrivateCustomer has a PK of 1 it shouldn't be possible for Public or

Chat, conversation, messaging - CoreData model

删除回忆录丶 提交于 2019-12-10 10:01:34
问题 Before you mark a question as a duplicate of this question please read a description. I don't need to continue discussion there in the comment. So I want to create CoreData model for messaging app. Like said in this topic did i mentioned - i've had three entities: User entity define a author of message and participant in a conversation. Message entity define every text sending with app. Conversation entity defines conversation beetwen users using messages. OK so my data model is like: But

How to model party relationship data in ofbiz?

吃可爱长大的小学妹 提交于 2019-12-09 21:41:47
问题 I'm confused with the ofbiz data model. PARTY RELATIONSHIP is a relationship from one PARTY to a another PARTY corresponding to a pair of PARTY ROLE s. Entity PARTY RELATIONSHIP will have PARTY_ID_FROM , PARTY_ID_TO , ROLE_TYPE_ID_FROM , ROLE_TYPE_ID_TO and PARTY_RELATIONSHIP_TYPE_ID which is stored in PARTY RELATIONSHIP TYPE entity. But in that entity is also stored ROLE_TYPE_ID_VALID_FROM and ROLE_TYPE_ID_VALID_TO . Could have duplicate data in there ? And would PARTY_RELATIONSHIP_TYPE_ID

Relational data modeling for sub types

六月ゝ 毕业季﹏ 提交于 2019-12-09 07:06:59
问题 I am learning the Relational Model and data modeling. And I have some confusion in my mind regarding sub types. I know that data modeling is an iterative process and there are many different ways to model things. But I don't know how to choose between different options. Example Suppose we want to model the particles (molecule, atom, proton, neutron, electron, ...). Let's ignore Quark and other particles for simplicity. Since all particles of the same type behave the same, we are not going to

trying to figure out the best database schema

主宰稳场 提交于 2019-12-09 04:33:26
I want to come up with a generic schema (if possible) to use for a number of different events that I am managing. These events can be weddings, birthday parties, etc. So far I have 3 main tables: Contact Table - the usual info like address, phone, etc. Events Table - a list of events with some info like date, location, etc. EventInfo Table - contains the following fields (not complete but you should get the point): EventID ContactID NumberofAdultsInvited NumberofChildrenInvited Responded (yes, no) NumberofAdultsAttending NumberofChildrenAttending This is the table that I'm trying to improve. I

Enforcing common foreign key in many-to-many relationship

巧了我就是萌 提交于 2019-12-08 13:23:29
I have the following interesting data modeling problem. I am going to use the example of restaurants to illustrate it: Consider the following three entities: Restaurant , Location and Offer . A restaurant can have many locations and a restaurant can have many offers . Those relationships are easy to represent: A Restaurant table; a Location table with a FK from the Restaurant table; and a Offer table with a FK from the Restaurant table. The interesting problem comes now: An offer can only be valid on certain locations of a restaurant . The modeling of that restriction seems easy at the

MYSQL, using unique table names VS using ids

﹥>﹥吖頭↗ 提交于 2019-12-08 12:43:27
问题 I currently have 26 tables in a MYSQL database. My boss wants me to recreate those 26 tables whenever we have a new client, and append a client abbreviation of some sort to those new tables. So for example there's company1~system~users and company2~system~users and so on and so forth. I'd rather just add a table to the database that keeps track of our clients, with an auto incrementing 11 digit INT primary key and reference it in the other 26 tables instead, so we're not cluttering up the

Enforcing common foreign key in many-to-many relationship

南笙酒味 提交于 2019-12-08 08:55:59
问题 I have the following interesting data modeling problem. I am going to use the example of restaurants to illustrate it: Consider the following three entities: Restaurant , Location and Offer . A restaurant can have many locations and a restaurant can have many offers . Those relationships are easy to represent: A Restaurant table; a Location table with a FK from the Restaurant table; and a Offer table with a FK from the Restaurant table. The interesting problem comes now: An offer can only be