The CEO of Neo Record Corp knocks on your office door.
"Knock knock! Hey, do you ever watch The Office? What a great documentary! I get so many management tips from that show... even though we both know a CEO's job is so much harder than a manager's," he says as you stare blankly, nodding in agreement. "We've got a... a problem. I just spoke with the product manager and he says that the beta versions of the OmniTunes client runs really slowly. Also, he says that the development team forgot to add any logic at all regarding the storage of data, so we need to, what's the technical word... ah, implement, we need you to implement something in the database to prevent data from getting messed up."
"Ok Michael," you say, "I'll implement some indexes to hopefully speed up the database queries and I'll add some constraints to the database to enforce some data integrity. But there might be other reasons for the slow performance."
"Oh, and I'll need a company car," you add, "in order to fully test the implementation since we both know that one performance dependency is a database DRIVER, right?"
"Right! Of course!" says your CEO, "I should have assigned you a new company car sooner. Ok, let's make it happen!"
Using your music_app database, create foreign key constraints on all the foreign keys in your database. Refer to this syntax guide for help.
In addition, create indexes such that:
Use this syntax guide to assist you.
Use a gui tool like Navicat, MySQL-Admin, SQL-Front, SQLYog or HeidiSQL.
You may find that your tables use the MyISAM storage engine. Use the statement
show create table [tablename]to find out.
To change your MyISAM tables to InnoDB tables use
ALTER TABLE [tablename] ENGINE=InnoDB
You may find that MySQL returns an obscure error when creating your foreign key constraints. Usually this is due to:
Record the alter table, foreign key and index statements in your documentation.