database-design

how to design this mysql database

there are 2 million users each user has 4 tables . the data in 4 tables is not going to be appended and will remain fix. the structure of each users tables will be same. To store the data of these users in mysql i have to design a database. do i need to create 2 million databases each with 4 tables ? any help appreciated the 4 tab...

How do i merge two or more rows based on their foreign key?

I have three tables which are: A(a1, a2, a3) //This tbl (Table) can have multiple instances of a1, but cause of its dependence on b1, //we have a unique record each time B(b1, a1, b2) //tbl C has a relationship with tbl B through b1. b1 can also have multiple instances, but //sometimes a number of unique records in this table can ti...

Cannot create table in mysql

Hi, I want to create table which is having 216 fields but when I am trying to create it I got below error in mysql. #1118 - Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs I don't know what is its solution. please help me out. ...

SQL Syntax: Create a single table with column names created from data stored over multiple tables

I have created the SQL script below that creates four tables and inserts data into the tables to demonstrate my question (I hope this helps!). This problem arose because originally this data was stored in a single table of 400 columns and it got very unmanageable so I wanted to find a better way to store the parameters: use master G...

Diagrams for Data Flow?

I'm a database programmer, but I have never used data flow/diagram program. I would like to explain some Data Diagram to a client. Question - what is a program that will allow me to easily create a diagram to explain some data tables and process (windows)? ...

Are data-snapshots of line item prices better than calculations in all cases?

I've often seen line_item tables for orders or invoices that copy one or more fields from other tables in order to take a snap-shot of a customer's product order when it was placed. In my schema, however, I can generate a view of an order without copying data. So looking up the order/product/price data is a little more expensive, but I...

How to Represent Rules using a MySQL Table?

I have a table of 100,000s of USERS (name, age, gender, phone, company, street, city, state, country, zipcode, etc). I also have a table of thousands of PROMOTIONS which are offered to users. Now, for each promotion I need to add a rule which defines which subset of users it applies to. For example, a rule might be: All users which hav...

indexing pros cons in sql server 2008

I am working on social networking site. now our team decide to store user profile in denormalized manner. so our table structure is like this here attribute it means one fields for user profile e.g. Firstname,LastName,BirthDate etc... and groups means name of a group of fields e.g. Personal Details, Academic Info, Achievements etc.. *...

Is the usage of stored procedures a bad practice?

Hi, We have an application that is written in C# that is connected to a ms sql server. We use to make a stored procedure for every database call, but then we've noticed that using stored procedures gives us a very big disadvantage, we don't know what stored procedures we need to update if we change our database. Now I was wondering if ...

SQL Server: One Table with 400 Columns or 40 Tables with 10 Columns?

I am using SQL Server 2005 Express and Visual Studio 2008. I have a database which has a table with 400 Columns. Things were (just about manageable) until I had to perform bi-directional sync between several databases. I am wondering what arguments are for and against using 400 column database or 40 table database are? The table in...

Storing Revisions of Relational Objects in an Efficient Way

I'm not sure if this type of question has been answered before. In my database I have a product table and specifications table. Each product can have multiple specifications. Here I need to store the revisions of each product in database in order to query them later on for history purposes. So I need an efficient way to store the produ...

How do you create a Dynamic Database?

Question, I am using Oracle 10g and my client wants me to create a Dynamic Database. Are there instructions that I can use to create one? What is the difference between a Relational Database and a Dynamic Database? Thanks Wayne ...

Database design for a survey

I need to create a survey where answers are stored in a database. I'm just wondering what would be the best way to implement this in the database, specifically the tables required. The survey contains different types of questions. For example: text fields for comments, multiple choice questions, and possibly questions that could contain ...

multiple attribute

Hi, How can i define multiple attribute in database. Suppose the name field. It has three parts: Firstname, Middlename, Lastname. And the Address Attribute: Street Address City State Zipcode Country ....... ...

Is a one table 9 GB database good design?

I was asked to think about a database for our application. There are about 7 different data need to be stored. One is identification data which may contains an unique serial number, time, location. All other 6 data sets (4 binary raw data, 2 text data) must be identified by the identification data. 3 of them are about 2 MB a record, othe...

Should I model with an association table for future flexibility?

This is a database modeling question. I normally model one-to-many with a standard parent-child table setup, and I normally model many-to-many with an association table between the 2 tables. In this one case, the current requirement calls for a one-to-many relationship. But the client was talking about some potential future requiremen...

Relating two tables in a database

I have a "Student" table which should have name column. But I made another table "StudentsName" for name since names have three parts: firstname, middlename and last name. Now my question is how should I relate these two tables? ...

design of fact table(s) for data warehouse

how would you model this in a data warehouse: there are municipalities which are geographical areas, that exist in geographical hierarchies, such a province (i.e. state, e.g. Minnesota), region (e.g. MidWest). a performance evaluation is done on these municipalities, by calculating performance indicators such as "% of housing backlog...

Is it OK not to use a Primary Key When I don't Need one

If I don't need a primary key should I not add one to the database? ...

Entity Framework Endpoint Multiplicity

Say I have 3 tables in a Tennis Application (stripped down removing irrelevant info): Competitions Id (PK) Matches Id (PK) CompId (FK) CourtAssignments CompId (PK),(FK) CourtNumber (PK) MatchId (FK), (Unique) To describe the above: A match consists of 2 people playing tennis against eachother on a court. A competition consists ...