20.07.2013 Views

Beginning SQL

Beginning SQL

Beginning SQL

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 1<br />

30<br />

Date of Date of Meeting Did Member<br />

Name Birth Address Email Joining Date Location Attend?<br />

Martin Feb 27, 1 The Avenue, martin@some. Jan 10, Mar 30, Lower West Y<br />

1972 NY com 2005 2005 Side, NY<br />

Martin Feb 27, 1 The Avenue, martin@some. Jan 10, April 28, Lower North Y<br />

1972 NY com 2005 2005 Side, NY<br />

Jane Dec 12, 33 Some Road, Jane@server. Jan 12, Mar 30, Lower West N<br />

1967 Washington net 2005 2005 Side, NY<br />

Jane Dec 12, 33 Some Road, Jane@server. Jan 12, April 28, Upper North Y<br />

1967 Washington net 2005 2005 Side, NY<br />

Kim May 22, 19 The Road, kim@mail. Jan 23, Mar 30, Lower West Y<br />

1980 New Townsville com 2005 2005 Side, NY<br />

Kim May 22, 19 The Road, kim@mail. Jan 23, April 28, Upper North Y<br />

1980 New Townsville com 2005 2005 Side, NY<br />

Although that method seems to work fine, it’s bad news in terms of efficiency and becomes unmanageable<br />

later on as more members join and more meetings are held.<br />

What’s so wrong with it?<br />

First, you have unnecessary data duplication. Each time you hold a new meeting, you need to store not<br />

only the meeting details, but also, because they are in the same record, the members’ details again. Your<br />

database would become huge in size quite quickly. Additionally, a lot of work is involved in actually<br />

updating the data. If Jane, for example, moves into a new house, then you need to update not just one<br />

record, but every single record relating to her. Another problem arises when you try to retrieve member<br />

details. Choosing which of the members’ records to retrieve the data from would be extremely difficult;<br />

after all, you can choose from more than one record.<br />

Rethinking your organization, you need to store details of more than one meeting, so instead of having<br />

more than one record per person, instead create new columns for each meeting so that your fields<br />

include the following:<br />

❑ Full name<br />

❑ Date of birth<br />

❑ Address<br />

❑ Email address<br />

❑ Date member joined club<br />

❑ Meeting date 1<br />

❑ Location 1<br />

❑ Whether member attended meeting 1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!