2 minute read
3. MS Access Queries – III
Objectives
In this session, students will learn about –
● Creating a one-table query
● Multi-Table query
● Creating a multi-table query
Keywords
● Criteria: Conditions or rules you use to filter and retrieve specific data from a database
● One-table query: Retrieves data from a single table in a database based on specific criteria
● Multi-table query: Retrieves and combines data from two or more related tables in a database based on specific criteria
WEBS at a Glance
Revise the story and CS concepts covered in the previous session
Invite students to brief the class on the story and CS concepts covered in the chapter
Discuss creating onetable query, multi-table query, creating multitable query
● Recap the story and CS concepts covered in the previous session.
● Say: Let’s learn about creating a one-table query, a multi-table query, creating a multi-table query.
CS Concepts Explain
Creating a one-table query As given in Panel 3 on Page 99 and Panel 1 and 3 on Page 100
Multi-table query As given in Panel 2 on Page 101 and Panel 1 on Page 102
Creating a multi-table query As given in Panel 3 on Page 102, Panel 1 and 3 on Page 103 and Panel 1 on Page 104
● Present the scenario: Your class teacher wants to keep track of her students’ grades for the current semester.
● Discuss:
■ What tables should she have in her database?
Possible Responses: Students table; Grades table; Subjects table.
■ What fields should there be in the Students table?
Possible Responses: Student ID; First name; Last name; Grade.
■ What fields should there be in the Grades table?
Possible Responses: Student ID, Subject, Grades of each Subject for all students
■ What fields should there be in the Subjects table?
Possible Responses: Subject ID; Subject name.
● Conduct Tick the Correct Answer on Page 108:
■ Say: Let’s help Conji to tick the correct answers.
■ Read Q3, 4 and 5 aloud, one by one.
■ Invite some students to share their responses.
■ Discuss and validate the answers with the whole class.
■ Instruct: Write the correct answers in your books.
● Conduct Find the Truth on Page 109:
■ Say: Let’s help Conji to escape the secret chamber by marking the statements as true or false.
■ Read Q1, 2, and 5 aloud, one by one.
■ Invite some students to share their answers and others to validate their peers’ answers.
■ Instruct: Write the correct answers in your books.
Note
● If time permits, discuss the section Brain Teaser – Answer in Detail Q2, 3 or assign them as homework.
● Conclude: Today, we learned about creating a one-table query, multi-table query and creating a multi-table query.
● Ask the following probing questions:
■ What are some potential challenges or limitations when creating database queries?
Possible Responses: understanding the structure of the database and the relationships between tables; writing queries that are efficient and return accurate results; dealing with large amounts of data that can slow down query performance.
■ What is a subquery and how can it be used in a database query?
Possible Responses: A subquery is a query that is nested inside another query; It can be used in a database query to retrieve data from the nested query. For example, a subquery could be used to retrieve all the students who received a grade above the class average for a specific subject.
● Assign the following Brain Teaser exercise as homework:
■ Answer in Detail – Q2 and 3