Section 9 Sp 11
From CSE190M-Admin
[edit] Links
- Writeup
- New section handout (in development)
[edit] DB Login
(if your account doesn't work)
- world: traveler/packmybags
- simpsons: homer/d0ughnut
- imdb: siskel/2thumbsup
[edit] Tips
- It's largely self-explanatory. There are a bunch of SQL queries. You should look them over and choose a few to practice on with your students. Most of them are from the world database, but there are some near the end from the simpsons database as well. You can choose whatever you like. You don't have to do any of the simpson queries if you don't want to. Keep in mind that *THEY SUCK AT JOINS* so look out for that.
- This is a rare section that you might actually want to make paper handout copies for, so that each student has the queries and database tables on paper. It's up to you. If you want to make copies, you can print and copy the section handout web page. But we haven't usually made paper copies, so nobody would get mad at you if you didn't make them.
- Either way, whether you have paper copies or not, you probably want to let them work on these problems by themselves somewhat, either in groups or on their own or whatever you think is best. These are smaller problems and more suited to individual work. Maybe let them work for a minute and then call on somebody to help you write down the query. You can open up a MySQL terminal window to test out the queries. This is a good opportunity for you to tell them that they should really test their queries in the console before trying it (and failing) in PHP.
- After you finish a decent number of queries, there's a PHP page for you to work on if you choose to do so. The point of this is to take one of their queries and turn it into an actual working PHP web page. We provide a skeleton. You might want to look at the query ahead of time. The front page needs to do a query to get the country names and codes to make them into <option> tags. Then when you submit the form, the response page does a second query to find the top-population cities from that country. You might not finish all of that, but if you put in about 1/2 hour on queries, you could possibly finish most of it. I'm hoping you'll at least attempt this part so I don't have to cover HTML tables as much on Wednesday.