473,405 Members | 2,185 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Good Database Philosophy Book?

Looking for a book to help me develop a philosophy for building
databases (particularly on MySQL). And then taking them from concept to
construction.

Something like.... Start by asking which queries you will be performing,
then define all data needed for each of those queries, then progress to
normalize this data, etc.

Any Ideas....thanks...

Regards,

David Thompson
President
Provoix Corporation - Business Web Solutions
www.provoix.com
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.497 / Virus Database: 296 - Release Date: 7/4/2003

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

Jul 19 '05 #1
1 4177
On Tue, 8 Jul 2003 23:21:13 +0000 (UTC), in mailing.database.mysql
dt*******@provoix.com ("David Thompson") wrote:
| Looking for a book to help me develop a philosophy for building
| databases (particularly on MySQL). And then taking them from concept to
| construction.
|
| Something like.... Start by asking which queries you will be performing,
| then define all data needed for each of those queries, then progress to
| normalize this data, etc.
|
| Any Ideas....thanks...


Step 1.
Write out a Purpose Statement for your database. The more detailed the
better.

Step 2.
On another piece of paper write out 3 headings People, Events, Things.
Scan through your Purpose Statement for keywords for each section i.e.
People: client, employees, customers
Things: Stock, Books, Inventory
Events: Sales, Hiring

Step 3.
Under these keywords, roughly, fill in some field names i.e
People: Client: ClientName, Address
Things: Books: Title, Author, Price, location, Genre
Events: Sales: Date, InvoiceNumber, Salesperson, customer info

The idea here is just to get the information while you are
concentrating on each table.

When filling in this information ask yourself - what information does
this table need to have.

Except for the Events table(s) there should be no reference /
information outside of that table i.e. a customer table will only have
the customers details, no sales information, no stock information etc.

Step 4.
Revise the fieldnames that you will be using. Break them down to the
smallest logical component i.e.
People: Client: Address breaks down to Street, Suburb, State, Zip etc
Things: Books: location could be Shelf location, warehouse bin
location etc.
Events: Sales: check that you are capturing all the information that
you require for your reports.

Refer back to your Purpose Statement for additional information that
you might have missed. Repeat step 4.

Step 5.
Revise the tables. Look for any item that might have repeating data
that could be moved to its own table. An example would be the Genre
field in the Books table. Create the table and repeat from step 3.

Step 6.
Determine the primary key for each table. If there is not an obvious
one then add a new field to the table. (see note below)

Step 7.
Grab another sheet of paper and this time draw a grid (4cols x 4Rows)
for each table. The layout should be similar to that of the table
design.

This is going to serve 2 purposes. 1) it will give you the
relationships between the tables and 2) you will see if there are any
orphaned tables.

On the top row of each grid fill in some important data fields.
Fill in some pretend data for your People and Things tables only.

Now for the Event table(s) - play computer. By this I mean pretend you
are the computer capturing the transactions. Pull information from
your other tables that match the fields on your Event table.

Don't forget to do this to other tables in the People and Things area.
Try adding a new book to the list. Does it have a reference to the
Genre table?

Once you have done that - look at how the tables 'relate' to each
other. Draw the necessary lines.

Revise your table design as necessary.

Step 8.
On another piece of paper (or spreadsheet). Write out your table names
and their fieldnames. Fill in the datatype and any formatting
consideration (phone numbers, SSN etc). Also decide on default values
for the fields.

Make sure that your primary/foreign key datatypes match.

Step 9.
Go create your database within the db application.

------------------------------------------
Defining a Primary Key.
I'll use the Customer table as an example.
Table: FirstName, LastName, DOB, Street, Suburb, State, Phone.
Ask yourself, what field; in this table; is unique to that record?

In the Customer table there are no fields that are unique because:
Several people have the same first name or last name
Customers could have the same DOB (unlikely but possible)
The same goes for the address details.
Option - create a new field.

In the Events table you might have:
Sales: InvoiceNumber, Date, EmployeeNo, Book

It is pretty obvious the unique field here.

Fieldname Naming Convention
---------------------------
These are some of the conventions I use.
You may want to prefix each non-event table Fieldname with the
tablename i.e. Cust_FirstName, Sup_SupplierName etc.

Never use spaces in fieldnames - use underscores (saves headaches with
queries and migration to other databases).

Use mixed casing for the fieldnames (although mySQL doesn't honor
this).

Indicate primary/foreign keys with the postfix of ID, PK or FK
i.e. Cust_Customer_ID (Customer table)
Customer_FK (Sales table)

Sample Purpose Statement
------------------------
I want to track the number of albums (CDs, LP and singles) that I own.
I want to know when and where I purchased the album and how much it
cost.
I would like to be able to search the database by Artists Name and the
music type.
I need to have a list of tracks on each album and each songs playing
time.
A nice little touch would be, I could give the album and each song a
rating value. This is so that I could create my own music cds with all
my favourites songs of a particular genre.
I store my music according to a numbering system so I need to be able
to find the album by this number also.
Another nice touch would be, friends borrow by albums so I would like
to know who has a particular album, when they borrowed it. On a
report/query only those albums that have been leant out will be
listed.
------------------------
The above gives you enough info to create the database. First create
the database with OUT the 'nice touch' items. Once designed and
completed add in the 'nice touch' features. With a good, solid design
this will not cause too much additional work.
-----------------------------------------
HTH
---------------------------------------------------------------
jn****@yourpantsbigpond.net.au : Remove your pants to reply
---------------------------------------------------------------
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Patrick K. O'Brien | last post by:
I'm looking for a good schema to use as an example for an object database system. Something like a books/authors/publishers or teachers/students/courses kind of thing. There are plenty of...
226
by: Stephen C. Waterbury | last post by:
This seems like it ought to work, according to the description of reduce(), but it doesn't. Is this a bug, or am I missing something? Python 2.3.2 (#1, Oct 20 2003, 01:04:35) on linux2 Type...
7
by: Michele Simionato | last post by:
So far, I have not installed Prothon, nor I have experience with Io, Self or other prototype-based languages. Still, from the discussion on the mailing list, I have got the strong impression that...
0
by: Rick Miller | last post by:
I'm trying to spread the word about a recently published, unique C++ text/reference book. The most frequent comment I hear regarding this book is: "I wish I had this book when I learned C++!"...
7
by: tada991 | last post by:
Hello Everyone, I just purchased Visual Studio .Net Architect 2003 and want to know what's a good book for begginers to start with. I know nothing about programming whatsoever, but I do have a...
6
by: Keith Smith | last post by:
I read in a Visual Studio .NET book that with C# it is now recommended to open database connections whenever you need to query a database as opposed to the traditional method of opening a database...
6
by: Christoph | last post by:
I was browsing both the Amazon and Barnes & Noble websites looking for some good books but there appears to be *so* many and it's hard to tell which are going to be good or not. I'm looking for...
2
by: mesut demir | last post by:
Dear collegeaus, I would like to learn Visual Basic.NET and working with DATABASES. My intention is making some Windows programs using Database & Internet programs using Databaseses.(SQL) ...
206
by: WaterWalk | last post by:
I've just read an article "Building Robust System" by Gerald Jay Sussman. The article is here: http://swiss.csail.mit.edu/classes/symbolic/spring07/readings/robust-systems.pdf In it there is a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.