database-design

Which Table Should be Master and Child in Database Design

I am quickly learning the ins and outs of database design (something that, as of a week ago, was new to me), but I am running across some questions that don't seem immediately obvious, so I was hoping to get some clarification. The question I have right is about foreign keys. As part of my design, I have a Company table. Originally, I...

Design review - do you think I'm doing this the right way? First commercial project for me!

I'm tasked with designing an application that will allow a person to scan a legal document, save that associated with a Name and save it to a database. Now, inside of the Organization, there are many departments, and each department can have many sub departments. Problem lies in that some larger organizations will have many departments...

Still Confused About Identifying vs. Non-Identifying Relationships

So, I've been reading up on identifying vs. non-identifying relationships in my database design, and a number of the answers on SO seem contradicting to me. Here are the two questions I am looking at: What's the Difference Between Identifying and Non-Identifying Relationships Trouble Deciding on Identifying or Non-Identifying Relation...

How to handle customers with multiple addresses in CakePHP

I'm putting together a system to track customer orders. Each order will have three addresses; a Main contact address, a billing address and a shipping address. I do not want to have columns in my orders table for the three addresses, I'd like to reference them from a separate table and have some way to enumerate the entry so I can dete...

Facebook Privacy Permissions Design

Does anyone know the general layout of how facebook's privacy permissions system works (database)? I've been trying to figure out how they manage to have such a complex set of rules be applied to various content on their site, yet it remains fast. How are they doing that? ...

Database design to hold multiple iteration measurements

Hi All. I am new to sqlite and SQL in general. I am keen to switch from flat-files to sqlite for holding some measurement information. I need a tip on how to better layout the database, since I have zero experience with this. I have a ~10000 unique statistic counters that are collected before and after each test iteration. Max number of...

What do you call the concept of dynamic data definition?

Maybe this is simpler and more straightforward then what I'm thinking but I can't seem to find this concept on google anywhere. The concept is this: You have a table in a database and the table has a specified number of columns. However, it has been asked of me by previous clients that there also be a set of dynamic user defined columns...

Can we define a nonclustered index without defining the clustered index?

Can we define a nonclustered index without defining the clustered index on a table? ...

In a star schema, are foreign key constraints between facts and dimensions neccessary?

I'm getting my first exposure to data warehousing, and I’m wondering is it necessary to have foreign key constraints between facts and dimensions. Are there any major downsides for not having them? I’m currently working with a relational star schema. In traditional applications I’m used to having them, but I started to wonder if they wer...

Database choices

I have a prickly design issue regarding the choice of database technologies to use for a group of new applications. The final suite of applications would have the following database requirements... Central databases (more than one database) using mysql (must be mysql due to justhost.com). An application to be written which accesses the...

Creating an object relational schema from a Class diagram

Hi Ladies and Gents. I'd like some help converting the following UML diagram: UML Diagram The diagram shows 4 classes and is related to a Loyalty card scheme for an imaginary supermarket. I'd like to create an object relational data base schema from it for use with Oracle 10g/11g. Not sure where to begin, if somebody could give me a ...

What books should be on the modern data warehouse architect's shelf?

I have a few on mine. Basically just the set of Kimball books: The Data Warehouse LifeCycle The Data Warehouse ETL Toolkit The Data Warehouse Toolkit Are there any others that should be included? Or any other good ones you know? -mcpeterson ...

Why is a database always represented with a cylinder?

This question came up today and I couldn't find any historical answer as to why a database is always represented as a cylinder. I am hoping someone in the stack world would know why and have a link or something backing it up. ...

Program to find canonical cover or minimum number of functional dependencies

I would like to find the canonical cover or minimum number of functional dependencies in a database. For example: If you have: Table = (A,B,C) <-- these are columns: A,B,C And dependencies: A → BC B → C A → B AB → C The canonical cover (or minimum number of dependencies) is: A → B B → C Is there a program that can accomplish...

Most watched videos this week

I have a Youtube like web-page where users upload&watch videos. I would like to add a "most watched videos this week" list of videos to my page. But this list should not contain just the videos that ware uploaded in the previous week, but all videos. I'm currently recording views in a column, so I have no information on when a video wa...

Commercial web application--scalable database design

I'm designing a set of web apps to track scientific laboratory data. Each laboratory has several members, each of whom will access both their own data and that of their laboratory as a whole. Many typical queries will thus be expected to return records of multiple members (e.g. my mouse, joe's mouse and sally's mouse). I think I have th...

Using an ORM with a database that has no defined relationships?

Consider a database(MSSQL 2005) that consists of 100+ tables which have primary keys defined to a certain degree. There are 'relationships' between tables, however these are not enforced with foreign key constraints. Consider the following simplified example of typical types of tables I am dealing with. The are clear relations between t...

MySQL VARCHAR like Data type with MIN and MAX character lengths

Looking for a data type that is similar to VARCHAR as to the values I would like, but is there a way to have a MIN/MAX character length? VARCHAR(6,10) This would have a minimum of 6 characters and a maximum of 10 characters. ...

Should I store logging information in main database table?

For example, say I have a table of products. Should I store logging information such as who it was created by, last edited by, last updated date, ... Or should I separate the logging information in say an auditing table if the logging information is not relevant to the actual application? Thank you. ...

Design Solution For Storing-Fetching Images

This is a design doubt am facing, I have a collection of 1500 images which are to be displayed on an asp.net page, the images to be displayed differ from one page to another, the count of these images will increase in the time to come, a.) is it a good idea to have the images on the database, but the round trip time to fetch the images...