0% found this document useful (0 votes)
5 views18 pages

Class 6 Complete Handout Solution Term 2

The document is an educational resource for Class 6 students covering database concepts, including definitions, key terms, and functionalities of MS-Access. It includes fill-in-the-blank questions, multiple-choice questions, true/false statements, and descriptive questions related to databases and programming concepts. Additionally, it provides practical scenarios for applying these concepts, such as designing a database for a university library and using Minecraft for programming exercises.

Uploaded by

mishaqasim123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views18 pages

Class 6 Complete Handout Solution Term 2

The document is an educational resource for Class 6 students covering database concepts, including definitions, key terms, and functionalities of MS-Access. It includes fill-in-the-blank questions, multiple-choice questions, true/false statements, and descriptive questions related to databases and programming concepts. Additionally, it provides practical scenarios for applying these concepts, such as designing a database for a university library and using Minecraft for programming exercises.

Uploaded by

mishaqasim123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

The City School Class: 6

Term: 2

Unit: Handling Databases


Q1: Fill in the blanks.
1. The common language among electronic database is .(SQL)
2. The most important property for a field is its (Datatype)
3. All tables are composed of horizontal _ (rows) and vertical
(columns), with small rectangles called (Cell).
4. To work with records from more than one table, you often must create a
that joins the tables. (Relationship)
5. allows you to view, format and summarize the information in
database. (Report)
6. Ms-Access is a (Database Management System).
7. In databases, (JOIN) is used to join two or more than two tables.
8. Primary Key has (Uniqueness) and (Not Null)
Constraints.
9. Foreign Key is a column or group of columns in a relational database table that provides
(a link between data in two tables).

Q2: Multiple choice question.


1. option allows you to create a new database from scratch
or choose from a selection of templates.
A) Open B) New C) Option
2. A is a way of organizing information by type.
A) Field B) Record C) Cells
3. A is one unit of information.
A) Field B) Record C) Cells
4. Constraint enforces that this field cannot be left unused or empty.
A) Table B) MS-Access C) Not Null
5. A is a special question you apply to the database to find specific data and
get the information you want.
A) Form B) Query c) Report
6. A in a database uniquely defines each record.
A) Primary Key B) Access C) Secondary Key
7. is complete information of one Record.
A) Column B) Row C) Access
8. is a way of organizing information by type.
A) Cell B) Query C) Field
The City School Class: 6
Term: 2

Q3: Select true or false statement.


1. Reports allow to add, edit or display the information stored in a database. True/False
(
F)
2. MS Access is a database management tool, used to store and manipulate data. True/False
(T)
3. Unique constraints enforce that data entered in this field can be repeated. True/False (F)
4. Not null is considered as empty or zero. True/False (F)
5. Design View is used for Creating Fields/Types while Datasheet View is used to Enter
Record. (T)

Answer the following questions


Q1. Define Database?
A structured set of data held in a computer that can be accessible in various ways is called a
database. Moreover, a Database is a place where you can store and retrieve (Access) the
required data and is placed centrally in a Machine. For e.g: Employee Information stored in an
organization’s Database, Nadra Stores the Information of All Citizens of Pakistan in Their
Database.

Q2. Briefly describe the software/tool we are using to create & Manage Database.
MS-Access is a DBMS used to Store and Manipulate Data and make Business Applications.
Q3: What is a datatype? Name any 4 datatypes of MS-Access?
Datatype classifies the type of data you want to store in the Column (field). Number, Short-text,
Boolean, Long Text, Date Time are a few examples.

Q4: Differentiate between Primary and Foreign Key with the help of example?
Primary Key: is a unique identifier that uniquely identifies each record in a table. The primary
key mustn’t repeat its value and it shouldn’t be kept null. The primary key typically appears as a
column in a relational Database. E.g of primary key: ( RollNo, CNIC, Vehicle ID No)

Foreign Key: is a column or group of columns that provides a link between data in two tables. It
is the reference of Primary key of one table in another table.

Q5: What are 2 Constraints of Primary key?


1. Not Null: This Constraint enforces that a field of Primary Key cannot be left unused.
2. Unique: This Constraint enforces that Data entered cannot be repeated and all values
should be unique to each other.
The City School Class: 6
Term: 2

Q6. What is a Query? How it works?


A query is a special question you apply to the database to find specific data and get the required
information. You can pull information from one or more table on the basis of search condition
provided.

Q7. What Functionality Forms and reports have in MS-Access?


Forms allow to add, edit/update, and display the information Stored in the database.

Report allows you to view, format and summarize the information of the database.

Q8: Why do we use relationships in tables?


Relationships in database is used to join two or more than two tables on the basis of primary
and foreign key. You cannot pull information from more than one table until relationship has
made.

Database Scenario Based Practice Question


You are tasked with designing a database system for a University library. The database
consists of two tables: "Books" and "Authors." The "Books" table stores information
about each book in the library, including attributes such as "BookID," "Title," and
"AuthorID." On the other hand, the "Authors" table contains details about the authors of
the books, with columns such as "AuthorID" and "Author Name."
Q: Identify Primary Key & foreign key of both tables & write the difference between
Primary & Foreign key:

Table 1: Author

Author Author Name


ID
H3P2R8 J.K Rowling
T5C9N3 C. S. Lewis

Table 2: Book

Book Title Author


ID ID
107991 The Harry Potter Series H3P2R8
The City School Class: 6
Term: 2

856656 The Chronicles of T5C9N3


Narnia

Primary Key & Foreign Key Identification:

Author Table:

 Primary Key: AuthorID


 Foreign Key: Not applicable in this scenario as there's no reference to another table.
Book Table:

 Primary Key: BookID


 Foreign Key: AuthorID (referencing the AuthorID in the Author table)
Difference between Primary Key & Foreign Key:

 Primary Key:
 A primary key is a unique identifier for each record in a table.
 It ensures that each record is unique and cannot be null.
 Primary keys are used to enforce entity integrity in a database.
 In the provided scenario, AuthorID in the Author table and BookID in the Book table are
examples of primary keys.
 Foreign Key:
 A foreign key is a column or a set of columns in a table whose values must match the
primary key in another table.
 It establishes a link between two tables by referencing the primary key of another table.
 Foreign keys are used to enforce referential integrity in a database.
 In the provided scenario, AuthorID in the Book table serves as a foreign key referencing
the AuthorID in the Author table.

Q: Imagine you're a student learning to use Microsoft Access for a class project. Your
teacher asks you to explore the functionality of Forms and Reports in MS-Access. Give a
brief description on both features of MS-Access (database).
 Forms:
 In Microsoft Access, forms are graphical user interfaces that allow users to interact with
data stored in tables or queries.
 They provide a convenient way to enter, edit, and view data in a database.
 Reports:
The City School Class: 6
Term: 2

 Reports in MS-Access are used to present data from tables or queries in a formatted and
printable layout.
 They allow users to summarize, analyze, and visualize data in a meaningful way.

Q: You're tasked with managing a small business's data using MS-Access. Identify and
briefly explain three powerful features of MS-Access that you can utilize to effectively handle
the business's information.
1. Forms: Forms in MS-Access provide a user-friendly interface for entering, editing, and viewing
data in a database. They help streamline data input processes and improve data accuracy by
providing structured input fields and validation rules. Forms can be customized with various
controls like text boxes, buttons, and combo boxes to make data entry more intuitive for users.
2. Reports: Reports in MS-Access are used to present data from tables or queries in a formatted
and printable layout. They allow users to summarize, analyze, and visualize data in a meaningful
way, making it easier to understand and interpret. Reports can include headers, footers, groupings,
calculations, and graphical elements to enhance the presentation of data and generate professional-
looking documents.

3. Queries: Queries in MS-Access are powerful tools for retrieving and manipulating data from
one or more tables in a database. They allow users to ask questions or perform specific actions on
the data, such as filtering, sorting, or calculating values. Queries can be designed using a visual
interface or by writing SQL (Structured Query Language) statements, providing flexibility and
control over the data retrieval process.

Q: Suppose you have a set of data on movies released each month from the years 2020 to
2023, now you must plan a query to separate each movie according to their genre for example
comedy, horror, anime etc.
Four Steps to Plan a Query:

1. Define Objective: Determine what information you need from the database and what specific
criteria will be used to retrieve it, for example separating all amines.
2. Identify Tables: Identify the tables in the database that contain the relevant data needed for the
query.

3. Design Query: Design the query using the appropriate tools or language to specify the selection
criteria, sorting order, and any calculations or manipulations required.
4. Test and Refine: Test the query to ensure it produces the desired results and refine as necessary
based on feedback or additional requirements.
The City School Class: 6
Term: 2

Q: What is Role of Primary Key and Foreign Key in Databases, Give the difference with
example?
Primary Key: A primary key uniquely identifies each record in a table and ensures data integrity
by enforcing uniqueness and preventing null values. For example, in a table of students, the
StudentID column could serve as the primary key.

Foreign Key: A foreign key establishes a relationship between two tables by referencing the
primary key of another table. It helps maintain referential integrity by ensuring that values in the
foreign key column match values in the primary key column of the related table. For instance, in
a table of orders, the CustomerID column could serve as a foreign key referencing the CustomerID
column in a table of customers.

Q: Forms & Reports are 2 essential features of MS-Access. Please support your answer by
explaining both the concepts and difference between them.
Forms: Forms provide a user interface for data input, editing, and viewing. They facilitate
interaction with individual records in a database and are designed for data entry and manipulation
by users.

Reports: Reports present data in a structured and formatted manner for printing or viewing. They
are used for summarizing, analyzing, and visualizing data from tables or queries in a database and
are typically designed for generating professional-looking documents or presentations.

Q: Imagine you're the captain of a spaceship exploring a new planet called Accessia. In
Accessia, there are two different modes you can use to look at information about the planet.
One mode, called Datasheet View, is like looking at a map of the planet where you can see all
the different areas at once. The other mode, called Design View, is like putting on your
engineer's hat and designing a new spaceship to explore Accessia. How would you explain
the difference between these two views to your crewmates using this space adventure
analogy?

In Datasheet View, it's like looking at a map of the planet, where you see all the information at
once, like the different continents and oceans. In Design View, it's like being an engineer designing
a new spaceship. You get to decide how the spaceship looks and functions before it goes on its
mission to explore the planet. So, in Datasheet View, you see the data, and in Design View, you
design how things will look and work.
The City School Class: 6
Term: 2

Topic: Minecraft-Hour of Code


Q: Choose the appropriate letters A, B, C and D.
1) The white space on the right in minecraft is called where we
build our programs.

A) Workspace B) Toolbox C) Interface D) Play space

2) To move a character, we use block from the toolbox.

A) Turn Left B) Turn Right C) Move Backward D) Move Forward

3) Method to delete the block in minecraft is .

A) Right Click & Press Delete B) Use Del Button on Keyboard C) Press Ctrl + D key
simultaneously D) Drag it back from the stack to the toolbox

4) To perform any action multiple times, one can use in Minecraft.

A) IF Statement B) Repeat Loops C) move Forward() Block


D) move Backward() Block

5.) IF statements are used to _.

A) Make Decisions B) Perform Analysis C) Repeat actions


D) Forward the Character

Q: For each of the following, indicate True or False


1) Blockly is a system which uses text to write programs. True/False.

2) HTML code is created as a backend by using blockly system. True/False.

3) Minecraft play space is where the program was built. True/False.

4) Repeat loops are used to make decisions. True/False.

5) Traditional programming is usually in text. True/False.

Answer the following questions:


Q1: "How do the fundamentals (principles) of computer science influence both technological
advancements and our everyday routines?"
The City School Class: 6
Term: 2

Ans: The fundamentals of computer science drive technological advancements by providing the
foundation for developing faster, more efficient systems and enabling innovations like artificial
intelligence and cybersecurity. In our daily lives, they impact routines through the ubiquity of
computing devices, facilitating communication, automation, and access to information.

Q2: "What are the key distinctions between block-based programming and traditional text-
based programming, and how do these differences impact the learning experience and
development process for novice programmers?"
Ans: Block-based programming uses visual blocks that represent code concepts, making it easier
for novice programmers to understand and visualize algorithms. In contrast, traditional text-based
programming involves writing code in a programming language using syntax rules. The
differences impact novices by providing a more intuitive learning experience with block-based
programming, while text-based programming offers greater flexibility and scalability for more
advanced projects.

Q3: Briefly explain the concept of Blockly in Minecraft.


Ans: Blockly, a system which uses visual blocks that you can drag and drop to write programs.
Under the hood, you're creating JavaScript code.

Q4: "Why is a Repeat Loop essential in programming, and what are the advantages of
utilizing it in algorithm design and coding?

Ans: A Repeat Loop is crucial in programming for executing a set of instructions multiple times
without duplicating code. Its advantage lies in improving code readability, and enhancing the
efficiency of algorithm implementation.

Remember: Repeat Loop (Repeats instruction over a sequence in a specified No of times/in


given range).
Q5: Which statements are called conditional statements & why do we need it in our
program?
Ans: Conditional statements are statements in programming that allow the execution of different
blocks of code based on certain conditions & to control the flow of execution based on specific
conditions. Examples include if statements.

Q6: Consider the Minecraft interface as you embark on building your virtual object move.
Label and identify key components of the Minecraft interface. Also briefly explain them.
The City School Class: 6
Term: 2

 PlaySpace: On the left is the Minecraft play space where your program will run.
 Toolbox/Blocks: This middle area is the toolbox and each of these blocks is a command
that directs Alex's actions.
 Workspace: The white space on the right is called the workspace and this is where
we'll build our program.
Q7: Lava is hiding beneath some of these blocks, which you’ll cover up before moving
forward. An IF command will come in handy here. Add a MOVE FORWARD command in
the correct place to mine these blocks. Please write code for the given situation.
The code first checks if there is lava below the agent using the IF command. If lava is detected, it
moves the agent forward to avoid it using the MOVE FORWARD command. Then, regardless of
whether lava was present or not, it mines the block in front of the agent using the DESTROY
command.
The City School Class: 6
Term: 2

Q8: "How does the fundamentals (principles) of computer science influence both
technological advancements and our everyday routines?"
The fundamentals of computer science provide the building blocks for technological advancements
by guiding the development of new technologies and algorithms. They also influence our everyday
routines by enabling the creation of software and applications that streamline tasks, communicate,
and entertain us.

Q9: "What are the key distinctions between block-based programming and traditional text-
based programming, and how do these differences impact the learning experience and
development process for novice programmers?"

Block-based programming uses visual blocks that snap together like puzzle pieces, making it easier
for novice programmers to understand and create code. Traditional text-based programming
involves typing out code using programming languages like Python or Java. The key distinction is
that block-based programming is more visual and intuitive, while text-based programming offers
more flexibility and control.

Q10: Briefly explain the concept of Blockly in Minecraft.


The City School Class: 6
Term: 2

Blockly in Minecraft is a visual programming language that allows players to create custom scripts
to control characters, interact with blocks, and automate tasks within the game. It uses a block-
based interface similar to Scratch, where users drag and drop blocks to create sequences of
commands.

Q11: "Why is a Repeat Loop essential in programming, and what are the advantages of
utilizing it in algorithm design and coding?

A Repeat Loop is essential in programming because it allows you to execute a set of instructions
multiple times without having to duplicate code. This saves time and makes programs more
efficient. The advantages of utilizing Repeat Loops include simplifying complex tasks, reducing
code redundancy, and enabling the automation of repetitive processes.

Q12: Which statements are called conditional statements & why do we need it in our
program?

Conditional statements are statements in programming that allow you to perform different actions
based on whether a condition is true or false. We need them in our programs to make decisions
and control the flow of execution, enabling our code to respond dynamically to different situations.

Q13: Consider the Minecraft interface as you embark on building your virtual object move.
Label and identify key components of the Minecraft interface. Also briefly explain them.
In Minecraft, key components of the interface include the toolbar, inventory, and action buttons.
The toolbar displays the items you can use, the inventory holds items you've collected, and the
action buttons enable you to interact with the game, such as jumping, mining, and crafting. These
components help players navigate and manipulate the Minecraft world effectively.

Minecraft Scenario Based Practice Question


Q: Imagine you're a brave explorer in the Minecraft world, and you've come across a
mysterious cave filled with treasures. To navigate through the cave safely, you need to use
code to control your character. How would you use code to make your character move
forward, turn left, and collect diamonds along the way?

You can use code to make your Minecraft character move forward by using the "move forward"
command. To turn left, you would use the "turn left" command. To collect diamonds, you would
use the "mine block" command whenever your character encounters a diamond block.

Q: You're hosting a big party in Minecraft for all your friends, and you want to impress
them with a spectacular fireworks display. Using code, how would you program the
fireworks to launch into the sky at different heights and explode in a variety of colorful
patterns?
-
The City School Class: 6
Term: 2

To create a fireworks display in Minecraft, you can use code to program the fireworks to launch
into the sky at different heights using the "launch" command with varying parameters. You can
also use code to specify the colors and patterns of the fireworks explosions using the "explode"
command with different color and shape parameters.
The City School Class: 6
Term: 2

Topic: Robotics
Q: Fill in the blanks.
1. Edison is the perfect tool to help, learn and teach coding, robotics and steam.
2. Edison is a Programmable robot. Edscratch is a visual block-based programming
language.
3. Edison Supports Block and text-based programming and uses Python as programming
language.
4. Edcomm cable is used to program Edison via connecting it with computer.
5. Edison Line tracking sensor is made up of two parts Red LED Light and Light Sensor.
Answer the following questions
Q1. What is a robot? What type of Edison Robot is it?
A robot is a programmable mechanical device that can perform specific tasks on the basis of
the provided code & mechanism. Edison is a programmable robot. It is suited to learning
basic concepts and complex processes as it supports Block Based and Python Programming.
Edison is the perfect tool to help, learn and teach coding, robotics and steam.

Q2. Describe the feature of interface (Ed-scratch) we are using to program Edison.
Edscratch is a vertical block -based visual programming language based on scratch. Edscratch
provides ease of drag and drop programming with powerful functionality and versatility.
Edscratch environment has 4 area; Block Palette, Programming Area, Menu Bar and Bug Box.

Q3: Briefly describe about Edscratch Interface areas;


1. Block Palette, 2. Programming Area, 3. Menu Bar and 4. Bug Box.

Ans: (Ref Page No:90 of Computing E-Book)


Q4: What is the function/purpose of the following in Edison Robot?
The City School Class: 6
Term: 2

1. LED 2. Drive 3. Sensing 4. Control 5. Sensing


Ans: (Ref Page No: 91-94 of Computing E-Book)

Q5: Why Robots are important? (General Question)


Ans: Robots can make Human life easier and much safer. Robots can do tasks which are
dangerous for human life like Bomb Diffusion, security guards etc. The development of robots
The City School Class: 6
Term: 2

drives technological innovation, leading to advancements in fields such as artificial


intelligence, machine learning, and robotics itself. These advancements have far-reaching
implications for various industries and society. Overall, robots are important because they
enhance efficiency, improve safety, reduce costs, enable exploration, help, and drive
innovation, ultimately contributing to the progress and development of society.

Q6: Write algorithm of the given Code: (Example given)


The City School Class: 6
Term: 2

Robotics Scenario Based Practice Question


Q: Imagine you're in a race with your friends to see who can build the fastest robot. You
have an Edison robot kit with different parts like wheels, sensors, and a programmable chip.
How would you use your Edison robot to design and build a robot that can zoom past
obstacles and win the race?
To build the fastest robot with your Edison robot kit, you'll need to make the most of its different
parts:

 Sensors: Use sensors like the line tracking sensor and obstacle detection sensor to help
your robot navigate around obstacles and stay on track. The line tracking sensor can
follow a marked path, while the obstacle detection sensor can detect objects in its path
and steer clear of them.
 LEDs: Utilize LEDs to provide visual feedback or signals. For example, you can
program the LEDs to light up when the robot detects an obstacle or to indicate which
direction it's turning.
 Control: Program the Edison's control chip to execute commands and respond to sensor
input. You'll need to write code that tells the robot how to move, when to turn, and how
to react to different situations during the race.
The City School Class: 6
Term: 2

 Drive: Implement a drive system that optimizes speed and efficiency. You can adjust the
motor speeds and wheel configurations to achieve the desired balance between speed and
control.
 Sound: Incorporate sound effects or signals to enhance the racing experience. You can
program the Edison to play different sounds based on its actions or to indicate race
milestones.

Q: You're at a science fair, and your task is to demonstrate how robots can help people in
everyday life. You decide to use your Edison robot to solve a common problem, like cleaning
up toys in a messy room. How would you program your Edison robot to navigate around the
room, pick up toys, and tidy up the space?
To showcase how robots can help with everyday tasks like cleaning up toys, here's how you can
use different parts of the Edison robot:

 Wheels: Attach wheels to move the robot around the room efficiently.
 Sensors: Use obstacle sensors to detect toys and obstacles in the robot's path.
 Control: Program the control chip to process sensor input and make decisions about where
to move and when to pick up toys.
 Drive: Implement a drive system that allows the robot to navigate around the room
smoothly, avoiding obstacles.
 Lego Hand: Equip the robot with a lego hand attachment to pick up toys and tidy up the
space.

By programming the Edison robot to use these components effectively, it can navigate around the
room, detect and pick up toys, and help tidy up the space, demonstrating how robots can assist
with everyday tasks at the science fair.

Q: Your Edison robot is participating in a robot soccer tournament where it needs to both
defend its goal and score goals against opponents. How would you program it to switch
between offensive and defensive strategies based on the game situation?
To make the Edison robot play soccer, you'd program it to:

1. Defend: Use its sensors to watch for opponents near the goal. When it sees one, it moves to
block the goal and stop them from scoring. This can be done by using the ultrasonic sensor.

2. Score: When it has the ball, program it to look for an open path to the opponent's goal. Then, it
kicks the ball to try to score. This can be done by tracker sensor.
3. Switching: We'll program the robot to switch between defending and scoring using if and else
statements, so it knows when to protect the goal and when to go on the attack.
The City School Class: 6
Term: 2

Q: Suppose your Edison robot needs to follow a line on the ground but encounters sections
where the line is broken or unclear. How would you program it to detect these gaps and
adjust its course to stay on track?
To help the Edison robot follow a line even when it's broken or unclear, we can:

 Use a light sensor to detect the line.


 Program the robot to keep moving forward until it detects the line.
 If the line is broken or unclear, the robot will turn slightly left or right to search for the line
again.
 Once the line is found, the robot will adjust its course to continue following it.
This way, the Edison robot can stay on track even when the line is broken or unclear.

Q: Your Edison robot is tasked with sorting objects of different sizes and shapes into separate
bins. How would you program it to use its sensors to identify and sort the objects accurately?
To sort objects accurately, the Edison robot can:

 Use color and size sensors to identify different objects.


 Program the robot to move towards an object and use its sensors to determine its color and
size.
 Based on the sensor readings, the robot will decide which bin to place the object in.
 Repeat this process for each object until all objects are sorted into their respective bins.

You might also like