Here are some practice problems for you to attempt using what you’ve learned so far about SELECT Statements. Please write the following queries against any instance of Adventureworks. If you do not have access to a copy of this database, please contact me and I’ll get you credentials to connect to my training server.
1. What query would show me all the records in example.person?
2. What query would show me the first name and last name for all records in Person.Contact?
3. Now, starting from the last query, what query would limit the results to just those people with a last name of Sanchez?
4. Again, using our query to show us first and last name from Person.contact, limit the results to people with a last name starting with c.
5. Given there are many rows returned by the query you wrote in question 4, limit the results to 10 rows.
If you have any problems with these questions, please feel free to email me and I’ll help! I’ll give you as little help as possible so you’ll push yourself to learn the material.
UPDATE: You can find my answers to these questions here.