cis 145 test 1 review
DESCRIPTION
AcceTRANSCRIPT
04/12/2023 1
CIS-145Test 1 Review
04/12/2023 2
DatabaseCollection of related data and tools to use,
manage dataRelational database
Data stored in tablesEach table stores data about one thingCommon values create connections
(relationships) between tables
04/12/2023 3
Fields, Records, and TablesFields
Basic unit of data represented by a column in a table datasheet
RecordsGroup of related fields or all fields related to a
specific item: person, place, or thing Each row of a datasheet represent a record
TablesGroup of related records
04/12/2023 4
Planning a DatabaseWhat information do you want to obtain? What data elements (fields) must you include to be
able to get the information?What types of data will you enter into each field?
Dates, numeric values, amounts of money, text, etc.What fields of data relate to the same basic items and
belong grouped together? How do the groups of data relate to each other? What questions will you need the database to be able
to answer? What is the most efficient way to get data into the
database tables?
04/12/2023 5
Creating Tables Each table should contain fields that focus on
data specific to one type of itemSuch as customers, employees, inventory, etc.
Each table should have a primary key Fields in the primary key cannot be empty
(null)May be one or more fields
Each generic field# heading is replaced with a descriptive field name
04/12/2023 6
Table Design GuidelinesStore all necessary dataStore data in smallest partsAvoid calculations
04/12/2023 7
Using Table Design ViewPresents a blank work area on which to
enter fieldsProvides tools for setting data types,
descriptions, and propertiesEnables you to change the structure
and organization of fields in the table
04/12/2023 8
Entering Field NamesField names:
Short but descriptiveCan contain alpha-numeric charactersCan contain many symbolsCan contain spacesMust start with a character or symbol
May use naming conventionIdentify table, data type, and field description
04/12/2023 9
Identifying Data TypesData types identify the kind of data to be
added to a fieldTextNumbersDates/TimesCurrency
Setting a data type controls values that the field contains
04/12/2023 10
AutoNumber FieldsFields that automatically number records as
you add them to a tableNumbers can’t be entered or changed by
userIf you delete a record from a table, or cancel
a new row, Access never assigns the number to any new record
04/12/2023 11
Field PropertiesField Size determines how much data can be
storedSome data type sizes are fixed – date/time,
yes/noFormat controls how a value is displayedInput Mask controls which keyboard entries
will be required and acceptedValidation Rule sets limits on values that a
field will acceptValidation Rule applies regardless of how data
is entered or changedSet Validation Text to explain how to correct an
entry
04/12/2023 12
OperatorsOperators are used in validation, calculations
and queriesComparison Operators:
Relational Operators (=, >, <, <>, >=, <=)Patterns (Like)Compare to a list (In)
Logical operators define how to tie tests togetherAnd, Or, Not
04/12/2023 13
Using WildcardsUsed in patterns instead of specific
charactersPrimary wildcards used:
* Represents any number of characters? Represents an individual character
Examples:*Graham* locates all records with graham within
the textGra?am locates all records with gra at the
beginning of the field value and am at the end of the field value with only one letter between
04/12/2023 14
Relational DatabasesHave more than one table where tables are
related to each otherOne to oneOne to manyMany to many
A combination of fields may be used for the table’s primary key
One to Many RelationshipsEach table contains data about a specific
subject (customers, loans)Each table on the ‘one’ side has a primary
keyPrimary key of the “one” table is a foreign
key in the many table
Many to Many RelationshipsTwo tables are related, but can have many
records in each table in commonOne student can attend many courses; one
course can be attended by many studentsImplement a many to many relationship by
creating a pair of one to many relationships with a third tableThird table is often referred to as a “join” or
“junction” tableEntries in the join table point to rows in the
original tables
Foreign KeyA foreign key points to a record in another
tableForeign key “looks like” the related primary
keySame number of fieldsData types for each field must matchField names don’t matter
Referential IntegrityMakes sure that the records in related tables
are consistentMust have a customer in the customer table for
an order assigned to that customerAvoids “orphans”
Cannot delete a record or change the primary key in the one table when associated records are in the many table, unless have cascade delete and cascade update enabled
Editing DataMaking new entries, changing existing
entries, and deleting rows are all affected by referential integrityA customer can be added at any timeMust have a customer before a loan can be
entered and associated with a customer Referential integrity doesn’t require entry into a
foreign keyCan delete a loan at any time, but can only
delete a customer if they don’t have any loans (assuming no cascade delete)
Cascading ChangesWhen referential integrity is enforced can
choose to include Cascade Update and/or Cascade DeleteCascade update passes changes to the primary
key of the “one” table to the related rows in the “many” table
Cascade delete removes rows from the “many” table when a primary key (row) is deleted from the “one” table
Relationships WindowWhere relationships between tables are
created and definedRelated fields must have the same data type
Autonumber is related to number field with long integer field size
The one table has a 1 next to it; the many has
a next to it
Autolookup QueriesUse queries to automatically look up data
from related tablesMust contain the foreign key from the many
tableCan add, change or delete data in the source
tables