* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Introduction to Microsoft Access and Relational Databases
Survey
Document related concepts
Microsoft Access wikipedia , lookup
Oracle Database wikipedia , lookup
Open Database Connectivity wikipedia , lookup
Concurrency control wikipedia , lookup
Functional Database Model wikipedia , lookup
Microsoft Jet Database Engine wikipedia , lookup
Entity–attribute–value model wikipedia , lookup
Ingres (database) wikipedia , lookup
Extensible Storage Engine wikipedia , lookup
Clusterpoint wikipedia , lookup
ContactPoint wikipedia , lookup
Transcript
Introduction to Microsoft Access and Relational Databases A Database Management System (DBMS) is the software used to create databases. Microsoft Access is an example of a DBMS. A database is a collection of data organized into tables. The database we are creating is called Bavant Marine Services. Data tables are made of columns called fields and rows called records. Our database consists of two tables, the Marina table and the Technician table, but most databases will have many more tables. DBMS (MS Access) creates Databases (Bavant Marine Services) contain Tables (Marina) Customer Table records fields In addition to tables, databases can contain forms, reports, and queries, as well as many other objects. A form is used to view, edit, and enter data in the database tables. A report is used to display and print data from database tables. A query is used to answer questions about the data. Forms Databases Reports (view, edit, & enter data) (contain data in tables) (display & print data) Queries (use data to answer questions) A relational database uses primary keys and foreign keys to create relationships between tables. A primary key is a field that uniquely identifies a record. No two records will have the same primary key. In the Customer table, Cust ID is the primary key field. The table includes first name and last name fields. However, it is entirely possible that there could be two people with the same first and last name in the same database table. To eliminate confusion, it is necessary to have a field, like Cust ID in the Customer table, that uniquely identifies each record. A foreign key is data field that appears in one table but is also a primary key in another table. Foreign keys are used to establish relationships between tables. As mentioned before, the Cust ID field is a primary key in the Customer table. Cust ID also appears in the Order table, but not as a primary key. Rather than list customer name address and phone number fields again in the Order table, customers are identified by the Cust ID field. Customer Table Cust ID is a primary key in the Customer table. In the Order table Cust ID is a foreign key. Thus, a relationship exists between the tables. Order Table A relational database uses these relationships to eliminate or control redundancy. A redundancy occurs when the same data appears in more than one place in the database. To understand why redundancies should be controlled, imagine a database where customer information and orders exist in the same table. Since one customer could place many orders, that customer information would appear in several places in the Customer Order table. Customer Order Table redundant data This table illustrates three problems caused by redundancy: 1. Inconvenience: Entering the same data for multiple records is a waste of time. In the Customer Order table above, John Smith’s name, address, and phone number has to be entered each time John places an order. When customer information and order information were in separate tables, the personal information of each customer only had to be entered once and a Cust ID primary key could be used to associate customers with their orders. 2. Inefficiency: Redundancy is a waste of space as well as a waste of time. While the Customer table currently only has two redundancies right now, as more redundant data is entered, more storage space will be used to save the data table. The larger the database, the more space could be wasted if redundancies go uncontrolled. 3. Inconsistency: When the same data appears in more than one place, like the customer information for Jane Doe, database users may only update information in one location but not in another. Notice that Jane Doe’s name and address are different in the second and fourth records. When data inconsistencies exist, it may be hard to determine which record has the correct information. Database administrators try to design databases with as little redundancy as possible. The process of controlling redundancy is called normalization. Questions on MS Access and Relational Databases… 1. What is the difference between a DBMS and a database? 2. What are the rows and columns called in a database table? 3. The following picture is an example of what kind of database object? For what purpose is this object used? 4. The following picture is an example of what kind of database object? For what purpose is this object used? 5. The following picture is an example of what kind of database object? For what purpose is this object used? 6. What is the difference between a primary key and a foreign key? 7. How is a relationship established between two tables? 8. What is a redundancy? Why is it a problem? 9. What is normalization? 10. What could you do to eliminate redundancy in the following database table? What tables would you make? What would be your primary key and foreign key fields?