database-design

Is there a proper place for a staging database?

We have been storing our staging database on the production database server with the mindset that it makes sense to be as identical to production as possible. Lately, some comments have made me question that idea. Since there is some remote chance that I will do something to production by mistake it may make sense to not put both on the...

Active Data Structure - Does this model (or similar) already exist?

Active Data Structure the concept is.. You have a table (one that holds lots of records).. [data1] (call this the 'active' table) --------- Data1ID (required) SysID (required) createdDate (required) lastUpdatedDate (required) [mydata] (user's fields) you also have n tables holding the same columns as Data1. [data2] (call these th...

Which database should I use for best performance

Hello, I am working in Visual Studio 2005, .NET 2.0. I need to write an application, which listens on COM port and saves incoming data to a database. Main feature: save incoming data (series of 13-digits numbers), if this number allready exists, then mark it as double. For example, there could be these records in database: 00000000000...

Multi-Site CMS - Database for every site, or ONE database for all sites?

I'm going to write a multi site content management system in ASP.NET. What will be faster: a database for every site, or one database for all sites? Thanks. EDIT: If a database for every site, which database should I use? XML? ...

Postgresql one db with multiple schemas vs multiple db with one schema

I've been reading this question, but it doesn't help me. Considering db administration, I think one db with multiple schemas is easier to maintain than the other option, but in terms of performance, which one is better?, is there any advantage from one over the other? TIA. ...

Visually Display Database Information with PHP/MySQL

Hi, I'm looking for a way to visually display my users' (schedules) at a glance. This is what my tables essentially look like: users: usrID usrFirst usrLast etc.. 22 John Doe semesters: id name year 1 Spring 2009 class_info: id name building ro...

Database Design: Circular dependency

Imagine the following database: Table 'companies' has fields id, name and flagship_product_id. Table 'products' have fields id, name and company_id. A company must have a flagship product (1:1 relationship) and all products have one company (1:N relationship). When using a storage engine such as MyISM, there shouldn't be any problem ...

How do mobile service providers manage airtime data?

Am just curious on how mobile service providers manage the data used to top-up airtime in your cell phone. In my region, when you want to top-up airtime on your cellphone, you buy a "scratch" card that has a unique number which you key in on to your cellphone. If the number is valid the amount value of the card is added to your account ...

Shopping Cart Structure Problem, Size selection etc.

Hello, I'm working on a shopping cart and my problem is, how should I design database for size selection for products? Tshirts can be "XL, L, M, S" etc. and shoes can be "36,37,38,39...blabla" Should I do just one size table or many tables for several types (tshirt, shoes etc.)? Thanks in advance... ...

Calling all database/ ORM/ data access layer experts

Hi guys, I have a little DB challenge for you. Hopefully you can help. The Problem: I need a solution that will allows me to "handle" changes to primary keys/ composite keys. By "handle", I mean I should still be able to perform CRUD operations with little or no code changes. It needs to have minimum hassle from an application/ databa...

database structure

I'm building a gambling-related website where people can be on soccer fixtures (matches). A fixture ends up with a result: home win - draw - away win. I have one table for teams and one table for fixtures and another for bets. The fixtures table has a home team and an away team. But how do I model a draw bet? It's easy to have the bet t...

How to add "Upgrades" entity to product-order database design?

I'm working on a database design for an e-commerce web application. For this question I am simplifying the design and only showing the parts that are relevant to my question. My things of interest (entities) in this scenario are Products, Upgrades, and Orders. The Products and Orders are related in a typical fashion for this type of da...

iphone data migration and application design

Hi there, I'm working on an application that has a read-only database shipped with it. The user will run the application and be able to select a series of "favourites" from the database which will appear in there "favourites" tab bar section. I.e. storing the primary keys. With each update to the application the read only data will p...

Why & When should I use SPARSE COLUMN? (SQL SERVER 2008)

After going thru some tutorials on SQL SERVER 2008's new feature SPARSE COLUMN, I have found that it doesn't take any space if the column value is 0 or null but when there is a value, it takes 4 times the space a regular(non sparse) column holds. If my understanding is correct, then why I will go for that at the time of database design?...

Optional Database Entities (part 2)

See 'Almost Decided' below NOTE: This is a continuation and simplification of Optional Database Entities. I am designing a new laboratory database that tests a wide variety of tests on a wide variety of sample types. Main Entities:   Each must have exactly one parent (except REQ) and at least one child (except MEA). Request ...

SQL Server Database - Hidden Fields?!

Hello! I'm implementing CRUD on my silverlight application, however I don't want to implement the Delete functionality in the traditional way, instead I'd like to set the data to be hidden instead inside the database. Does anyone know of a way of doing this with an SQL Server Database? Help greatly appreciated. ...

Best database design for a discussion system with varying category types?

I would like to design a message inbox table schema for messages which may belong to individual users or user groups. Let's say we have these tables already: users table with uid (PK) groups table with gid (PK) groups_association table with gid (FK) and uid (FK) Then, what would be the best design of the message and message-post ta...

Are there any good free or cheap tools for building an Oracle Database diagram?

I need to diagram an oracle database and I am hoping to find some good tools that are either cheap, or free. Ideally the tool should allow me to draw the relationships between the tables, as well as remove unwanted tables from the diagram. I already have access to MS Visual Studio 2008 as well as SSMS 2008, but I don't believe either w...

How to implement an equipment system in CakePHP

I'm attempting to create a CakePHP based web game mostly for practice as well as for the fun of it, but am running into a conundrum trying to figure out an equipment system. I have an Items table that contains all the possible information about an item, including an item_type field that contains an integer value determining what the ite...

Database design, wish list and its items.

I am creating a new database to manage wish lists. Solution A: Two tables, wish_list and wish_list_item Solution B: One table, wish_list_with_item This would have a wish list item per column, so it will be many columns on this table. Which is better? ...