Computer Science Homework Help
AU Week 4 Data Manipulation Language Discussion
I’m working on a databases multi-part question and need a sample draft to help me learn.
part 1
DML Versus DDL |
Prior to beginning this discussion, read Chapter 7: Introduction to Structure Query Language (SQL) from the course text. SQL statements are divided into three major categories: Data Definition Language (DDL), Data Manipulation Language (DML), and Data Control Language (DCL). In your initial post, explain the differences between DDL, DML, and DCL commands, and provide practical examples of each.
Parts 2
Database: Add, Display, Delete Records |
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 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 scripts 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 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.