Presentation is loading. Please wait.

Presentation is loading. Please wait.

Application Software: Databases

Similar presentations


Presentation on theme: "Application Software: Databases"— Presentation transcript:

1 Application Software: Databases
CHAPTERS 15-16 Application Software: Databases

2 Databases A database is a collection of data
Database software helps you find, organize, update, and report information stored in a database

3 Database Concepts Database Management System Software is used to create, maintain, and access information in an electronic database. Common Database Management Systems Microsoft Access Borland dBase mySQL Oracle

4 Data Organization “Hierarchy”
Databases: a collection of files with the connections between them Files : Information dealing with different types of data are stored in different files (i.e. addresses, transcripts, and schedules) Records : Each instance in a file is called a record (i.e. all information about one student) Fields : Each part of a record is called a field (i.e. Zip Code for a student)

5

6 Database Terminology Field Record Table Database A database is made up
of one or more tables Field Record Table Database Individual fields A database consists of one or more tables. Each table consists of records which contain information about a single entity. An example of one complete record would be the name, author, isbn#, published date and publisher of textbooks. Each set of information regarding one book is considered to be one record. The name, author isbn#, published data and publisher in the above example are the individual fields that make up one record. Individual tables in a database Records 6 6

7 Tables in a Database Each DB file has a table structure for its records. The table structure is created first and given a table name as well as a set of fields.

8 Table Design Considerations
Just as you first create a blueprint to build a house, you should first sketch or outline the design of a database table Careful pre-planning will save you much time in the future Just as you first create a blueprint to build a house, you should first sketch or outline your table design. (Add: Careful pre-planning saves you much time in the future. There are many factors that affect both the design and structure of a database. 8

9 Tables in a Database Each Field in the table has…
name data type field width After the table structure is complete, data can be entered into the table’s fields. default values required? primary key?

10 Data Types for the Fields
Text alphanumeric, alpha, string – holds any character Numeric byte, short, long, integer floating point (decimal) , currencies Date Memo Logical (binary or boolean or yes/no) Hyperlink Object

11

12 Table Design Considerations – Field Size Property
Set field size in the Field Properties grid of Table Design View Set the field size property of individual fields in Table Design View. Once the field size is set, data entry in that field is limited to the length specified. In order to prepare for the future, always anticipate the current field size may one day need to be larger. Set the field size in Table Design View Always anticipate the current field size, may one day need to be larger 12

13 Data Validation Make sure the data in the computer matches the real-world information it represents Data Type Enforcement Default Values Ranges Required Fields Unique Keys Non-Null Keys

14 Data Validation Make a field numeric types ONLY when you plan to do arithmetic with the field and it makes sense to do it! Social security numbers, for example, should be TEXT not Long integers – you do not want someone to total them by accident, it would be meaningless

15 Table Design Consideration – Sarbanes Oxley Act (SOX)
Protects the general public and companies shareholders against fraudulent practices and accounting errors. Requires that all business records be saved for a period of five years and be made available to the SEC upon request This regulation protects the general public and companies shareholders against fraudulent practices and accounting errors. To summarize the act, it requires that all business records be saved for a period of five years and be made available to the SEC upon request. SOX RECORDS Do Not Discard 15

16 Table Design Considerations - PNPI
Short for Personal, Non-Public, Information PNPI laws govern the safeguarding of data such as: social security numbers credit card numbers Educational records (FERPA) bank account numbers medical records (HPAA) Short for personal, non-public, information, PNPI laws govern the safeguarding of data such as social security numbers, credit card numbers, bank account numbers and medical records. 16

17 Table Design Considerations – Store Data in its Smallest part
Like this Not like this For greater flexibility, store data in its smallest part. It is much more difficult to search for data when more than one piece of information is in one field. Examples include: instead of one field for a persons address, break the address into three fields – street address, city, state and zip. Instead of one field for a persons name, break the name into two or three fields – first, last and possibly middle initial. For greater flexibility, store data in its smallest part Instead of one field for an address, use many Instead of one field for a name, two or three 17

18 Table Design Consideration - Plan for Date Arithmetic
Fields declared as a data type of Date/Time Using a data type of date/time for all date fields allows the use of date arithmetic. An example of date arithmetic usage would be subtracting the shipping date from the order date of an item. The resulting number is the delay between the item being ordered and the item being shipped. Using a data type of date/time for all date fields allows the use of date arithmetic 18

19 Work with Table Views Design View Datasheet View When working with tables, two different table views exist. Datasheet View is used to add, modify, view, and delete records. You may also choose to enter field names in this view when you are first creating your table. The other view, Design View, does not allow record entry. It is used for entering field names and specifying properties of the fields, such as the size of the field. You may also edit existing fields, including those that were first created in Datasheet View. Datasheet (Table) View – used to add, modify, delete and view records Design View – used to create and modify the fields in a table 19 19

20 Work with Properties Field Size property Caption property Field Properties can be used to specify characteristics for individual fields. Field Properties can be found in the lower pane of the Table Design View. Field Properties can be used to specify characteristics for individual fields Located in the lower pane of Table Design View 20

21 Objects Tables Queries Reports Forms Macros Modules Objects
The elements of a database are referred to as objects. Access utilizes six different types of objects: tables, queries, reports, forms, modules, and macros. Of these six objects types, the only mandatory object is one table. All other objects may or may not be included in the database per the database users needs. Objects are located in the Navigation pane of the Access window. Objects 21 21

22 Reports Reports are created when a more formal printout is desired.
Use a wizard to create a report Executes one or more queries and presents the results in a more organized fashion Can sort the data, can do simple arithmetic (totals)

23 Queries Queries are questions used to retrieve information from a database. Contain criteria to specify the records and fields to be included in the query results. Can contain wild cards or logical operators to make more complex queries * and ? <, >, <=, >=, <>, =, AND, OR, etc… Named and saved so they can be run again at a later time.

24 Query Languages A query language such as SQL (Structured Query Language) provides a set of commands for locating and manipulating data LIST ALL FOR STATE = “KY” Not user friendly Query By Example is another query language Fill out a form that describes your query More friendly

25 Queries Queries allow us to ask questions about data
Dataset resulting from querying table for only employees who are Sales Representatives Employees table Queries allow us to ask specific questions about the data and receive a record set back that answers our questions. This returned record set is called a dataset. Simply running a query does not change the actual table data. However, you may alter the data in a dataset and the changes will be reflected in the underlying table. Queries allow us to ask questions about data This record set that answers our question is called a dataset 25

26 Using Query Design View
Tables pane Design pane Query Design view has two panes – the table pane and the design pane. Striking the F6 key will toggle you between panes. Query Design grid has two panes – the table pane and the design pane Striking the F6 key will toggle you between sections 26

27 Specifying Criteria in a Select Query
Fields in design grid allow us to specify criteria for the dataset Field row – displays the field name Sort row – enables you to sort the dataset Show row – controls whether or not you see a field in the dataset Criteria row – determines the records that will be selected for display Parts of the Design Grid include: Field Row – displays the field name Sort row – enables you to sort the dataset Show Row – controls whether or not you see a field in the dataset Criteria row – determines the records that will be selected for display 27

28 Specifying Criteria – Currency and Operands
Currency amount entered without dollar sign Greater than (>) operand Specify criteria with currency Without the dollar sign With or without the decimal point Use operands such as: Less than and greater than Equal to or not equal to Specify criteria with currency without the dollar sign and with or without the decimal point. Use operands such as less than, greater than, equal to or not equal to, in order to compare your criteria against data in the specified field. 28

29 Specifying Criteria – Wildcards
Query with question mark and asterisk wildcard and resulting dataset to specify criteria for the dataset Query with asterisk wildcard and resulting dataset The asterisk wildcard searches for a pattern that includes any number of characters in the position of the asterisk. The question mark searches for a pattern that includes a single character in the position of the question mark. Asterisk - searches for a pattern that includes any number of characters in the position of the asterisk Question mark - searches for a pattern that includes a single character in the position of the question mark 29

30 Specifying Criteria – And and Or
Or Criterion and resulting dataset And criterion and resulting dataset Use the OR criterion to find records that can match one or more conditions specified. Use the AND criterion to find records that must match all criteria specified. OR finds records that can match one or more conditions AND finds records that must match all criteria specified 30

31 Run a Query Run command Running, or executing, a query is done by clicking the Run command located by clicking the Design tab and accessing the Results group. Running, or executing, a query is done by clicking the Run command 31

32 Add a Total Row in a Query
The total row can be added to the design grid by clicking the Totals Icon Totals Icon The total row can be added to the design grid by clicking the Totals Icon. Total row added to the query

33 Calculated Queries Will find averages, max, min, sum, std
Work with ONE field – NOT more! Add Totals row to query Open “Group By” menu Choose appropriate function Run query

34 Sorting Records Can sort records in a database by field values
Single Field Sort Sort all students in the DB by home state Multi-Field Sort (Field A within Field B) Sort all students in the DB by home state then by alphabetical order of last name (Name within State) State is primary sort field, Name is secondary sort field Access sorts multiple fields left to right

35 Sorting Table Data Last Name field sorted descending Last Name field sorted ascending The Sort feature in Access, just like the other Office applications, allows you to lists records in ascending or descending order according to one or more fields. Lists records in ascending or descending order according to one or more fields 35 35

36 Concurrent Processing
Large databases allow more than one person to access a file at one time Have to be careful to control access - can lose data that way - who writes LAST? MS Access uses a .ldb file to control this .ldb file created when a mdb file is opened, says that it is "locked" so no one else can use it .ldb file goes away when mdb file is closed DO NOT submit it INSTEAD of your mdb!

37 Compact and Repair Compact and Repair is located under the Manage menu Fixes problems due to inefficient file storage and growth of a database Should be performed everyday Often decreases the file size by 50% or more Compact and Repair helps fix problems due to inefficient file storage and growth of a database. You should use the compact and repair command every time you work with a database. This process often decreases the file size by 50% or more. 37 37

38 Access or Excel? Use Excel when: Use Access when:
Your data is of a manageable data size There is no need for relationships between data You are primarily creating calculations and statistics You are working with large amounts of data You need to create relationships between your data Use Excel when: 1. Your data is of a manageable data size 2. There is no need for relationships between data 3. You are primarily creating calculations and statistics Use Access when: 1. You are working with large amounts of data 2. You need to create relationships between your data 3. You rely on external databases to analyze data 38 38

39 Understand Large Database Differences
Most large companies separate their database into front and back ends Front end – contains the objects needed to interact with data, but not the tables where the record values reside Back end – contains the tables where the data resides To ensure data integrity, to maintain security and to avoid mishaps, most large companies separate their database into front and back ends. Front end – contains the objects needed to interact with data, but not the tables where the record values reside. Back end – contains the tables where the data resides 39

40 Data Mining – a question for society
the process of extracting hidden patterns from data (from Wikipedia) Businesses and governments do it all the time (finding prospects, detecting terrorism) For Knowledge Discovery and Prediction Privacy concerns – identifying specific individuals


Download ppt "Application Software: Databases"

Similar presentations


Ads by Google