What is a database?
Many of the terms used in databases have been taken from the traditional filing system. In a traditional filing system, data was stored in files e.g. payroll file, customer file etc. Each of these files contains a number of records; the customer file would contain a record for each customer. Each record contained a number of fields to store data such as Name, Address and Telephone number.
Modern database systems are a collection of tables, which are linked via relationships. Each table is made up of fields that define the type of data that you want to store in the table. Each table contains data held in records; a table can have zero records up to millions of records. The database is stored on computer media using a filing system.
Tables - Tables are set up to store data on a particular type of data. For instance you might have a table containing customer details, a table containing stock and so on.
Fields - Each table contains a number of fields that define the type of data that the table will hold. The main types of data are numeric and text, but modern databases usually have a large list of more defined data types. For instance instead of numeric you can set the data type as currency and so on. You can limit the size of these fields, which helps to keep the overall size of the database to a minimum.
Records - Each table will contain a number of records. These records contain the actual data. For instance a stock table would have a separate record for every item of stock. These records can be altered, deleted and added to.
Key Fields
A key field unambiguously identifies an incident of a record. associate example of this could be a client reference variety in an exceedingly client table. Since no 2 clients ought to have a similar customer reference variety, this field will be referred to as a straightforward key.
A compound key is formed when you need to combine two or more fields in a table to uniquely identify individual records. Sometimes no one field can uniquely identify every record, but combining two gives a unique reference. For example in a stock system it is not impossible that two different suppliers may use the same product code for different products. Combining the product code with the supplier reference number could then be used to give a compound key. In a compound key, the fields, which make up the compound key, are usually also simple keys in there own right in other tables. If one of the fields that make up the key is not a simple key, the combination of fields is usually called a composite key rather than a compound key.
In database systems such as MS Access, fields can be set as Primary Keys. A primary key must be the simple key field of a table and MS Access will enforce this. In MS Access this then enforces the uniqueness of the Primary Key field and will not allow duplicates fields to be entered. As well as this the table is automatically indexed on the Primary Key in Access, which is needed to allow the system to quickly check whether an entry is unique or not, before validating it or blocking it. The table can also be ordered on the Primary Key field by using this index.
Multimedia Databases
A multimedia database is simply a database that contains multimedia. Normally data types are mainly textual or numeric, but in a multimedia database, actual multimedia can be stored in a field in table.
The most common example of this would be storing pictures in a database. A good example would be a club membership database, which holds scanned pictures of its members. Pictures of club members could then come up on the screen when staff look up a certain members in the database, perhaps to confirm their identity.
Although this is the most common thing to do with a multimedia database, a multimedia database can consist of sound files & video clips as well as images.
If you store multimedia in a database, the size of it can grow very quickly, as storing a simple picture in a database takes up far more space than storing hundreds of names & addresses. An alternative to this approach is to just store the full path & filename of the picture. This keeps the database size small, but means that if someone deletes, moves or renames one of the pictures that are linked to, then that picture will be lost from the database.
|
|
|
|
Queries
Queries allow you to search, view, alter and analyse data in many different ways. Queries can also be used as a method of producing a table of records from one or more related tables, which can then be turned into a report.
Queries are mostly used as a method of searching or selecting records, which match a certain criteria. When you process a query, it searches through a table or a related set of tables for records that match your criteria. Matching records are pulled out into a new table, often however only certain fields are pulled out from the tables that are being searched.
The results of a query can also be set so that they come out ordered on one of the fields. It may be that you want an alphabetically list of stock or your customers.
In the example shown, we use a query to show selected fields from a product list table. The criteria states that we only show non-discontinued stock and stock with less than 5 items in stock. This may be used to see what stock is running out and may need re-ordered soon.
A compound key is formed when you need to combine two or more fields in a table to uniquely identify individual records. Sometimes no one field can uniquely identify every record, but combining two gives a unique reference. For example in a stock system it is not impossible that two different suppliers may use the same product code for different products. Combining the product code with the supplier reference number could then be used to give a compound key. In a compound key, the fields, which make up the compound key, are usually also simple keys in there own right in other tables. If one of the fields that make up the key is not a simple key, the combination of fields is usually called a composite key rather than a compound key.
In database systems such as MS Access, fields can be set as Primary Keys. A primary key must be the simple key field of a table and MS Access will enforce this. In MS Access this then enforces the uniqueness of the Primary Key field and will not allow duplicates fields to be entered. As well as this the table is automatically indexed on the Primary Key in Access, which is needed to allow the system to quickly check whether an entry is unique or not, before validating it or blocking it. The table can also be ordered on the Primary Key field by using this index.
|
|
Data Duplication
One major advantage of a database system is the reduction in duplicated data. Before databases, organisations often held many copies of the same data in different departments, due to certain files being needed by more than one department.
For instance a record of a customer's details may be held in the sales department, a record may also be held of the same customer in the delivery department.
The main problem with this is that it can lead to inconsistent data. As one department updates & maintains data, but may not pass these updates onto the rest of the organisation. A customer could move premises and the change of address may only be reflected in the records held in one of the departments.
Obviously keeping duplicates of data increases the storage space required & makes it difficult to keep the data secure if it is sensitive information, as the information is held at more than on location. Maintenance of this data also becomes near impossible, as any changes to it must be done across the board.
Referential Integrity
Referential integrity is a system of rules that ensures that relationships between records in related tables are valid, and that you don't accidentally delete or change related data.
It ensures that you cannot enter a value in the foreign key field of a related that that doesn't exist in the primary key of the table it is related to.
In a one to many relationship, you cannot delete a record from the table on the one side of the relationship if a matching record exists in the related table. You also can't change the value of the key field in the table if it has matching records in the related table.
Authentication
Database Authentication is to do with using digital signatures so that the identity of the maintainer of the database can be proved. Various methods of digital signing a database exist such as using PGP public key authentication.
Transactions
A series of processing steps that results in a specific function or activity being completed, ensuring that a set of actions is treated as a single unit of work.
It is important to flush transactions carried out on a database that is being held in memory onto the file system. Databases are sometimes held in memory to allow work to be carried out on them at a faster speed. Sometimes databases are not saved to hard drive until the user exits from the system. This could mean lose of data if the computer crashes before the user exits & saves.
Many databases can be set however to automatically save the databases to the hard drive from memory, without waiting for the user to hit save.
Recovery of Data
As with any computer system, backups of data in a database are vital. Daily, weekly or even monthly backups should be performed, depended on the importance of the data. Database's can be relatively small, unless multimedia elements have been stored in the database.
Tape Units, Floppy Disk, Zip Disk & CD-RW (CD Rewriters) are all hardware devices on which databases can be backed up onto. It really depends on the size & importance of the database. CD-RW is probably the most reliable of the formats. It is also the fastest and with the exception of tape units, can hold the most data. A CD-RW can hold approx. 650Mb, while a Floppy Disk can hold only 1.44Mb and a Zip Disk can hold either 100Mb or 200Mb. Tape Units can hold an incredible amount of data (20Gb to 80Gb), but are very slow.
|
|
|
No comments:
Post a Comment