Make your MySQL database
- Plan out the database your project needs as shown in Chapter 9, identifying all tables you might need and all fields in tables, with any needful explanation of why you're doing what you're doing.
- Create a set of SQL commands to create the database. Also add a set of commands to add at least one entry to each table.
- Do those commands; get your database working.
- Back up your database to a file named yourName.sql (be sure and name it that way; naming it otherwise will confuse my mechanism for grading). Attach that file to the email you will send to me for your homework. Be sure it loads as is -- test it by deleting your database and loading it just like I will. (How to back up and reload.)
- Create in a text file, or somewhere, a query that shows that all your
tables can work together. For example, in my database,
this query shows that my users, venues, organizations, and
activities tables work together correctly:
SELECT organizations.name, venues.name, username, activities.name FROM venues JOIN activities JOIN organizations JOIN users WHERE users.username = activities.user AND organizations.id = activities.organization AND venues.id = activities.venue;
Output:+------------------+------------+----------+----------+ | name | name | username | name | +------------------+------------+----------+----------+ | LC Anime Society | Off campus | briggs_w | KatsuCon | +------------------+------------+----------+----------+ 1 row in set (0.00 sec)
- Cut-and-paste that query you wrote into both the command window and into your email to me.
- ...and send me that email.
To recap: that homework will have the query in the body of the email, so I can cut-and-paste it into MySQL and test your database -- be sure it works! -- and yourName.sql as an attachment.