database-design

Simple DB design question -- sets of measurements

Hi all, I have multiple sets of measurements. Each set has multiple values in it. The data is currently in a spreadsheet, and I'd like to move it to a real database. In the spreadsheet, each set of measurements is in its own column, i.e., 1 | 2 | 3 | ... 0.5 | 0.7 | 0.2 | ... 0.3 | 0.6 | 0.4 | ... and so on. If I have, say,...

Building a map simulation system

Hi guys, I'm currently working on a project that simulates a map with routes on it that allows users to decide their destination, and the system will calculate the shortest path to it. The map should receives real-time traffic data in which the traffic flow changes along the way while the vehicle is travelling. When the traffic flow chan...

When designing a new CMS database, what would be the most important features to add?

While this question asked something similar too, I'm interested in this from another angle. I'm not interested in the GUI part but in the database/domain part. (My preference is SQL Server with C#/ASP.NET but this Q should be language agnostic.) When designing a CMS system, data needs to be stored in tables and a business layer needs t...

Queries or methods in Rails?

Hello. I'm creating a Rails app and would like to know which of these is better: Store default data, like categories names, in a DB and get the data with queries; or create a method in ApplicationController that, with the category_id as argument, returns info about the desired category? Obs: The values will rarely be changed. Thank...

Biological Taxonomy Data Model

Looking for industry/standard data model for biological classification. Wikipedia ...

Database and table of arbitrary percentages?

This question is kind of complicated and I do not even know how to Google for it in the first place. I am even having loads of difficulty phrasing my question coherently but here goes! Hi guys, I need some help with some SQL. I am making a database (DB2 Express-C) backend for a company's corporate training software. The intention is to...

Best Practice for relationships shared among multiple tables

I keep running into this design problem, and I'm not happy with my solution so far. The problem is this: I have two or more entities, like People and Dogs, and they both have a relationship with a Notes table, that stores a message field and some meta data about the message like maybe the author. 1) First option is to not enforce the ...

Where to store system values

This seems like it'd be a common question, but I cannot find it. Perhaps "system value" is the wrong phrase. Anyway, by "system value" I mean the built-in values that a system has for a given concept. For example, if I have a list of categories (e.g., mexican, american, italian, etc...) where would you store them? Would you hard-code...

DB schema question, products types

My question is how to model transactions for different types of products. So there is a Transactions table: TransactionId(pk) Amount Method AuthorisedBy(fk) And there are different tables for different types of products. Books table: BookId(pk) Name Description Price And a Pens table: PenId(pk) Color Description Price And a tab...

mysql - user item ratings, 1 rating per user, updateable - table structure?

I'd like to give my users the ability to rate each item on the site from 1 to 5. They also must be able to go back and revise their rating for each item as they please. Lastly, the item's page will display the average-to-date of all user ratings when viewed. As for the PHP, I think I can handle that. What I'm struggling with is envision...

What are best database-modeling tools available in general and specifically for MySQL ?

Hi, I have tried searching other SO Questions but not found the answer am looking for and so am posting question here. My question is regarding what are the best database modeling tools available in general and what database modeling tools are available specifically for MySQL Database. Thanks. ...

What are the general guidelines and best practices to keep in mind while designing database for an application ?

Hi, My questions is regarding Database Modeling. I tried to look for this question amongst other Database Designing questions on SO but haven't found it and so here am asking about: What are the general guidelines and best practices to keep in mind while designing database for an application ? What are the best resources/books/Univer...

Any problems with multiple foreign key columns in a Rails class?

I'm coding a site that's using tags. Two other classes (Foo and Bar) both will use tags, but the tags used in Foo won't apply to Bar, and vice-versa. So I created the Tags table with both foo_id and bar_id columns, so when a record is saved, the foreign key for the correct object-type can be added. Will this cause problems? Is there ...

Getting data into and out of SQL tables with C#

Getting data into and out of SQL tables with C# I built a C# app that puts data into a SQL table. I am currently using the SqlConnection class in .net. Got started with this article. http://www.codeproject.com/KB/database/sql_in_csharp.aspx I had thought about looking at Linq to SQL but have not done it before and wasn't sure how to g...

Auto trim Database entries?

Is it possible edit a table definition to automagically trim entries of all trailing whitespace when they are entered? Or would this be more efficient/easier/normally done in the code befeore submitting the entries?? ...

User event subscription in the Web app

We are developing the Web App that will have user subscription to a specific group of events. For example: User create a comment in the blob and all users subscribed to this blog should have this event in their list. Currenly, we are searching for the data model to store this data. Store all events in one table seems a good idea from t...

What is the proper name for this table schema?

We have a common database schema that we use for some tables in our system. Them main reason is that we are running a multi-tenant database so not all of our users require the same fields. However, I do not know what the 'proper' name for this type of schema is. Here's an example of what one of our tables might look like: ClientID |...

Is there any site where to look for a data modeling inspiration?

Here's my problem: I'm about to design and implement quite a big sales module on top of an existing business (web) application. What I need is basically this - a complete e-commerce layer without the public part of it (I don't need a cart, payment gateways etc.). I'm going to build this thing from scratch since I'm not willing to hack an...

Storing tasks in the database

I am working on a certain application. Its basic structure is as follows: a database a web interface to control the whole system a number of client applications on remote machines The clients poll the database at regular intervals, to check if there are any tasks to perform. A task is: A formal name of the task (a string), for exam...

How to maintain referential integrity with common great-parent table?

Lets say I have a table with "Groups of Questions" GroupID | value --------+------ 42 | How often do you 9071 | Other question ... And, for each group of questions I have "questions" and "possible answers" Group | QuestionID | value ------+------------+------ 42 | 5 | ... brush your teeth? 42 | 89 | .....