0% found this document useful (0 votes)
9 views

G7_Unit 9_Data & Data Representation

Unit 9 covers data representation and databases, emphasizing the importance of data in various industries like healthcare, manufacturing, and retail. It explains how to create and manage databases using MS Access, including defining primary keys, creating tables, and executing queries. The unit also includes practical activities for learners to apply their knowledge in real-world scenarios.

Uploaded by

aryaffuya
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)
9 views

G7_Unit 9_Data & Data Representation

Unit 9 covers data representation and databases, emphasizing the importance of data in various industries like healthcare, manufacturing, and retail. It explains how to create and manage databases using MS Access, including defining primary keys, creating tables, and executing queries. The unit also includes practical activities for learners to apply their knowledge in real-world scenarios.

Uploaded by

aryaffuya
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/ 17

Unit 9: Data and Data Representation

Learning Objectives
Learners will learn to:
 know that data is used to model scenarios within a range of industries,

including health, manufacture and retail

 understand the purpose of a primary key

 select appropriate fields to be the primary key

 know how to search pre-existing databases using a single criterion, such as

<,>.

Vocabulary
database
primary key
query

Let Us Start

Have you ever wondered why


we store and manage all the Databases come into play for storing
data we use in our data. They are like the brains of our
applications? applications, organising and storing
data in a structured way.

1
Let Us Explore
You have planned to start a library by collecting interesting books. You have

volunteered to manage the library during your school vacations.

 How will you maintain a record of these books?

___________________________________________________________________________________

___________________________________________________________________________________

 How will you keep track of books issued and returned?

___________________________________________________________________________________

___________________________________________________________________________________

 How will you search for books from a specific genre or author?

___________________________________________________________________________________

___________________________________________________________________________________

It becomes difficult to store and search a large amount of data as required for library

management. We need to use a database that allows us to easily store, manage and

search for a large amount of data in a structured way.

Get, Set, Go
9.1 Data in a computer system
We know that data is any numbers, letters or symbols that can be entered into a

computer system. Some data items are A, 20, DOG, 3.1415927, ABC123, +++.

Data stored on a computer can be easily organised and sorted in different ways,

displayed or printed in various styles and layouts, searched for specific things,

updated, backed up and stored or moved.

Data modelling in various industries


Data is crucial in modeling scenarios and making informed decisions across various

industries, including health, manufacturing, and retail. Data modeling helps these

2
industries to make better decisions. They can see trends, make predictions, and solve

problems with good data. Let us see how data is used in these industries.

Healthcare
 In healthcare, data represents information about patients, their health, and

treatments.

 Data, such as their names, ages, and medical history, is collected from patient

records.

 Records of patients help doctors and nurses keep track of patients' health

over time. They can see if someone had an illness before, what medicines they

took, and what treatments worked best.

 Data is also used to predict and prevent diseases. Doctors use data to see if

many people in one area are getting sick, and this can help them take action

to stop the illness from spreading.

patients database

Manufacturing
 Data is used to give instructions. It tells the machines how to cut, shape, and

assemble the parts of a machine or robot.

 Sensors on the machines collect data, like measurements and temperatures.

This data helps ensure that the robot is built correctly and safely.

 If the data shows something is wrong, like a part that is too hot, the

machines can stop working to avoid mistakes.

3
Retail
 Data is used to keep track of stocks in the store. The store's computer

subtracts one from the item's count when you buy something. The computer

can automatically order more from a supplier if the count gets low. This way,

the store always has what you want.

 Data is also used to decide how much things should cost. If something is

selling quickly, the store might raise the price slightly. They might lower the

price to attract more customers if it is not selling.

9.2 Introduction to database


A Database is an organised collection of data. It allows you to store a large amount

of related data in the form of tables. Data in each table is stored in rows and

columns. A telephone directory, a dictionary and a list of employees and customers

in banks are examples of a database.

The database below shows you an example of stored medical patients data:

Database structures
Databases are useful because they store data in a structured way. When structured

(organised), data can be manipulated easily and then output differently. Databases

consist of the following:

 Tables

 Records

 Fields

 Data/Value

4
Creating database
MS Access is a Database Management Software available in the Microsoft Office

suite used to create a database.


Steps to create a database
Step 1: Click Start All Programs. Select

Microsoft Access. The Microsoft Access

window appears.

Step 2: Select Blank database.

Step 3: Type the name of the file in the File

Name section.

Step 4: Click Create to create a new database

with the desired name.

Data type
A data type is used to specify the type of data that can be entered in a particular field

for a record. It could be text (alphanumeric values), numbers (decimal or numeric

values) and date and time. A field with a number data type will not allow you to enter

text values. You must select the correct data type for each field, depending on the

value you enter. The common data types used in MS Access, along with their

descriptions, are given in the table below:

5
Creating table
A default table, ‘Table1’, is automatically created whenever you create a new

database. You can add the fields for this table and rename it.
Steps to create a table
Step 1: Select the Create tab and click Table from the Tables section. A new table

with the name Table 1 is created.

Step 2: Select ViewDesign View to define the fields for this table. A Save As dialog

box appears.

Step 3: Rename the table and click OK.

Step 4: Enter the required field names and select the appropriate data type.

Step 5: Click the

Save icon to save

the table.

Step 6: The final

table appears as

shown.

6
Views of a Table
A table has different views, namely Design View and Datasheet View. In the Design

View, you can define the fields of the table, while the Datasheet View is used to enter

the records in the table.


Steps to open a table in Design View
Step 1: Select the Table from the Tables pane.

Step 2: . Right-click on the table name and select the Design view to open the table

in the design view. You can edit or change the field names or data types of fields in a

table.

Step 3: Click the Save icon to

save the changes made to the

table.

Steps to enter records in the


Datasheet view
Step 1: Select the table where you wish to enter records from the Tables pane.

Step 2: Click the View  Datasheet View option present in the Views section of

the Home tab. The Datasheet View window appears.

Step 3: Enter the data value in each field. You can use the Tab key to move from one

cell to another.

Step 4: Press the Enter key when done. MS Access automatically saves the new

record added to the table. Repeat the same for adding more records.

7
Primary key
Every single record in a database must have something to identify it uniquely. This is

called the 'Primary Key' or the 'Key Field'. A primary key is thus defined as one or

more fields (columns) whose values uniquely identify each record in a table. A

primary key cannot allow Null values and must always have a unique index.

Here are a few examples of which field can be chosen as a ‘Primary Key’ in a

database.

 In school, every new student admitted is given a unique 'student ID' or an

'office number' (primary key).

 When patients go into the hospital, they are given a patient number (primary

key).

 When bank customers want to deposit or withdraw money, they have to

provide their bank account number (primary key).

Setting a Primary Key


To make/remove a field as a primary key, right-click on the field and click the Primary

key option from the list. You can set the Indexed value to “Yes, No Duplicates” so

that Access can automatically increment the value for each new record.

8
Activity 1
Create the given table in MS Access as shown below:

Membership First Last Address City Age


No. Name Name
C – 533 Sameer Contractor Plot no, 21 31st Cross Bangalore 65
Lane
K – 643 Siddharth Kapoor 123/24, Garware Lane Mumbai 34
R – 389 Anita Ranaut 94, Camac Street Kolkata 56
A – 098 Kritika Anand 75, Murli Apartments Chennai 39
G – 142 Damodar Ghatge 98, Kamla Nagar Mumbai 63
O – 204 Viren Oswal 3, Aparna Society Hyderabad 52

 Set Membership No. as the primary key of the table

 Specify appropriate data types

 Set Membership No. field as the primary key

Saving and Closing a Database


Once you have finished, you need to save your work and close the database.
Steps to save and close the database
Step 1: Select the File option from the menu bar. The File menu appears.

Step 2: Click Save As to save the database.

Step 3: A Save As window appears. Add a suitable file name in the File name textbox.

Step 4: Click the Save option.

Step 5: A database with the desired name is saved and the database name appears

on the title bar as shown.

Step 6: Once you have saved the file, click the Close Database option from the File

menu to close the database.

9.3 Query
A query is a database object that allows you to view, analyse or manipulate specific

data stored in a database. It retrieves data from a table or tables based on the

9
specified conditions and displays it as another table. To find details belonging to a

particular field or record, specify a condition in a query and then ‘run’ the query. The

database would search for all records that match the criteria you specified. Queries

can be used to search for data from more than one field.

Operators used in a query


To create a query, we need to specify conditions. These conditions can be specified

using the comparison operators. Let us look at some of the operators that can be

used in a database.

MS Access allows you to create queries in two ways:

 Creating a query with a Query wizard

 Creating a query in the Query design

Creating a query in the Query design


Steps to create a query using the Query Design
Step 1: Click the Create tab on the ribbon.

Step 2: Click the Query Design button.

Step 3: Click the Create tab on the ribbon and click the Query Wizard button in the

Queries group. The Show Table dialog box appears.

10
Step 4: Select the table to add to the query and click Add. Click Close.

Step 5: Double-click each field you

want to include in the query.

Step 6: Enter any search criteria for

the field in the Criteria box.

Deselect the Show box for a field

if you want to use a field in a

query but do not want it to be

displayed.

11
Step 7: Click the Save button. Enter a name for the query. Click OK.

Step 8: Open the query or click the Run button if you are in Design view.

The result of the query

12
Creating a query with Query wizard
Steps to create a query using the Query Design
Step 1: Click on the Create tab and then click on ‘Query Wizard’.

Step 2: In the ‘New Query’ box, be sure that ‘Simple Query Wizard’ is selected and

click ‘Ok’.

Step 3: In the ‘Simple Query’ wizard box, select the fields from each table needed to

create the chosen query.

a. Select the table using the dropdown box

b. Select the fields by highlighting them in the ‘Available Fields’ box and using the

single caret (>) to move them to the ‘Selected Fields’ box.

Step 4: Click ‘Next’.

Step 5: Change the name of the query. Click ‘Open the query to view information’

selected. Click ‘Finish’.

13
Step 6: The query will then be displayed in the Datasheet view.

Activity 2
Create a database named "LibrarySystem" with tables "Books" and "Authors,". Create

a query to retrieve the titles and publication years of all books written by a specific

author.

14
Unit Review
1. Data is crucial in modeling scenarios and making informed decisions across

various industries, including health, manufacturing, and retail.

2. A Database is an organised collection of data. It allows you to store a large

amount of related data in the form of tables.

3. Databases consist of Tables, Records, Fields and Data/Value.

4. MS Access is a Database Management Software available in the Microsoft

Office suite used to create a database.

5. A data type is used to specify the type of data that can be entered in a

particular field for a record. It could be text (alphanumeric values), numbers

(decimal or numeric values) and date and time.

6. A table has different views, namely Design View and Datasheet View.

7. In the Design View, you can define the fields of the table, while the Datasheet

View is used to enter the records in the table.

8. A primary key is thus defined as one or more fields (columns) whose values

uniquely identify each record in a table.

9. To make/remove a field as a primary key, right-click on the field and click the

Primary key option from the list.

10. A query is a database object that allows you to view, analyse or manipulate

specific data stored in a database.

11. MS Access allows you to create queries in two ways: Creating a query with a

Query wizard and Creating a query in the Query design.

15
Check for Understanding
1. Answer the following questions.
a. Explain the relation between tables, fields and records with the help of an

example.

______________________________________________________________________________________

______________________________________________________________________________________

______________________________________________________________________________________

______________________________________________________________________________________

______________________________________________________________________________________

______________________________________________________________________________________

______________________________________________________________________________________

b. James has created a table for his bookstore. The table includes Book code, Book
name, Book publisher and Book cost. Which field will he select for creating the
primary key? Why?
______________________________________________________________________________________

______________________________________________________________________________________

______________________________________________________________________________________

______________________________________________________________________________________

______________________________________________________________________________________

c. Reena wants to view, analyse and retrieve specific data from the database. Explain
the component of MS Access that would help him to do the same.
______________________________________________________________________________________

______________________________________________________________________________________

______________________________________________________________________________________

______________________________________________________________________________________

______________________________________________________________________________________

16
Lab Activity
Q1. Create a database "EmployeeData" with a table named "EmployeeInfo" that

includes fields like "EmployeeID," "FirstName," "LastName," "Department," and

"Salary. Create a query to retrieve the data of employees earning more than 50,000.

Resources
https://edu.gcfglobal.org/en/access2016/

Reference Material
https://www.youtube.com/watch?v=eXiCza050ug&list=PLpQQipWcxwt-EHfE5zXtUrLtFYnOPBRE_

17

You might also like