* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Slide 1
Concurrency control wikipedia , lookup
Microsoft SQL Server wikipedia , lookup
Open Database Connectivity wikipedia , lookup
Microsoft Jet Database Engine wikipedia , lookup
Entity–attribute–value model wikipedia , lookup
Functional Database Model wikipedia , lookup
Clusterpoint wikipedia , lookup
Extensible Storage Engine wikipedia , lookup
So What’s Access? It’s a Database So What’s a Database? Original Slides Courtesy of Prentice-Hall, 2008 Edited by Jack Fassel, 2008 1 Topics • • • • • • Databases and their uses Database components Types of databases Database management systems Relational databases Information systems 2 Access (a Database) • Access let’s you: – Store data – Sort data – Organize data – Query (question, what-if) data • Why not just use a list or lists? – it all sounds like Excel – Complex information – More than one person access 3 Databases Solve • Data Redundancy (storing the same data more than once) • Data Inconsistency (is the column a zip code? Then make sure it’s a zip code not some guy’s name) • Incomplete Data (970 is not a valid zip – 97030 is) 4 Databases • Electronic collections of related data • Help us organize data • Turn data into information 5 Advantages of Using Databases • Store and retrieve large quantities of information • Enable information sharing • Provide data centralization • Promote data integrity • Allow for flexible use of data Financial Aid Recording grades Student Registration Student Information Student housing Database Parents 6 Database Terminology • Field Field Name – Category of information displayed in columns – Each field has a field name 7 Database Terminology • Data types – – – – – – – Text Numeric Computational Date Memo Object Hyperlink 8 Database Terminology • Record – A group of related fields Record 9 Database Terminology • Table – A group of related records Table 10 Database Terminology • Primary key – A field value unique to a record Primary Key 11 Database Types • Relational databases – Organize data in a table – Link tables to each other through their primary keys • Object-oriented databases (they exist; but we don’t care for now) • Multidimensional databases (they exist; but we don’t care for now) 12 Database Management Systems (DBMS) including Access • • Application software designed to capture and analyze data Four main operations of a DBMS are: 1. 2. 3. 4. Creating databases and entering data Viewing and sorting data Extracting data Outputting data 13 1. Creating Databases and Entering Data • Create field names: – Identify each type of data – Data dictionary – View scene from within “design view” 14 Creating Databases and Entering Data (cont) • Create individual records: – Key-in – Import 15 Data Validation: So like data gets into each column (i.e. SSN can’t have a name entry) • Validation – Process of ensuring data entered into the database is correct (or at least reasonable) and complete • Validation rules – – – – Range check Completeness check Consistency check Alphabetic/numeric checks 16 2. Viewing and Sorting Data Before sort • Browse through records • Sort records by field name • ALL data in tables still there After sort 17 3. Extracting or Querying Data • Query “Slicing/Dicing” – A question or inquiry – Provides records based on criteria – Structured query language (SQL) occurs “behind” the scene -- Table contents “is” SLICED to a subset of the original contents (if query “saved”) SQL 18 4. Outputting Data • Reports: – Printed (i.e. mailing labels) – Summary data reports • Export data 19 Relational Database Operations • Relational databases organize data into tables based on logical groupings • Relationships are links between tables with related data – MANDATORY! • Common fields between tables need to exist • Normalization of data (recording data once) reduces data redundancy 20 So let’s get started • Start Access 2007 and you should get something that looks like the screen on the next slide 21 The opening screen 22 The opening screen on the previous slide -Contains a number of templates (we’re not using) but the Office button in the upper left hand corner is still the same Click on it to “open” an existing database 23 A database has just been opened; notice the Security Warning which requires you to click the “options” button to “enable”; also notice that this database has two tables 24 Double click a table name to open table (“Departments” was opened below which contains 5 columns (or fields) and 12 rows (or records)) From this view you can add, delete rows, move from row to row or column to column, even add/delete 25 SORT: Like Excel, you can SORT ALL the rows. The table below is sorted by the last_name column by: Click column title, then, Home_tab, Sort_Filter_Group, A_Z button 26 FILTERS “Hide” portions of the table (the information is still there – just “hidden”) To FILTER: Click the column title you want to filter (example below is on dept code), home_tab, sort_filter_group, click the filter “funnel”, dialog box appears) 27 Example below checks ONLY the CIT value of the column 28 Example below shows the filtered CIT data resulting in 4 rows displayed. Notice that the “Toggle Filter” button is in orange in the Sort_Filter group. Filters are ONLY for temporary “viewing”; don’t save! 29 QUERIES are “questions” about the table. Assume you had 3 million records of members and their addresses, but you only wanted to know those that lived in zip code 97030 so that you could printout out mailing labels. You could print all 3 million labels and hand-sort/pull just those in zip code 97030 – which would be a complete waste of time/resources OR, you could “slice” the original table to “create” a table containing ONLY those in zip code 97030. To “slice” the table, use a Query. The Query can specify any number of criteria to get the resulting sub-table needed AND saving the Query by name allows you to use the same query over and over again even though the contents of the table changes with time. 30 To CREATE a QUERY using the DESIGN VIEW, Select the “Create” tab from the ribbon, and click “Query Design” from within the “Other” group (as seen below) 31 You can select one or all tables. The example below selected the departments table by highlighting and clicking the “add” button 32 Below shows the Design view query screen after the “add” button is clicked followed by the “close”. Notice that you see the “Departments” shown with all it’s column headings and that the “dept code” column has a “key” next to it – the primary key, which states that all column entries must be unique. 33 We want to know/show, from the original “Departments” table the following: - Dept Name - Dept Chair - Division - of ONLY those Divisions that are “Arts & Sciences” Instead of 5 columns, the query will result in 3 columns. Instead of 12 rows, the query will result in ONLY those rows containing “Arts & Sciences” (counting them from the original “Departments” table, there should be 3 rows) 34 To get started, notice the down arrow in the lower portion of the screen, in the first column/first row, the “field” row 35 By clicking that arrow, a menu appears containing all the “departments” table column names 36 Since the first column desired is “dept name”, a click from the menu results in selecting that column. Notice also in the Table listing, the table shown is “departments” If there was more table in the query, each tables name would be listed by column 37 The next column to be shown is Dept Chair, selected the same way but in the 2nd column 38 The third and last column in the query is the Division column – notice the check marks – all three columns will be displayed when the query is run. 39 To specify ONLY the “Arts & Science” be shown, the “criteria” for that column is entered as shown below. The column name must be in single quotes 40 So how do you run the query? Look at the upper left corner below the ribbon. There’s a RED Exclamation point 41 The query has run. The results are display (as expected) 42 To save the query, click the “X” on the query and the dialog box appears. Select “Yes” 43 Give the query a name (otherwise Access will call it Query 1), then click “ok” 44 Called the query “Arts & Sciences” 45 The query is saved and can be retrieved, like any other object, from the list at the left. Any object can be selected and viewed 46 Under the “queries” objects, two queries are shown. The Arts & Sciences is the query just created. Double click the name to ‘view’ it 47 Query viewed 48 To close Access, select the Office Button in the upper/left most area 49