Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    MYSQL




Relational DB Design


I've contructed a fairly simple normalized (3NF), relational database. By simple, I mean each table relates to other table(s) in a 1 to many (1,n) relationship. Now, I am trying to extend this database, but I'm not sure how to proceed given specific qualifiers. Allow me to illustrate:

* 1 Pod has 4 Channels > (1,4) relationship.

* 1 Sensor may occupy 0, 1 or 2 Channels > (0|1|2) relationship.

* 1 Pod has between 0 and 4 Sensors > Indirect relationship between Pod and Sensors. Direct relationship is between Channels and Sensors.

* 1 Sensor connects to 0 or more Pods, but only 1 Pod at any given time. Indirect Many-to-many relationship between Pod and Sensor. Again, the direct relationship is between Channels and Sensors.

I've drawn up a db diagram and attached. PodSernsorAssociation allows a many to many relationship between Pod and Sensor, although it may not be correct to even have this relationship.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Relational Db
i have a table "events" and a table " dates". As you may guess, one event has many dates (one-to-many relationship).
i would like to return a table that contains one event per row, with one column containing that event's dates.
target mysql version is mysql 3.23.58
Is it at all possible? I think mysql 4.1 has inner select but it is not possible in this case.

Relational Tables
i'm working on a project that consists of 2 things.
first a info-website: some general info and news items, projects, etc...
second an archive: everything about past projects

i want to structure the data into an mysql database and after reading this article , i've got a general idea how to build up a good database.

http://dev.mysql.com/tech-resources...malization.html

the only thing I'm wondering. how far must you go, i can almost split up all info into seperat tables and link them together. is it maybe a good idea to make 2 or 3 databases with less tables and make links between databases

for instence: adresses. you can make a table with adresses and relational tabels with al the zip codes, city, etc... if i do this with all data for the projects of de site, i get a database with a countless amount of tables. is it then wise to setup an extra database with just all the adress info and thuss less tables in each database?

Relational Databases
i want to set up a relational database in mysql. i want one table (items) to have a field (supplier) which gathers information fromt the table (people) field (supplier). is this possible?

Relational Database
I need help with creating a relational database and normalizing it.
I've been studying the process of creating a relational database,
however I am unsure if I am doing it correctly. Below is a sample
list I have created (on paper)of my database design.

Can someone review and let me know if I am doing everything correctly
and give me suggestions for improvement? Code:

Relational Tables
I come from a strong MSSQL background.  I recently acquired a project that I need to do with MySQL.  In MSSQL I was able to link the tables together, not allowing data to be deleted that was linked into another table.  How can I force that type of realtionship on tables in MySQL?

Many-Many Vs Object Relational
In the process of trying to figure this thing out, I've been
doing the old "stand around in the store and read as much as possible
before you look like a derelict" thing. This time, with the O'Reilly
"Managing and Using SQL" (I think that's it).

Anyway, I was looking at a chapter discussing database design (without
any direct reference to impementations in MySQL), and they mention
Obj/Relationaldesign as a way to have a many-to-many relationship. I'm
wondering if they're trying to imply that there are different ways to
implement a many to many. In my bkgnd, I would assume that in any
many-to-many you have to have the joining table, and there's not much
else to do but go to it and select all the rows that have the key
you're interested in.

Relational Database
i want to make a relation between two table, if you delete a specified record in the first table, the record in the second table that related to the first will be deleted too.

eg. if i have a table contains a studentid field and some information about that student and the second table contains the studentid too, and the grades of that student, if i want to delete this student all his grades will be deleted.
how to do that?

Relational Database
I'm redesigning my company website and I've come across a problem that I'm hoping some of you will be able to help me with.

I want to have a "customer login" section of the site. When a customer logs in they can view three categories of files that pertain to that customer. They are Drawings, Manuals and Software. I will be uploading the drawings/manuals and software to the website and so I assume that the table will have to hold the 'link' to these uploads.

I need to design a database that will allow customers to access multiple files but only the files that pertain to that customer.

I am thinking that I'll need two tables, one of customers log in details and one that holds the file names of the relevant drawings, manuals and software that they are able to download.

The problem is that I want multiple customer log ins to be able to see the same files. Basically like a 'permissions' thing. I'm not sure on the best way to do this in a database and I wondered if anyone has any ideas?

Relational DB With MySQL
Is there a way to create relational databases in MySQL like you can in MS SQL? I primarily use MySQL, and I have started to use some MSSQL stuff because I wanted to work on relational dbs, but I just didn't know if there was a way to do it in MySQL like MSSQL

MySQL Relational Database
Anyone here has a suggestions on what to do on this tasks:

1. I want to make a form which has 30 or more fields that our agents will fill in. These are Personal Info, Address and Housing Info, Employment Info, Security Info and Additiona cards info. Now as of the moment, These five categories are being saved in a one table for the query purposes that it is easy to fetch up (i'm a newbie and don't know how to segregate from one to five tables). I'm planning to resetup the database and segregate these five categories into 5 tables also. Now, my question is: these five categories are in one form or page. In a page the format of my web is on below. Now, if agents will click SUBMIT button of course all data will be encoded to the database on each corresponding table. But how I would be able to get or query those data in a one form. If it needs a lookup table, how would I implement that one.

Please help me.. really need your inputs on this matter. Thank you so much....

I. Personal Info:
Firstname: __________ Middlename:_________ Lastname: _______
Homephone:
email address:

II. Address info and house info:
street:_________ city:_______ state:_______ zip:_______
House status:________ House type:____________

III. Employer info:
name:_______________ occupation:___________
salary: ________________
IV. Security info:
Date of Birth:_________ SSN:_________ Mother's Maiden Name:_______

V. Additional Cards Info:
Firstname:________ Middlename:_________ Lastname:_________

(SUBMIT Button)

Properly Querying A Relational Db.
I've recently been working with more relational dbs and I was just wondering...am I working with them properly?

The reason I ask is because I'm wondering if there are easier/more efficient/more "proper" ways to be working with a relational db.

So here is an example: two tables, a project table and an employee table. The project table stores employee id in emp_id and is linked to the employee table by a foreign key (a one to one relation).

SELECT P.project_id, E.first_name, E.last_name, P.name, P.code, P.start_date, P.end_date, P.imdb
FROM project AS P, employee AS E
WHERE E.emp_id = P.supervisor
The thing is eventually we'll start to have tables with 4-5 foreign keys and I'm wondering if this is still "proper". Honestly it may seem a stupid question to some of you experts :-p

MySQL Relational Schema
I have a large mysql database and would like to see a graphical representation of the database schema i.e. primary keys, foreign keys, related tables.

Does anyone know of a good development tool which will display this?

Relational Query And JOINs
I'm trying to set up a simple invoicing system, and am having trouble figuring out the right query to retrieve data from three tables...

The important fields in the tables are:

Customers: CustomerID, Name, Address etc etc
Orders: OrderID, CustomerID, PaidSoFar
OrderRows: OrderID, ProductID, RowTotal

I need to make a list looking something like this:

M2M Relational Query Help Needed
I have 3 tables, below are a list of the significant fields in each.

Stories
* story_id
* story_date

Editions
* edition_id
* publication_id

Story_Edition_Jct
* story_id
* edition_id

What I need to do is create a list of all the stories that are newer than 30 days and have not been assigned to a given publication_id, but may or may not have been assigned an edition.

Just to clear that up some more, a publication consists of many editions, so we're looking for stories that may have been published in other publications, but want to restrict them from being republished in a given publication.

The following query is what I've come up with:

Checking Relational Db Structure
I have a table with the following id, username, password, email, phone, etc. What I want to do is have multiple pages of jobs where these people can submit themselves to. I was thinking of adding 2 more tables. One with jobs like this j_id, j_desc.

Then a second for job submits from users in the main table like this s_id, sj_id. Where the s_id is relative to the id, and j_id is relative to the sj_id. Will this work? Also is there someway of preventing double submits?

Relational Model Software
I need to build the relational model of a database I already have. Does anybody know if there would be a software or so that would make it for me withou me having to rebuild the database? I found some software like CaseStudio, but i'd like somthing simpler, that would import the SQL script or something like this.

Relational Database, Normalized, Need Query
So I am working on a project that deals with a large normalized database. The database used to be constructed with one users table that had a location field which contained a comma separated string of location abbreviations signifying which location that employee worked at. However, I have now changed the database to as follows:

CREATE TABLE `location` (
`LocationID` smallint(6) NOT NULL auto_increment,
`LocationName` varchar(120) NOT NULL,
PRIMARY KEY (`LocationID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;

CREATE TABLE `users` (
`UserID` int(11) NOT NULL auto_increment,
`fname` varchar(255) NOT NULL,
`minitial` varchar(2) NOT NULL,
`lname` varchar(255) NOT NULL,
`department` mediumtext NOT NULL,
`positionTitle` varchar(255) NOT NULL,
`supervisor` varchar(4) NOT NULL,
PRIMARY KEY (`UserID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=229 ;


CREATE TABLE `locationrelationship` (
`LocRelationID` int(11) NOT NULL auto_increment,
`UserID` int(11) NOT NULL,
`LocationID` int(11) NOT NULL,
PRIMARY KEY (`LocRelationID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ;
There are a lot more fields in the users table but the above should do.

My problem is I am now trying to query the users table and include the location name that the employee works at.

The below query should do this if the employee only has one location otherwise it will display multiple of the same user:


SELECT replace(concat_ws(' ', users.fname, null, users.minitial, null, users.lname), ' ', ' ') AS userName, users.department, location.LocationName FROM users JOIN locationrelationship ON users.UserID = locationrelationship.UserID JOIN location ON location.LocationID = locationrelationship.LocationID
An example of this could be:

John Doe, Billing, South Bend
John Doe, Billing, Elkhart
Jane Smith, Sales, South Bend
However I am trying to create a query that joins multiple locations and separate them by a comma then a space then applies it to some locations value in a query.

An example of what I am looking to do is:

John Doe, Billing, "South Bend, Elkhart"
Jane Smith, Sales, South Bend
Any ideas?

Making My Relational Tables Relate
I have created a mysql database and it is normalised to 3rd form.

I can successfully join some of my tables to give the results I am looking for.

However other tables that I join give the wrong data.

I created the table data in a spreadsheet and simply filled in the numbers where table_id foreign key corresponded to table_id primary key in the primary table.

This is probably why some tables relate correctly and others (where the data is repetitive and a reference table was created) do not.

Obviously it appears this is not the way to create relational tables?

Extracting Data From Large SINGLE-table Database To MULT-table Relational Database
I have a very large single-table database of articles that I want to convert to a multi-table, relational database.

The existing single-table database contains fields for article author, article source, and article category, where several 'author', 'source', and 'category' IDs repeat dozens of times for hundreds of different articles.

I want to create seperate tables for author, source, and category and populate the new tables by extracting data from the original single-table database by unique ID field.

I figured out how to use INSERT and SELECT to pull data in new tables, but can't figure out how to pull only a single instance of a unique author, source, and category to create master reference tables for author/source/category.

DB Design
is there a tool to view a schematic of a MySQL DB I don't mean the .sql file I
mean a pretty chart type schematic.

DB Design
is there a tool to view a schematic of a MySQL DB I don't mean the .sql file I
mean a pretty chart type schematic.

DB Design
inserting a base64 string into a text field in my db.  Again I may have design issues with this,but why in the world would it take 17 seconds to insert 1.7kb worth of text?
I can read the record in milliseconds, why would it be different the other way around?
What should I do to speed this up or design differently?

DB Design
I don't know why i am haveing a tough time on this one. i could just do it, but i want to do it the best way.

Its for cars; make, model, engine,

I'm just not convinced this is the way I should do it, because I also want to inlcude the years for the cars, and that vairies per model / engine combination

I was going to have a cars table that would have the following, but need help with getting the years in there also. Should Each row in the CARS table have a YEAR field, so a 1993 VW Corrado SLC and a 1994 VW Corrado SLC would have their own rows, even though they are basicly identica cars? or should I do a single row with a from and to year field?

i am leaning towards the one row for every configuration, since the data is small (mostly foriegn keys) and it would be precise and easy to look up between years, by model, etc.

Db Design
i am after a bit of advice here. i am creating a database that will apply to 3 venues london, paris and newyork with the potential for this to grow.
i will be taking bookings for these three venues. Would it be more efficient to have sepearat tables for the bookings and rates and rooms for each venue eg

london.bookings table
paris.booking table
etc

or just have one big booking table and a location id.
It is all theoretical but im working on the assumption that there will be only hundreds of site visitors each day.

Which Design Would Be Correct?
I have registered users, and these users can belong to a group. I'm trying to decide whether or not i should keep this group_id in the users table, or to create a cross referencing table and just keep the user_id and group_id in there. the cross reference table will allow for users to be associated with more than one group. and just keeping the group_id in my users table will allow me to avoid a few joins in some queries but only allow one user per group... any opinions on this matter? after typing this i feel as though creating the referencing table would be the better idea.. but i still would love to hear other opinions.



Table Design
I am designing a table for "friend relationships".

I have three possible solutions:
a)
user_id (int)
friend_id (int)
created_at (timestamp)

This will require 2 rows per friendship.
b)
user_id (int)
friend_id (int)
user_id2 (int)
friend_id2 (int)
created_at (timestamp)
This requires only 1 row, but 2 indices.
c)
user_id (int)
friends (text)

This contains a comma delimited lists of all friend_ids.

I am leaning towards option 3, ofcourse, adding & deleting friends will be a bit slower, but the bulk of the load is on reading of friend data anyways.

However I have a question if this would be slower:

QUERY 1
select items.* from items inner join friends ON friends.friend_id = items.user_id WHERE friends.user_id = [my_user_id]

QUERY 2
select items.* from items where user_id IN (select friends from network where user_id = [my_user_id]

QUERY 3
$friends (variable) = select friends from network where user_id = [my_user_id]

select items.* from items where user_id IN ($friends)

Query 3 requires 2 queries.

1. Which of these would be faster?
2. And would you still choose the solution you chose in 1. if I had to use the friend userlist on multiple occasions on the same page?

(select from groups, select from bulletins, select from items, select from users)



How To Design Database
I want to build a database for menu driven.
like
file
--new
--- html
--- php
--open
--- html
--- php
--save
edit
--cut
--copy
--paste
and like that.

So,please help me how to start with designing the database as it can have n no. of levels.

DB Design Question...
I am almost done building a LAN-based Point-of-Sale system. I am somewhat new to mySQL, although I have worked with it for a few years now. I've only used mySQL for simple things like storing images and contact info for people that use my web-based contact forms. Now I want to do something a little more in-depth, and I need some suggestions.

I want to be able to not only insert each invoice into the DB, but I also want to do so in a way that would allow me to provide various reports in a logical wy. As it stands now, I have 1 table that I call "invoices", where I store all the info that is found on a completed invoice: customer's information, date, sale type, and sale details, which is a semi-colon delimited list of all the items, quantities, and prices for everything they bought.

Now, after building that table and playing with it a little, it seems rather cumbersome to work with. I will have to do a lot of parsing in order to make reports like 10 Most Popular Items, Total Profit for the last week, Total Item Cost of all tickets for month of Nov, for example, since all of those details are in a list in one column.

How would you guys build your table/tables to make such data storage and it's subsequent access more logical with less overhead? A seperate customers table linked with an items table? Or would you do something different?


How Best To Design DB On MySQL 5.0 So That ..
I couldn't find this by a forum search.

On my local PC, I have MYSQL 5.x and was wondering how best to design certain fields in my table that MySQl 4.1 ( my hosting service ) won't complain about.

For instance, I noticed that when I pushed a PHP app from my local PC, up to my Host provider account, things failed because MySQl 4.1 didn't like 1024 character varchar's.

Is there a guide somewhere that would make it easy to design an downward-compatible DB ?

OO Design With MySQL
I know how to pull data from MySQL into an ASP.NET page using MySql.Data.MySqlClient and its connection, command, and data reader classes. Now I would like to kick it up a notch and start working in OO design principles into my code. The tutorials I've seen seem to be geared toward SQL Server and so I'm spinning my wheels.

Can anybody help me find a good tutorial (or a good book) that spells out in detail how to get the most out of MySQL in an ASP.NET environment. I'm especially interested in learning how to build a data access layer and/or typed datasets.

Database Design
I need the perfect mysql_fetch_assoc function for my db class file, i wan't to use it on the following situation:

I want to select and list some fields from a table in the mysql database.

I want to list them by fieldname and not by number result.

I mean not $result['number'] , i want $result['fieldname']

Here is a little example:
=================================================================
$result = $db->execute("select id,name,text from categories where catid=$catid;");
echo ($result[1]!="") ? "<tr><td>&nbsp;Name:&nbsp;</td><td>{$result[1]}</td></tr>" : "";
=================================================================
I want to list the result by fieldname. Maybe so:

echo ($result['name']!="") ? ............................

Design / Primary Key
The situation is that I currently have a excel sheet that is used to store schedule information for three trainers in the following format

  DATE  | Trainer 1 | Trainer 2 | Trainer 3|
 12/1/07 |  Mackens   | In office  | On Course|

My manager wants to place this info into a MySQL DB so that we can develop a php web site to manage the schedule and allow the trainers to view schedule info etc when offsite. I've designed most of the tables whose primary keys are all forigen keys of the schedule table but would like some advice on developing the schedule table in relation to its primary key.

I know that I can't use the date alone as a primary key so I was thinking of using both the Trainer_ID and Day(date) as the primary key as this should allow info for all trainers to be entered for the same date and be flexible enough to allow for growth in the number of trainers without having to edit any external php code etc.

However I was just wondering if I should continue with this method or could someone suggest a better method as I've missed something that an experienced DB admin/developer would spot.

Database Design
I have database tables for folders and a database with documents in it.

The folders table is setup like this

folderid
foldername
folderdescription

The document table is setup like this

documentid
documentname
documentdescription
folderid

I have a user table and want to set it so I can say certain users have permission on certain folder but not others.

I was thinking about adding a group table and putting the users in groups, but then certain users may need access to more than one document folder. I am thinking I will need to add some sort of table that handles just the permissions, but I am not sure.

I am just trying to sort out how to make it so I can put groups in and assign access to folders based on the groups.

Database Design
I usage of mySQL will revolve around a common group + user system. There
can be multiple groups and each group will contain some subset of users.

Each group will have a custom set of data whose values vary per user.

So basically a sample structure might look like this:
(some details intentionally left out)

Database

Table_Group_A
# of user columns

Table_Group_A_UserX
Column 1 Data
Column 2 Data
...
Column N Data

One probably incorrect thought on my part is that it would not be
necessary to store the usernames in Table_Group_A of those users who
belong to that group. But, thinking about it more, it seems like a good
idea. My original intent was to simply look for tables named
Table_Group_A_* and extract the username from the table name...

Does anyone have any recommends concerning this kind of design? I would
like to be able to lay things out in mySQL as cleanly as possible.

Database Design
I've read Ben Fortas book MySQL Crash Course which is a usefull introduction. However, I need to create a database that includes product descriptions, shopping card, stock levels, customer details, order records etc. While the Crash Course book gives some very useful information, I didn't really feel it gave me sufficient information for designing a database. Can anyone recommend any books that cover this aspect in more detail.

I do have the MySQL manual download pdf which I haven't read, but I'm assuming that this wont provide the sort of guidance I need. Presumably a book that also covers topics such as database maintenance/backup etc will be very useful too.

Database Design
I currently have 2 databases. The first one is used to store each user's info. This database has 3 tables. One that stores the login and password, another that stores their preferences, and another that stores their information (email, phone number, name, ...). In each table I use the login (char(25)) as the primary key.

The other database is used to store the posts and replies. I use 2 tables. One stores all of the information for each post and the other stores all of the information for the replies. I currently do not have a primary key for these tables.

First of all, I have tried to break up the User's database into tables based on how much I will be searching for that info.(for example, I have placed only the login and password in a table). Is this a good way to speed up my queries? My database does seem to be normalized with or without splitting the database up into different tables.

Table Design
I have a question about table design, here is the background.

The main table is "Customer" with standard stuff, first/middle/last name etc.. The next table is CustomerType. CustomerType has 16 types and a Customer can have more that one type. So below is what I think is correct design and I just wanted to confirm this is correct:

Table: Customer
CustID INT(11) not null primary key auto_increment
First varchar (15)
Middle varchar (15)
Last varchar (15)
ENGINE=INNODB

Table: CustomerType
CustID INT(11) not null
Type1 enum('Y','N') not null default 'N'
Type2 enum('Y','N') not null default 'N'
Type3 enum('Y','N') not null default 'N'
Type4 enum('Y','N') not null default 'N'
FOREIGN KEY(CustID) REFERENCES Customer(CustID)
ENGINE=INNODB

Is there a better way?

Table Design
I need have a table that will have a column that will have a numeric value. In some instances the numeric value will be a percent and in some it'll be a dollar value.

My questions are:

1. What is the best datatype to use? Currently I have it setup as a Decimal(10,2) datatype.

2. Guessing the datatype above is suitable, how can I tell if the value is a percent or a dollar amount?

3. There are some instances where, if the value is a percent, that it needs to be identified as < xx%. Using the Decimal dt, how could I record the "<" that needs to accompany it?

Database Design
What I've got is a database with different
category's and products below them. The thing I'm having trouble with is
the products all have different sizes and colors, and each (different)
product has it's own id and quantity. My first idea was to create one
huge table and deal with it. Is there a better way to do this? Is there
some resources on database design which would point me in the right
direction?

Database Design
I want to design a database that will have 4 main elements:

1. A person database - of individuals and their qualifications

2. An airplane database - of individual airplanes and their attributes

3. A flight database - where 'a person above' flies 'an airplane' with details of the flight

4. A maintenance database - containing descriptions of maintenance items done by 'a person' to 'a plane'

The outputs from this database would be several different log book types, pilots log, engine log, airframe log, propeller log, etc.

I just need a little guidance. I can see where I could just have one single large maintenance table where entries are ID'd with a plane ID and a person ID. But is that the right approach? Should the maintenance log be specific to a certain plane?

The same holds true for the flights. Just one big flights log with entries ID'd bt pilot & plane or each pilot have his own separate flight log???

Design Issue
I've tried a couple of times to design a database for some web programs I'm working on. I keep running into this issue: What if I have a table, and I want one of the data types to be a list. It seems like a table within a table is what I want. The other way I thought would be to create a seperate global table and have a variable that links to the ID of the able I want to contain the list (if that makes any sense). Here's an example:

Character
ID
Experience
Level
Strength

ItemInventory
ID
CharacterID
ItemID

But for some reason that seems really messy to me. Is that the way it's supposed to be done?

DB Design Users
If you have a database with several table and u want users to access the information. What is the available methods to allow these users to access information ( READING and ADDING at least).

Do I add users like the root. Or creating table which hold users informations in which case I wonder how these users access data without mysql user???

Database Design
I have make an lyric databse, the structure is like that

table: artist
artist_id (int)
name (varchar)
gender (varchar)
region (varchar)

table: lyric
lyric_id (int)
artist_id (index)
song_title (varchar)
lyric (text)

these 2 tables only for lyric for single artist. As you music lovers know, sometime artists sing some songs with other artists. Do you know how should I design another table to store those lyrics?

Database Design Tip?
Im designing a database and find that I seem to have a few small tables with say, 3 or 4 fields, where all of those fields are required to identify a record. Is it better to make a composite primary key consisting of all the fields, or introduce a non-composite primary key, like an auto_increment integer?

How To Design The Table?
i have a situation where a:

Table : member
One of the table field : hobby

And my member table need transaction and at the same time, i need a FULLTEXT search to be perform in hobby table

I know FULLTEXT support by MYISAM and Transaction supported by InnoDB

So how can i do that?

Database Design
I have my design like this. I have one table for the protuct that has a
collum for product type. Product type is another table that has links to
other tables like motherboards, hard drives etc. I hope you understand this.
Is that the easyest, most efficent way to do it?

Design Advice
I am looking at designing a mini database to handle subsets of data at my company. You probably know the drill--it's too much to handle with a spreadsheet, but not enough to warrant hassling the DBAs with loading it into our main servers.

So I am looking at managing the data via a local instance of MySQL. The largest file I need to manage at the moment is about 100 columns x 165k rows.

Obviously, I wouldn't build table of that size. That's the whole point of relational DBs.

But here's the deal, at my company, once someone finds a way to do something, it tends to stick. So I'm looking at solving a few temporary problems by managing subsets of data from our main DB.

I have this suspicion that once I am able to do this, the demands will grow, and all the sudden, I'll get stuck managing a whole bunch a data for a bunch of people.

So I want to build the DB right. I've never built a DB before. I just query the main DB.

Without getting into proprietary details, I can say that I am looking at unique IDs that correspond to clients--about 165k, plus all relevant associated data.

What I am tracking is which clients have performed what jobs for us, when, and what the result was.

I need to be able to run reports on this, and I need to add data at the end of each week.

Given all of the above, what general advice do you have? Are there any huge pitfalls to avoid? Any thing that I absolutely should do? Keep in mind that for now, this is just going to be run on a Core2Duo Desktop with 2 gigs of ram, so anything I can do design-wise to speed things along will be useful.

Luckily, I am not in a time crunch. But thanks in advance for whatever advice you are able to come up with.

Database Design Qn
I have a user_account table consisting of an auto id, email address and
password fields.

The id is made the primary key. Is that a good idea or should i just
discard the id and use email address instead?

If I were to have the email address as a foreign key in another table,
will the space consumed bigger that if i were to just use the id?

Which criteria should I give more priority to in deciding which way to go?

Design Question
I'm a somewhat new user of MySQL and I'm looking to use it in a business I am starting. I'm getting ready to start the planning phase for the databases that I'll need but I have a question that I have been unsuccessful in finding an answer to and I hope you can help.

My business will involve selling data files that will be accessible online. I will have a storefront online that will allow users to shop for the data on their own and once they check out, will be able to download the files. Since I'm fairly new to this, I don't know how to bring it all together. Should a database of this nature just store links to the physical location in the filesystem where the data can be found or do people usually store the actual files within the database itself? I hope I've explained this adequately but if I haven't please let me know and I'll try to clarify it better.


Copyright © 2005-08 www.BigResource.com, All rights reserved