Tuesday, February 15, 2005

mySQL Hour 6

Oh well, I've crashed my user ID in the new forum. Great, I have to wait for Nick to get back from holiday to fix it, because, apparently he's the only one who can.

So, instead of frittering hours away in the conference, I'll fritter hours away on my blog and trying to second guess the typos and ommissions in the various course materials. Just as well we're not all daft doing this course!

Determine you goals

Do it!


Conceptualise the tables

I'm conceptualising them right now!!!

Split it up into "single entry" and "multiple entry" tables:




SingleMultiple
Name
Job
Company
Address
Telephone Number
Fax Number
Email
Personal notes


Look just give everthing an ID alright?

Then add Date Added and Date Modified fields.

Determining Relationships

Well if you know how to do it, it's easy; if you don't, it's still easy!!!

Basically break everything down into objects (entities I think the database terminology calls them), that's right, everything. Then give each thing its own ID.

Once you've done that add an ID for the thing that it's related to. In this example all the things are related to a person. People are stored in the Name table so add a nameID field to all the other tables in your schema (ooo!!! proper database word!).

The book (p.69) shows you the updated field name list for each table. Except that the Company table hasn't got a nameID added to it. This might be what they meant but I'm guessing that it's another TYPO!!!!!!!! We'll see ;)

Apparently we've just cracked the second normal form where the rule is "No non-key attributes depend on a portion of the primary key". So now you know.

Creating the Database

Huzzah!!! We're going to create a database now!!!


  1. Create a database. At the c:\mysql\bin> prompt type:mysqladmin -u username -ppassword create contactDB
  2. Connect to mySQL monitor as the main (root - though I think I replaced that when I installed) user: /usr/local/bin/mysql -h localhost -u root --pyourpass

  3. Switch to the mySQL database. At the mysql> prompt type: use mysql.

  4. GRANT ALL ON contactDB.* TO supercontact@'yourhost' IDENTIFIED BY 'somepass';

  5. GRANT SELECT ON contactDB.* TO simpleusert@'yourhost' IDENTIFIED BY 'somepass';


Summary

Well, we finally got there. Time to revisit my myODBC/mySQL installations and see if I can make them talk.

Soon we'll be off to mySQL Hour 7. Stay tuned.
Comments:
thought-provoking, mootable pv. just my thoughts, well anyways gl & be chipper is what i say
 
Great work!
[url=http://moqigkxm.com/kyqo/kbtb.html]My homepage[/url] | [url=http://zjyiokys.com/ahem/lcdw.html]Cool site[/url]
 
Good design!
http://moqigkxm.com/kyqo/kbtb.html | http://ynnucrej.com/bvdj/oifp.html
 
Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?