Re: [wdvltalk] Help with MySQL database design and operation

2008-08-12 Thread Matthew Macdonald-Wallace
Quoting Ross Clutterbuck <[EMAIL PROTECTED]>:

> Thanks Matthews
>
> Yahoo's no longer letting me send via their SMTP servers so until
> recently I've not been able to actually communicate with the list -
> not that I've been able to help much recently anyway! I'm all fully
> moved to GMail now so that's one less thing to worry about.

http://www.chrisbrogan.com/when-google-owns-you/ :o)

>
> Let me go over this so I know I've got it right in my head - you have
> a table detailing qualification data only, a table detailing course
> unit data only and then a third table that defines the lists of course
> units the qualifications have in them.
>
> Adding a course unit to a qualification would actually add a record to
> the third table, so even though the same course code may appear in a
> number of records, each record is only assigned to one qualification.
>
> Ah I get you - many-to-one and one-to-many relationships.
>
> Cool! Makes sense to me. I'll press on and get back to you - virtual
> beers on their way!

Glad it made sense, best of luck,

M.
-- 
Matthew Macdonald-Wallace
[EMAIL PROTECTED]
http://www.truthisfreedom.org.uk/


 � The WDVL Discussion List from WDVL.COM � 
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
   Send Your Posts To: wdvltalk@lists.wdvl.com
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk

  http://www.wdvl.com  ___

You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.


Re: [wdvltalk] Help with MySQL database design and operation

2008-08-12 Thread Ross Clutterbuck
Thanks Matthews

Yahoo's no longer letting me send via their SMTP servers so until
recently I've not been able to actually communicate with the list -
not that I've been able to help much recently anyway! I'm all fully
moved to GMail now so that's one less thing to worry about.

Let me go over this so I know I've got it right in my head - you have
a table detailing qualification data only, a table detailing course
unit data only and then a third table that defines the lists of course
units the qualifications have in them.

Adding a course unit to a qualification would actually add a record to
the third table, so even though the same course code may appear in a
number of records, each record is only assigned to one qualification.

Ah I get you - many-to-one and one-to-many relationships.

Cool! Makes sense to me. I'll press on and get back to you - virtual
beers on their way!

MOU

2008/8/12 Matthew Macdonald-Wallace <[EMAIL PROTECTED]>
>
> Quoting Ross Clutterbuck <[EMAIL PROTECTED]>:
>>
>> The main operation I need a hand with is deleting units from the units
>> table. Obviously, if I delete a unit I want it removed from all
>> qualifications that use it automatically. With that in mind, again, is
>> a comma-delimited list of unit IDs in qualifications records the best
>> way, and is there any easy way of updating all qualifications records
>> at once if I delete a unit record.
>
> I missed this bit out!
>
> If you use the previous email as a guide, when you delete a unit/module, all 
> you need to do is run a "delete from modules where moduleid = $x" and "delete 
> from course_modules where moduleid = $x" and the chances of it being listed 
> for any course have been removed.
>
> Cheers,
>
> M.
> --
> Matthew Macdonald-Wallace
> [EMAIL PROTECTED]
> http://www.truthisfreedom.org.uk/
>
>
>  • The WDVL Discussion List from WDVL.COM • 
> To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
> use the web interface http://e-newsletters.internet.com/discussionlists.html/
>  Send Your Posts To: wdvltalk@lists.wdvl.com
> To change subscription settings, add a password or view the web interface:
> http://intm-dl.sparklist.com/read/?forum=wdvltalk
>
>   http://www.wdvl.com  ___
>
> You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to [EMAIL PROTECTED]
> To unsubscribe via postal mail, please contact us at:
> Jupitermedia Corp.
> Attn: Discussion List Management
> 475 Park Avenue South
> New York, NY 10016
>
> Please include the email address which you have been contacted with.

 � The WDVL Discussion List from WDVL.COM � 
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
   Send Your Posts To: wdvltalk@lists.wdvl.com
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk

  http://www.wdvl.com  ___

You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.

Re: [wdvltalk] Help with MySQL database design and operation

2008-08-12 Thread Matthew Macdonald-Wallace

Quoting Ross Clutterbuck <[EMAIL PROTECTED]>:

The main operation I need a hand with is deleting units from the units
table. Obviously, if I delete a unit I want it removed from all
qualifications that use it automatically. With that in mind, again, is
a comma-delimited list of unit IDs in qualifications records the best
way, and is there any easy way of updating all qualifications records
at once if I delete a unit record.


I missed this bit out!

If you use the previous email as a guide, when you delete a  
unit/module, all you need to do is run a "delete from modules where  
moduleid = $x" and "delete from course_modules where moduleid = $x"  
and the chances of it being listed for any course have been removed.


Cheers,

M.
--
Matthew Macdonald-Wallace
[EMAIL PROTECTED]
http://www.truthisfreedom.org.uk/


 � The WDVL Discussion List from WDVL.COM � 
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
  Send Your Posts To: wdvltalk@lists.wdvl.com
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk

  http://www.wdvl.com  ___

You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.


Re: [wdvltalk] Help with MySQL database design and operation

2008-08-12 Thread Matthew Macdonald-Wallace
Quoting Ross Clutterbuck <[EMAIL PROTECTED]>:

> Hi List - been a while.

Indeed, I was wondering where "MoU" had got too... :oP

>
> In a nutshell my knowledge of database design and operation is very
> basic so I come to you for some advice on how best to set up a simple
> database and how to carry out certain operations on it.
>
> What I want to achieve is a database of qualifications that a user can
> search through. Each qualification is made up of a title, qualification
> level (1 to 4, can be multiple values), a list of mandatory units and a
> list of optional units. These units come from a user-managed list. Each
> unit is made up of a title and a type (mandatory or optional).

OK, here's my stab at it:

"modules"

module id - unique & primary key - probably auto_increment
module title
module description

"courses"
course id - unique & primary key - probably auto_increment
course title
course level
course description

"course_modules"
course id
module id
is_compulsory (boolean)

That means that the relationships between courses and modules can be  
very quickly searched on and also that a module that is compulsory for  
one course is not compulsory for all courses.

It also does away with the requirement for a CSV list and means that  
you can run much more powerful (and therefore more effective) queries  
over your data.

HTH,

M.

P.S. If it does help, you owe me 3 virtual beers... :o)



-- 
Matthew Macdonald-Wallace
[EMAIL PROTECTED]
http://www.truthisfreedom.org.uk/


 � The WDVL Discussion List from WDVL.COM � 
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
   Send Your Posts To: wdvltalk@lists.wdvl.com
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk

  http://www.wdvl.com  ___

You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.