|
Querying the database using SQLNow you will learn to experiment with SQL queries. Make sure your tables are saved before querying the DB! 1. Click on the Create tab, then click on the Query Design icon, but this time, close the Show Table window. 2. Click on the SQL icon on the top-left. If you don't see an icon, click on the arrow next to View and choose SQL View 3. You now have a blank window with which to enter SQL queries! After entering a query, click on the Run icon like before to see your query results. 4. To create more queries, repeat steps 1, 2, and 3. Here are some queries to try out: a)SELECT Venue, Address FROM tableVenuesb) SELECT * FROM tableEvents, tableVenuesc) SELECT * FROM tablePerformers WHERE Performer='Ladytron' OR Performer='Aventura'd) SELECT PerformanceDate, Venue, Address FROM tableEvents INNER JOIN tableVenues ON tableEvents.VenueID = tableVenues.IDe) SELECT Performer, PerformanceDate, Venue FROM (tableEvents INNER JOIN tableVenues ON tableEvents.VenueID = tableVenues.ID) INNER JOIN tablePerformers ON tableEvents.PerformerID = tablePerformers.IDSave everything and submit your database. This lab will be graded very generously. We just want to see that you made the three tables and linked them properly along with 1 or 2 queries. As with the last lab, you will see a screen of garbage on successful submission. That's OK. | |
Introduction | Create Database | Tables & Keys | Data Types | Link Tables | Basic Query | More Queries |