MMProject
02-18-2010, 02:32 AM
I'm a school teacher and novice at this, but am trying to design a DB for kids to input the M&Ms, Skittles, Etc for a long-term probability exercise...
As each bag can consist of multiple colors of a predefined list (about 36 colors), I wanted to allow for logging of each bag (type of candy, color, variety)… I envision a dropdown for the type of candy and series of checkboxes (for each color by variety). Although most of the data is easy to put into a DB and query, the color thing really gets me as there can be any number of colors per bag (up to 36)… What is the best way to design the DB to account for 36 color options for each variety and be able to report just the colors that were in the bag?
To make it even harder, when searching I’d like to have the option for a search to identify all shades of a color (color family), so an advanced search would allow identification of every bag that contained a form of blue (Aqua, Cyan, Light Blue, etc) and a search for green would return all forms of green (including Aqua). In other words, colors could belong in up to 2 color families.
Example: Ability to Browse Bags
----------------------------------------------------------------
Bag: 1
Student: John
Type: M&M
Plain Colors: Red, Yellow, Blue, Brown
Peanut Colors: Red, Orange, Yellow, Green
Dark Colors: Red, Purple, Green
Bag: 2
Student: Lucy
Type: Skittles
Plain Skittles: Red, Yellow, Green, Purple
Sour Skittles: Light Green, Cyan, Pink
Tropical: Aqua, Teal, Light Orange
Example: Ability to Search Bags by Type, Variety, and Color
----------------------------------------------------------------
Type: M&M
Variety: Plain
Color: Red
Results:
Bag: 1
Bag: 4
Bag: 9
As each bag can consist of multiple colors of a predefined list (about 36 colors), I wanted to allow for logging of each bag (type of candy, color, variety)… I envision a dropdown for the type of candy and series of checkboxes (for each color by variety). Although most of the data is easy to put into a DB and query, the color thing really gets me as there can be any number of colors per bag (up to 36)… What is the best way to design the DB to account for 36 color options for each variety and be able to report just the colors that were in the bag?
To make it even harder, when searching I’d like to have the option for a search to identify all shades of a color (color family), so an advanced search would allow identification of every bag that contained a form of blue (Aqua, Cyan, Light Blue, etc) and a search for green would return all forms of green (including Aqua). In other words, colors could belong in up to 2 color families.
Example: Ability to Browse Bags
----------------------------------------------------------------
Bag: 1
Student: John
Type: M&M
Plain Colors: Red, Yellow, Blue, Brown
Peanut Colors: Red, Orange, Yellow, Green
Dark Colors: Red, Purple, Green
Bag: 2
Student: Lucy
Type: Skittles
Plain Skittles: Red, Yellow, Green, Purple
Sour Skittles: Light Green, Cyan, Pink
Tropical: Aqua, Teal, Light Orange
Example: Ability to Search Bags by Type, Variety, and Color
----------------------------------------------------------------
Type: M&M
Variety: Plain
Color: Red
Results:
Bag: 1
Bag: 4
Bag: 9