Designing Databases ySQL Happy Meal Example
The Setup Website for McDonald’s Happy Meal toy collectors Basic Functionality: Allow people to create site account Post info about toys Look up info about toys Trade/Post for Sale The Setup
What Data Must Site Deal In? Database to house individual data Determine how to organize it Ea. Piece of info stored: FIELD Sets of related fields: TABLE All tables together: DATABASE What Data Must Site Deal In?
Some Basic Info to Store User Info First Name Last Name User ID Password Photo Email Address Toy Info Name Collection Year Picture Toy ID Some Basic Info to Store
Way to Link the Two Tables Collection User ID Toy ID Way to Link the Two Tables
Translating to MySQL Creating Actual Database
Select Data Types for Fields varchar(40) varchar(15) mediumblob date Select Data Types for Fields
Start the WAMP & Open MySQL
Create a new DB
Name it Set collation to utf8_general_ci Press create Create DB
Select the DB (happymeals)
Fill in info Press Go Create User Table
Fill in Fields Set userid as primary Set Fields in Table
See Results
Create Toy Table Return to DB by clicking happymeal link Fill in info Press Go Create Toy Table
Fill in Fields Set userid as primary Set Fields in Table
View Results
Create Collection Table
Set Fields
View Results
Access Tables & Print from Print View Option Link
View of Whole DB
View of Individual Tables