data-modeling

Collection as a metaphor for real world containers

I find modeling physical containers using collections very intuitive. I override/delegate add methods with added capacity constraints based on physical attributes such as volume of added elements, sort based on physical attributes, locate elements by using maps of position to element and so on. However, when I read the documentation of ...

How do you store sales ?

Hi, How would you store sales ? I though about storing a serialized array which contains the products ordered vs a sale_product table with a foreign key referencing products ordered. What are you thoughts about this ? Any experience with one of these ? Ty ...

What's the difference between Data Modelling and Domain Modelling?

By the way - with reference to data modelling I'm referring to logical or conceptual data models - not physical ones. The question came up during a discussion at work; naturally I leapt to Wikipedia to get some basic definitions in place - hoping that they might clarify the difference - but they didn't... A conceptual schema or conc...

MySQL DataBase design Question

I'm thinking of the best way to design a database given the following situation. There are over 1000 hotel room units. Each hotel room unit has a list of about 100 individual types of items with a qty attached to them. The inventory is standard for each hotel room. But the qty of each item can be changed. For example 3 coffee mug...

Django: How to keep track of a linear (yet flexible) project management workflow?

I'm developing a project management application in Django that requires a somewhat linear response process involving different groups of users (as in Django auth Groups). Each step in the response process has several response options (most options unique to the step) and is assigned to a user within a particular group. The next step in...

software or service to collaborate on a data model?

I'm trying to find a tool where a lot of people can work on a data model collaboratively (doesn't have to be at the same time, a checkout mechanism can work too). Embarcadero has an ER application called ER/studio which apparently comes with a repository system that acts like typical version control software. That sounds great except ER/...

Best way to store tags in a database?

I have a database that contains two tables: entries tags The entries table contains posts that each have one or more tags. The problem is, each post can have any number of tags. In other words, I can't have a 'tag1', 'tag2', etc. column and do a LEFT JOIN. How should I set up entries so that each post can have any number of tags? ...

simulation modelling

hi, i have a big problem in a simulation model.entities arrrive before and wait until 6.00 am.And entities arrive after 6.00 am dont get any problem and walk inside. How to model this in Rockwell arena????Please help?? Regards, nilani. ...

Structure of the DB

I am trying to structure a database for optimal use. But I have no idea how to make that happen. Here is what i will have A category which will have many products and a count for each on of those products For example Restaurants will be the category and the products will be the computer system, cash register and each one of these pro...

Kohana model for data spread across multiple tables

I am putting together a DB driven website with kohana and I need to be able to track revisions. So I have the data behind the individual pages in two tables. The first is the generic entity table that I use for keeping track of all the sites content. It contains basic information: resource uid, uri alias, creating user, creation date,...

What are the design criteria for primary keys?

Choosing good primary keys, candidate keys and the foreign keys that use them is a vitally important database design task -- as much art as science. The design task has very specific design criteria. What are the criteria? ...

What would it mean If I change the identifying relationship from this part of a database design to a non-identifying relationship?

Hi all, I have a question regarding with this database-design. I am a bit unsure of the difference between identifying and non-identifying relationships in a database leading me to some puzzles in my head. I have this database design: *(kind of like a movie rental stores. "friend" are those who borrow the movie. "studio" is the product...

Is denormalizing acceptable in this case?

I have the following locations table: ---------------------------------------------------------- | ID | zoneID | storeID | address | latitude | longitude | ---------------------------------------------------------- and the phones table: ----------------------- | locationID | number | ----------------------- Now, keep in mind that f...

Which MySQL schema would is optimal for this type of system

Assuming a system similar to Netflix where members create a wish list of movies and, based on their type of plan, one, two, or more of those movies in their list turn into orders, which one of the following schemas makes more sense? A controls table storing the following columns: controls(memberid, currentMoviesAtHome, moviesAtHomeLim...

Whats better design/practice: Nullable property or 1 value property and 1 bool "has" property?

I'm working on an ASP.NET MVC app, designing the domain models, using (testing) the new EF Code First feature. I have an Activity entity that may or may not have a Deadline, what is the best way to approach it? 1 property: public DateTime? Deadline {get; set;} and check vs null before using or 2 properties: public DateTime Deadl...

Database constraints - keep or ignore?

When I was learning in university, they taught us the database fundamentals, basics and rules, and one of the most important rules is the constraints (primary key, foreign key), and how to make 1-m, 1-1, m-n relationships. Now when I move to real business environment they tell me: you should forget all you have been taught; no constrain...

Using UML to detect potential race conditions in design

I'm battling a potential race condition in my application, which relies on multiple threads accessing a shared object to determine what their next logical operation should be. I certainly don't have a problem just scribbling stuff on a piece of paper or on the whiteboard, and using this to map out access to this shared object. However,...

Solution finder algorithm based on answers to a given questionnaire

Consider the following scenario: Potential customers are presented with a questionnaire where they can select none, one or multiple answers for every question. An automated algorithm should recommend the optimal solution based on the customers' answers. Example: There are 3 possible solutions S1, S2, S3 The questionnaire contains 1...

Why would the "View Dependencies" not show foreign keys between tables on 2 databases?

I have something minor, yet very odd happening in SQL Server Management Studio 2005. I have 2 database catalogs which are essentially identical. There is a Market table with a foreign key to other several other tables for example the "Project" table has a MarketID column with an FK reference from dbo.Market. in both db catalogs the Marke...

How should I model arbitrary time periods?

I'm having a hard time conceiving an object model that can store time periods like the following: "Any Wednesday from 2:00PM to 3:00PM" "April 1, 2010" "All April for any year" "Any day in April from 2:00PM to 3:00PM for any year" "Any day 1:30PM to 2:00PM" "Any April 1 to Any April 3" Sometimes the period will be for a specific date,...