Lab #10 Databases

(due Thursday, 3/12, 11:59 PM)

Querying the database using SQL


Now 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 tableVenues
b)
SELECT *
FROM tableEvents, tableVenues
c)
SELECT *
FROM tablePerformers
WHERE Performer='Ladytron' OR Performer='Aventura'
d)
SELECT PerformanceDate, Venue, Address
FROM tableEvents INNER JOIN tableVenues
ON tableEvents.VenueID = tableVenues.ID
e)
SELECT Performer, PerformanceDate, Venue
FROM (tableEvents INNER JOIN tableVenues ON tableEvents.VenueID = tableVenues.ID)
INNER JOIN tablePerformers ON tableEvents.PerformerID = tablePerformers.ID
Save 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