Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
ЭКЗ1-17.doc
Скачиваний:
2
Добавлен:
16.04.2019
Размер:
122.37 Кб
Скачать

8.Ms Access 2007 as a relational dbms. Differences between Access and Excel.

MS Access is a relational database.

Tables are the fundamental objects at the heart of a relational database. They form the active basis for the information storage and retrieval system.

Once the information is arranged in separate tables, you can view, add, edit and delete information with online forms, search for and retrieve some of or all the information with queries; and print information as customized reports.

In Access the term database is more precisely used to define the collection of objects that store, track, manipulate, and retrieve data.

Differences between Access и Excel in storing data 1. Working with Excel you enter any information in a cell such as a text, a table a figure. So, in one column there may be data of different types – numbers, texts, dates, if necessary. Access table differs from Excel spreadsheet: you can’t have data of different types in one column. 2. Access allows not only enter data in tables but also control them by setting specific rules at the table level. So, it won’t let you save data that don’t meet required rules.

3. Excel is convenient to work with if a table contains a limited number of rows. Database tables may contain a huge number of records. Database management system offers effective tools to retrieve necessary information. 4. If you store all necessary information in Word documents and Excel spreadsheets, then while accumulating it you can meet the problem of dealing with a great number of files. Access allows you to store all data in one file and have access to the page by page, that is not exceeding limitations on computer resources.

5. Access allows to relate tables and, therefore, use data from different tables. For users it will be the same as working with one table. Implementing this mode in Excel is very complicated, sometimes impossible. 6. Setting relations with different tables Access allows to avoid duplicate data, save computer memory and increase speed and accuracy of processing.

7. Excel allows for several users to work with one and the same spreadsheet, but this possibility is limited. Access may support simultaneous work of up to 50 users guaranteeing that each of them will work with actual data. 8. Access has a well-developed system protecting from unauthorized access. If offers tools that allow a user or a group of users to see and change only “their” objects. Excel allows to protect data setting passwords but this tool is significantly less complex.

9.Types of relationships.

Tables can be related in three different ways:

  • one-to-one,

        • one-to-many

        • many-to-many.

The type you define depends on how many records in each table are likely to have the same value.

To relate tables, one of them must include a field that contains a unique value in every record. This can be a primary key field or a field with a unique index that allows no duplicate values.

A primary key or a unique index can also be a combination of two or more fields whose combined value is unique for all records.

For example, the Employee ID can be a unique number that identifies an employee. If you want to use names in a key or index, you’d probably need to include both the first and last names to ensure unique values.

The most commonly used type of relationship is the one-to-many relationship, in which one record in one table can have one or many matching records in another table, or maybe none at all. The table on “one” side is often called the parent table and the other is called the child table.

The one-to-one relationship is sometimes used as a form of lookup, in which each record in one of the tables has a matching record in the other table. Neither table is designated as the parent. The key fields in both tables are the primary keys. One use of this type of relationship is to store additional, seldom-accessed information about an item in the first table, such as an abstract of a book or the details of a work order.

10.Referential integrity. The basic rule of referential integrity.

Referential integrity is an optional system of rules that guarantees the relationships are valid and the database will remain intact as data is entered, edited, or deleted.

  • The basic rule of referential integrity is this:

For every record in a child table (the “many” side), one and only one matching record must be in the parent table (the “one” side).

Rules:

  • You cannot enter a child record for which no parent exists (start a work order without a customer).

  • You cannot delete a parent record if related child records still exist (remove a customer before the job is completed).

  • You cannot change a child record so its foreign key does not have a match in the parent table (change the customer field in a work order record to a nonexistent customer).

  • You cannot change the primary key value in a parent table as long as related records are in the child table (change a customer link before the work order is finished).

Before you can set referential integrity, you must make sure you meet the following conditions:

  • The matching field in the parent table is the primary key or at least has a unique value, such as AutoNumber field.

  • Related fields are the same data type.

  • Both tables are in the same Access database. You can set referential integrity between linked tables, provided they are both in Access format and you open the database that contains the linked tables.

  • The same rules can apply to a one-to-one relationship. Enforcing the referential integrity rules in such a relationship guarantees that every record in the table has one and only one matching record in the other table.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]