Creating Simple and Complex Queries
Starter What does query mean? What does sorting mean?
Lesson Objectives By the end of the lesson you will be able to: Define the key term query Create queries using appropriate search criteria Create queries using mathematical operators Sort data in a query
Scenario - Reminder Our school arranges school trips. Students hand in letters which must be collected and passed on to the school office. Office staff then enter this information into a database. The database has been modified to include the tutor group students belong to. Before we start you need to copy the new database from Dept Share/VLE into your Practical Skills folder.
Recap from last Practical Lessons So far we have: Created a database structure Imported data Edited data types Created calculated fields
Queries A “Query" is basically a "question" that you ask the database. Static /Simple query = one question Complex query = two or more questions Make a Note.
Task 1 – Simple Queries Watch the video from start to end called Creating a Simple Query. This is in the Dept Share. Use the video to help you create queries for each of the following: Students with an allergy Students from HA1 *Note use appropriate names for each query. 3. Under the subheading Query Steps, write a numbered list of the steps for creating a query.
Task 2 – Sorting Your teacher will now demonstrate how to use the sorting tool. Modify your query for HA1 to sort the students into alphabetical order by surname. Create the following query: Students who have paid a deposit Sort by the date paid into ascending order.
Task 3 – Mathematical Operators We can use mathematical operators in the criteria field… Operator Meaning = Equal to > Greater than < Less than >= Greater than and equal to <= Less than and equal to Make a Note. Create a query for people who have paid a deposit on or after 12th March 2012.
Plenary – Hands Up! What is a simple query? What is a complex query? What is sorting? What are the 5 mathematical operators?