SQL101-Homework Assignment #1

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.

By Shannon Lowder

Shannon Lowder is the Database Engineer you've been looking for! Look no further for expertise in: Business Analysis to gather the business requirements for the database; Database Architecting to design the logical design of the database; Database Development to actually build the objects needed by the business logic; finally, Database Administration to keep the database running in top form, and making sure there is a disaster recovery plan.

Leave a comment

Your email address will not be published. Required fields are marked *