Database Design Shortcuts. What’s your problem? Sort out the basic idea for the Database… e.g. :...

12
Database Design Database Design Shortcuts Shortcuts

Transcript of Database Design Shortcuts. What’s your problem? Sort out the basic idea for the Database… e.g. :...

Page 1: Database Design Shortcuts. What’s your problem? Sort out the basic idea for the Database… e.g. : Your local Angling Club is looking to set up a Database.

Database DesignDatabase DesignDatabase DesignDatabase Design

ShortcutsShortcuts

Page 2: Database Design Shortcuts. What’s your problem? Sort out the basic idea for the Database… e.g. : Your local Angling Club is looking to set up a Database.

What’s your problem?

• Sort out the basic idea for the Database…

e.g. : Your local Angling Club is looking to set up a Database to manage their Membership & Match information.

Page 3: Database Design Shortcuts. What’s your problem? Sort out the basic idea for the Database… e.g. : Your local Angling Club is looking to set up a Database.

Identify the basic elements

• Hold the list of Members• Manage the renewal of

Memberships• Hold a list of their Venues• Hold the list of Annual Matches• Manage the booking of Matches

Page 4: Database Design Shortcuts. What’s your problem? Sort out the basic idea for the Database… e.g. : Your local Angling Club is looking to set up a Database.

Be a bit more specific !

• Membership list…– Add new Members– Review &/or update Member details– Allocate new Membership IDs– Track & log the renewal of

Memberships

Page 5: Database Design Shortcuts. What’s your problem? Sort out the basic idea for the Database… e.g. : Your local Angling Club is looking to set up a Database.

And more specific !!

• Add new Member…– Check existing Membership– Enter new Member details– Store details in the Members Table– Generate & Issue new Membership ID– Issue Membership Card

Page 6: Database Design Shortcuts. What’s your problem? Sort out the basic idea for the Database… e.g. : Your local Angling Club is looking to set up a Database.

Do a diagram…

Add a New

Member

Store details in Members Table(ID, Name,

Address, Phone, Date joined, etc…)

Issue new Membershi

p ID

Name, Address, Phone, Date joined, etc…

Membership ID

Page 7: Database Design Shortcuts. What’s your problem? Sort out the basic idea for the Database… e.g. : Your local Angling Club is looking to set up a Database.

Repeat, repeat, repeat…

• Repeat the process for each of the elements identified.

• Add more detail where necessary.

Page 8: Database Design Shortcuts. What’s your problem? Sort out the basic idea for the Database… e.g. : Your local Angling Club is looking to set up a Database.

What Tables ??

• Identify the Tables you need…– tblMembers – For the Membership List– tblMatches – Lists Match details– tblVenues – Where we fish– tblBookings – Link Members to

Matches and their Venues

Page 9: Database Design Shortcuts. What’s your problem? Sort out the basic idea for the Database… e.g. : Your local Angling Club is looking to set up a Database.

List you Fields…

• Fieldnames• Data Types• Key Fields• Formats

Page 10: Database Design Shortcuts. What’s your problem? Sort out the basic idea for the Database… e.g. : Your local Angling Club is looking to set up a Database.

And Normalise…

• Split Fields into appropriate Tables• No duplication of Data!!• Don’t over-do-it!• Identify the Relationships…

Page 11: Database Design Shortcuts. What’s your problem? Sort out the basic idea for the Database… e.g. : Your local Angling Club is looking to set up a Database.

Do a Diagram

tblMembers

MembershipID

DateJoined

Title

FirstName

LastName

Etc…

tblVenues

VenueID

Name

Location

Type

Etc…

tblMatches

MatchNo

VenueID

Date

Swims

Etc…

tblMatchBookings

BookingID

MembershipID

MatchNo

VenueID

Date

StartTime

Fee

Etc…

Page 12: Database Design Shortcuts. What’s your problem? Sort out the basic idea for the Database… e.g. : Your local Angling Club is looking to set up a Database.

Check back with Specs

• Link Design to Specifications– Does it do what was intended?– Is the client happy?– Do the Specs need revising?– Could someone implement your Design?

• Move to Implementation…