Harry Potter Database Instructions X

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11
At a glance
Powered by AI
The key takeaways are that a database is a collection of related data stored in tables. The document discusses creating and customizing database objects like tables, forms, queries and reports in Microsoft Access for a Harry Potter themed database.

The main components of a database discussed are tables, which store the data, and fields, which make up the tables. Tables are composed of records with different field types like text, numbers, dates etc. Tables can also have a primary key to uniquely identify each record.

The different types of objects that can be created in Microsoft Access according to the document are tables, forms, queries and reports. Tables store the data, forms provide interfaces to enter and view data, queries extract specific data from tables, and reports format query results for presentation.

DATABASES

HARRY POTTER EDITION

LET’S GET STARTED


HARRY POTTER
TRIVIA: A database is a collection of related data. The data is stored in tables.

For the Harry Potter database, you will create and customize objects in
Microsoft Access.
What is the name of
Mr. Filch's cat? The objects include:

1. Tables
2. Forms
3. Queries
4. Reports

You will complete and customize the objects by working on 4 projects.

Task to Complete:
Open the Harry Potter Database & look over to the left of the screen.
You will see “Objects”. Presently there are:
 4 Tables
 1 Query

Note – To the left of the screen, under “View”, click the down arrow next to “All Access Objects”
and select “All Access Objects” if you cannot view all objects at once.

A DATABASE IS A COLLECTION OF RELATED DATA.

THE DATA IS STORED IN TABLES


TABLES
HARRY POTTER EDITION

ACCESS TABLES
HARRY POTTER Access Tables are made up of fields. Each field is made up of
TRIVIA: properties. Several field properties include:
 Data Type – indicates what type of data the field will store
Example: short text, number, date, currency
What did Dumbledore
 Field Size – indicates how many characters can be stored in the
leave in his will for
field
Ron?
 Input Mask – allows the designer to state how the data will be
stored. This can be important for phone numbers.
 Display Control – determines if the data will be entered without
restrictions or if a user must choose from a list.

Most tables have 1 primary key. A primary key will ensure all rows of data will be unique in a table. A primary key
can be important in queries. It can help prevent duplicate rows of data.

Task to Complete:
Open the Harry Potter Database & open the Characters table in Design View. Click on the
ID field. Review the ID field properties
1. Primary Key – ID is the primary key for the Characters table. The table will assign a unique number for each
row. This is to ensure each row is unique. A primary key is not imperative for this table because each
character will have different names. The key icon to the left of ID indicates it is the primary key.
2. Data Type – ID is an autonumber. Access will automatically assign each row a unique number.
3. Field Size – Long Integer
4. New Values – Access will increment the ID by 1. A user will not have to enter the number.
5. Caption – This property allows the designer to decide the label that will appear on forms, queries, and
reports. This value is blank for ID so it will default to ID.
6. Indexed – This value defaulted to “Yes”.

Now click on FirstName field and see how the field properties are
different than the ID field.

PRIMARY KEYS IS A COLUMN (OR COMBINATION OF COLUMNS) DESIGNATED TO


UNIQUELY IDENTIFY ALL TABLE RECORDS
DATA
HARRY POTTER EDITION

ADDING DATA TO A TABLE


HARRY POTTER Data is normally inserted into a Table through a Form, but data can also be
TRIVIA QUOTE:
inserted directly to a table where the data is stored.

Who was the half-


blood prince?

Task to Complete:
1. Open the Harry Potter Database
2. Double Click on Characters table
3. If necessary, change the view to Datasheet View
 On the upper-left side of the screen, select “View”
 Select “Datasheet view”
4. In ID 15 type the following Data in the corresponding fields
 LastName: Weasley
 PureBlood: Yes

ID “14” IS MISSING. ACCESS WILL TRACK PREVIOUSLY USED NUMBERS EVEN


IF THE ROW HAS BEEN DELETED.
PROJECT 1 Tables & Data –

HARRY POTTER EDITION

TASK 1 OF 2 - ADD A FIELD TO THE HOUSE TABLE


Add the field OutstandingStudent to the House Table
1. Open House Table in Design View
2. Type OutstandingStudent in the row below StudentTraits
3. Determine the necessary properties for the field.

Total Points: 10
TASK 2 OF 2 – CREATE A TABLE
Create a table in the Harry Potter Database
Requirements:
1. Table should have at least4 fields (including a primary key)
2. 5 rows of data

You can create your own table or you can create the following table:
Fields:
1. ID (Primary Key - this can be an autonumber)
2. PatronusForm
3. NoteableCharacter (can you make this pull from the Characters Table? – not required)
4. Notes

Name the Table: Patronus

5 rows of data:
Row 1  ID: (Autonumber)
 PatronusForm: Phoenix
 NoteableCharacter: Albus Dumbledore
 Notes: loyalty of bird must be won
Row 2  ID: (Autonumber)
 PatronusForm: Otter
 NoteableCharacter: Hermione Granger
 Notes: The only spell Hermione has trouble with
Row 3  ID: (Autonumber)
 PatronusForm: Stag
 NoteableCharacter: Harry Potter
 Notes: Same patronus as his father
Row 4  ID: (Autonumber)
 PatronusForm: Hare
 NoteableCharacter: Luna Lovegood
 Notes: Used in Battle of Hogwarts
Row 5  ID: (Autonumber)
 PatronusForm: cat
 NoteableCharacter: Professor McGonagall
 Notes: Sent patronus for help when Hogwarts was under attack

A primary key is important for this table because there can be duplicate Patronus. For example, a
stag could belong to Harry Potter and his father.

Total Points: 20
FORMS
HARRY POTTER EDITION

ACCESS FORMS
HARRY POTTER Forms are not necessary in Access, but they are extremely helpful. Data can
TRIVIA QUOTE:
be added directly into a table where it is stored, but it is easier to enter data
into a form. A user can type the data into a form and the data will be stored
What is the name of in a table.
the Weasley that
works with dragons? Forms are a benefit of Access that Excel spreadsheets do not have.
PROJECT 2 - FORMS
HARRY POTTER EDITION

TASK 1 OF 2 - CREATE 5 FORMS


1. Create a form for Character Table. Name the form CharactersForm
2. Create a form for House Table. Name the form HouseForm
3. Create a form for Potions Table. Name the form PotionsForm
4. Create a form for Spells Table. Name the form SpellsForm
5. Create a form for Patronus Table. Name the form PatronusForm (or create a form for the
table you created)
Total Points: 15

TASK 2 OF 2 – ADD DATA IN A FORM


In Project 1 you added the OutstandingStudent field to the HouseTable.

For this task add the OutstandingStudent data using the HouseForm:
House: Gryffindor
OutstandingStudent: Harry Potter

House: Hufflepuff
OutstandingStudent: Cedric Diggory

House: Ravenclaw
OutstandingStudent: Luna Lovegood

House: Slytherin
OutstandingStudent: Draco Malfoy

(You can choose different Outstanding students)


Total Points: 10
QUERIES
HARRY POTTER EDITION

QUERIES
HARRY POTTER
TRIVIA: A query is a small copy of a table or tables. Queries “ask” table(s) specific
questions about the data.

What is the occupation


of Hermione's .
parents?

Task to Complete:
1. Open the Harry Potter Database
2. Double Click on the HouseNameQuery

Question: HouseNamesQuery only has 1 column of data. Any idea why or where this
query is being used?

Answer: This query is being used in the Characters Table in the House field. This field is a
combo box that restricts a user to only choose data from this query. Sometimes it is easier to
use a simple query than use a table.
PROJECT 3 - QUERIES
HARRY POTTER EDITION

TASK 1 OF 3 - CREATE PUREBLOODSQUERY QUERY


1. Create a query based on the Character Table WHERE ONLY Purebloods show.
2. Name the query PurebloodsQuery.
Total Points: 5

TASK 2 OF 3 - CREATE GRYFFINDORQUERY QUERY


1. Create a query based on the Character Table WHERE ONLY Gryffindor characters appear.
2. Name the query GryffindorQuery.
Total Points: 5

TASK 3 OF 3 - CREATE CHARACTERHOUSEQUERY QUERY


1. Before starting a new query, close all objects (tables, forms, queries, reports)
2. Click “Database Tools” tab
3. Click “Relationships”
 You will see one relationship. The relationship is between the Characters Table and the
House Table
 There is a relationship between these 2 tables because House appears on both Tables.
House can appear multiple times on the Characters Table and only 1 time on the House
Table. The House Table explains the House field in the Characters Table.
4. Now, time for the Query. Close the Relationship screen.
5. Create a new query using “Query Design”
6. Add Characters Table AND House Table (you will see the relationship)
7. From the Characters Table add the following fields to the query: FirstName, LastName,
House. From the House Table add StudentTraits.
8. Run the query
9. You have joined the 2 tables making Characters.House = House.House. You should have
11 rows of data.
10. Name the query CharacterHouseQuery.
Total Points: 20
REPORTS
HARRY POTTER EDITION

REPORTS
HARRY POTTER
TRIVIA: Reports are similar to forms. A form makes a table easier to
understand; a report just makes a query easier to understand.
What is the name of A report just formats a query so it looks nice.
the platform the
Hogwarts Express
leaves from? 
PROJECT 4 - REPORTS
HARRY POTTER EDITION

TASK 1 OF 3 - CREATE PUREBLOODSREPORT REPORT


1. Create a report based on PurebloodsQuery.
2. Name the report PurebloodsReport.
Total Points: 5

TASK 2 OF 3 - CREATE GRYFFINDORREPORT REPORT


1. Create a report based on GryffindorQuery.
2. Name the report GryffindorReport.
Total Points: 5

TASK 3 OF 3 - CREATE CHARACTERHOUSEREPORT REPORT


1. Create a report based on CharacterHouseQuery.
2. Name the report CharacterHouseReport.
Total Points: 5

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy