database-design

Database Structure for CakePHP Models

We're building a data tracking web app using CakePHP, and I'm having some issues getting the database structure right. We have Companies that haveMany Sites. Sites haveMany DataSamples. Tags haveAndBelongToMany Sites. That is all set up fine. The problem is "ranking" the sites within tags. We need to store it in the database as an archi...

How to best handle exception to repeating calendar events

I'm working on a project that will require me to implement a calendar. I'm trying to come up with a system that is very flexible: can handle repeating events, exceptions to repeats, etc. I've looked at the schema for applications like iCal, Lotus Notes, and Mozilla to get an idea of how to go about implementing such a system. Currently I...

Is there such a thing as too many tables?

I've been searching stackoverflow for about an hour now and couldn't find any topics related, so I apologize if this is a duplicate question. My inquiry is this. Is there a point at which there are too many tables in a database? Even if the structure is well organized, thought out, and perfectly facilitates the design intent? I have a d...

Best practice stock management when payment of customer failed using SQL Server and ASP.NET

Hi there, I am currently building a webshop for my own where I want to increment the product-stock when the user fails to complete payment within 10 minutes after the customer placed the order. I want to gather information from this thread to make a design decision. I am using SQL Server 2008 and ASP.NET 3.5. Should I use a SQL Server ...

Need help to create database schema for wholesale online tee store

Hi, I'm currently working on wholesale online t-shirt shop. I have done this for fixed quantity and price, and its working fine. Now i need to do this for variable quantity and price. I am trying to base my design on this reference site. Basic tables I have created are: CREATE TABLE attribute ( attribute_id int(11) NOT NULL auto_in...

Resources for high performance SQL Server database design

I'd like some suggestions for online resources (blogs, guides, etc - not forums) to help me become good at designing high performance SQL Server databases that operate with large amounts of data and have heavy loads in terms of data turnover and queries per minute. Suggestions? EDIT The load I'm talking about is mainly in terms of dat...

printing a big database with 20 fields in it.

Hello Friends, I m facing some issue while printing database with 20 fields in it. I am using MS Access Database. I want to print my datasheet such that, when End of page is reached (i.e. Left to Right) the remaining Columns should be printed in second line of the page. e.g. A B C D E F G |(end) a b c d e f g | H I J h i j Here Capi...

Unnecessary Redundancy with Tables.

My items are listed as follows; This is just a summary of course. But I'm using a method shown for the "Detail" table to represent a type of 'inheritence', so to speak - since "Item" and "Downloadable" are going to be identical except that each will have a few additional fields relevant only to them. My question is in this design patte...

Database scheme design social networking sites

Hi I am planning to design a social networking site (like orkut) asp.net mvc.I am stuck in database design.Anyone provide me the resource for that one. Thanks in Advance. ...

Database structure - To join or not to join

Hi! We're drawing up the database structure with the help of mySQL Workbench for a new app and the number of joins required to make a listing of the data is increasing drastically as the many-to-many relationships increases. The application will be quite read-heavy and have a couple of hundred thousand rows per table. The questions:...

Many-to-many relations in RDBMS databases

What is the best way of handling many-to-many relations in a RDBMS database like mySQL? Have tried using a pivot table to keep track of the relationships, but it leads to either one of the following: Normalization gets left behind Columns that is empty or null What approach have you taken in order to support many-to-many relationsh...

Main pricing and support for custom client pricing (Database Architecture ideas help - Rails)

Hi all, I have a personal project I'm planning and I came to a small hurdle. I want to have an item with price that will be the default for all clients/users. However, in my business I have some clients that are grandfathered in to some special pricing. In the case of these grandfathered in cases, I'll manually plug their special price...

SQL Concurrent test update question

Howdy Folks, I have a SQLServer 2008 database in which I have a table for Tags. A tag is just an id and a name. The definition of the tags table looks like: CREATE TABLE [dbo].[Tag]( [ID] [int] IDENTITY(1,1) NOT NULL, [Name] [varchar](255) NOT NULL CONSTRAINT [PK_Tag] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = ...

getting data from grid and storing the data in function of another class

I have been trying to find an solution to a question that I am unable to get for few days. The problem is that the data has to be taken from datagrid and passed to another class, and then in that class I have to store it in the database. Please guys, help me out. Thanks in advance. ...

What are some good ways to store performance statistics in a database for querying later?

Goal: Store arbitrary performance statistics of stuff that you care about (how many customers are currently logged on, how many widgets are being processed, etc.) in a database so that you can understand what how your servers are doing over time. Assumptions: A database is already available, and you already know how to gather the inform...

Different information domains in DB

Hi, I have a database for my personal site and at the moment it is storing different domains of information (Eg cv, CMS schema, and more, all in one DB). I have noticed that sets of tables (eg all for one domain) have no relationship to other groups of tables as they are completely unrelated. What implication does this have on database...

user height and weight in sql

We are planning to capture a user's height and weight and am looking for ideas on representing them in sql. I have the following questions in mind weight can be expressed in kilograms and grams and height in meters and centimeters, so should I capture them as a BigDecimal with an appropriate precision and scale or capture them as vanil...

Advice Needed To Normalise Database

hey all, im trying to create a database for a feedback application in ASP.net i have the following database design. Username (PK) QuestionNo (PK) QuestionText FeedbackNo (PK) Username UserFeedbackNo (PK) FeedbackNo (FK) QuestionNo (FK) Answer Comment a user has a unique username a user can have multiple feedbacks i was wondering...

Many to Many Association Tables - Is it customary to put additional columns in these tables?

We've encountered the following situation in our database. We have table 'A' and table 'B' which have a M2M relationship. The association table is named 'AB' and contains a FK column to table 'A' and a FK column to table 'B'. Now we've identified a need to store additional data about this association. For example, a date when the associa...

database design tool question

is there a good database design tool can generate sql script to create database (tables) in major database (Oracle, MySQL, SQL server, Sybase) without any changes? Which design tool are you think is good. ...