Categories
Computer Science

Once you have completed your three tables, create a “join” statement that joins data from all three tables.

Burdened by Homework? Let us write your essays and assignments Order This Now

Prior to beginning this assignment, review Chapter 7: Introduction to Structure Query Language (SQL) from the course text and the 8.1 Visual SQL Editor (Links to an external site.) web page. In addition, you may also want to complete problems 1 to 8 in Chapter 7. These problems will assist you in completing this interactive assignment.
For this interactive assignment, you will create three MySQL database tables and write SQL scriipts to read, insert, and delete data. The first database table will contain the names of at least four of your favorite movies. The second table will be a list of actors who appear in the movies. The third table will be an associative table that describes the relationship between the actors and their movies (which actors appear in which movies). Actors and movies have a “many-to-many relationship,” meaning an actor can be in multiple movies and a movie can have multiple actors.
Use the MySQL Database Instructions Download MySQL Database Instructions to create the three tables.
Once you have completed your three tables, create a “join” statement that joins data from all three tables. Remember that field names used in more than one table (ASIN, ActorID) must be fully qualified (i.e., dvdtitle, ASIN).
The previous SQL query returns a separate record for each actor. Provide a way to group results from several records into a single row.
General guidelines for this interactive assignment:
String values in SQL statements are always enclosed within single quotes. ASIN and Title are both strings and require single quotes. For instance, your insert statement will look something like this:
$sql = “Insert into dvdtitles (asin, title, price) VALUES (‘$asin’, ‘$title’, $price)”;
SQL debugging tip: check your SQL statement before you execute it. Put the following line of code immediately before the mysql_query($strSQL) statement.
When retrieving ASIN from the querystring, remember that ASIN is a string, not a number.
Once you have completed the assignment, include the following in your initial post:
A Word document with screenshots of the tables you created.
A Word document with the SQL statements that you used to create the tables and populate them with data.
Explain how you grouped results from several records into a single row.

Burdened by Homework? Let us write your essays and assignments Order This Now

Leave a Reply