Workshop
The Workshop is designed to help you anticipate possible questions, review what you've learned, and begin learning how to put your knowledge into practice.
Quiz
| 1. |
What SQL statement do you use to retrieve data from a database? |
| 2. |
What is the drawback to exporting a database table as an XML document, such as was done in this chapter using phpMyAdmin? |
| 3. |
Why is it a good idea to break down XML documents used for data storage into tables when storing the data in a relational database? |
Quiz Answers
| 1. |
The SQL statement used to retrieve data from a database is the SELECT statement. |
| 2. |
The drawback to exporting a database table as an XML document is that you typically have to do it manually, which isn't ideal for web applications that need to query a database for XML data dynamically. Furthermore, exporting an entire table is usually less useful than targeting data that matches a specific query. |
| 3. |
When you use XML documents for data storage, it's a good idea to convert them into tables when using a relational database so that you can take advantage of SQL when you're retrieving data from the database. |
Exercises
| 1. |
Set up your own MySQL database, and then modify the PHP example from this lesson to work with it. |
| 2. |
Try passing in different parameters to the PHP example to alter the SQL query, and therefore the resulting XML file. |