Database Fundamentals





The Following are Basic Facts about databases.


Database Terms
  • Attribute
  • Cardinality
  • Data Dictionary
  • DBMS Engine
  • Design Tools
  • Attribute's Domain
  • Entity
  • Entity Class
  • Father of Relational Databases
  • Foreign Key



  • Hierarchy of Data Elements
  • Meta Data
  • Overhead Data
  • Primary Key
  • Relation
  • Relational Database
  • Runtime Subsystem
  • Schema
  • Transactions
  • User Data

ATTRIBUTE
An attribute is another word for field. In spreadsheet language it would be a cell. It is a place in a database table to store one piece of data of a given type. For example an attribute designated to hold a last_name, could hold "Smith", but should not hold "Amy Smith".

CARDINALITY
Cardinality is a way to express minimum value and maximum value which are governed by the business rules. Cardinality refers to the required number of instances an entity must have in order to make the in a relationship in order for it to be valid. Minimum cardinality then for a one to many relationship would be one. Minimum cardinality for a basketball team would be 5, or you would be forced to forfeit the game. Maximum cardinality is the maximum number of entities which can occur in a relationship in order for it to be valid. In a one to one relationship the maximum cardinality would also be one. For a baseball team, during the normal season, the maximum cardinality would be 25 active players on the roster.

THE DATA DICTIONARY
A database is self describing. By this we mean it documents itself through table structure outputs. One of the components of the data dictionary is the table data type layout.

You can easily see how the fields are defined. The data types, lengths of the fields, and if they can be null or not. This is just one example of the data dictionary information provided by a DBMS.

THE DBMS ENGINE
This is a component of the DBMS (Database Management System) which is the intermediary between the design tools and run-time sub-systems and the data. The DBMS engine receives requests form the other two components, which is presented in column and row format, translates them into commands which are passed to the operating system in order to provide read and write functions to the disk.

THE DESIGN TOOLS
One of the three components of a DBMS. This subsystem provides the tools to assist users and programmers in creating and modifying components of the database. such components are, Tables, Queries, Reports, and User Forms. Many DBMS products provide a programming environment to create databases which perform very complex tasks.

Attribute's DOMAIN
The domain of an attribute is the range of data it can contain. This is not to say the attribute can contain the entire range at one time. An attributes contents must be atomic, meaning they must be of a single bit of information about the theme of the record. For example an attribute named "JOB_TITLE", from the EMPLOYEES table, could contain values from "Machine Operator", "Driver", "Foreman","Shift Manager", all the way up to "President". It can only hold one of these per record at a time. An attribute designated for "JOB_TITLE" cannot hold any other type data, such as Salary, or Date_Of_Hire. Can you imagine having to look for the Date_Of_Hire somewhere in a table, but having no specified place? You might as well be searching text files again.

ENTITY
A entity is something that someone wants to track. An employee for example. It is basically the subject for a table. You gather data about the employee, you run queries to find out information about them, track their time, vacation, sick days etc... Therefore, an entity is very much the same as a record in a table.relational databases was E.F. Codd, who worked for IBM at that time. He published a paper titled "A Relational Model of Data for Large Shared Databanks" in June of 1970.

ENTITY CLASS
A entity class is a collection of entities, as defined by their structure. There are usually many entities in an entity class, all of the same structure and type. In my mind, an entity class is the table which contains the entities.

Father of Relational Databases.
The father of

FOREIGN KEY
A foreign key is the same data field and type which is linked to a primary key in a corresponding table. For example in a transaction table The Customer_ID would be the Foreign Key field. The Foreign Key is used to look up the Customer_ID in the customer table where the Customer_ID is the primary key.

The Hierarchy of Data Elements in:
  • A file processing system

    1. Bits->Bytes or Characters->Fields->Records->Files
  • A Database system

    1. Bits->Bytes or Characters->Fields->Records->Files+Metadata + Indexes + App MetaData.
META DATA
Meta data is the data about data. In the above example concerning the DATA DICTIONARY. Is an example of meta data. It is the self describing part of a database. Information such as the table names, user names, data types, and field sizes are all meta data, describing the database.

OVERHEAD DATA
Overhead data is that which the system uses for itself. Indexes for example are overhead data. This is because the system uses indexes to speed searches, and to aid in joins. The overhead part comes in that this data also consumes processing time, and resources. Each time you update a table, the index must also be updated, which takes a bit of processing time but it also speeds up the search capability. You have to decide if the price in resources is worth the benefit of speed in creating and maintaining an index.

PRIMARY KEY
The primary key is that field, or fields, which by itself, or together uniquely identify each row in a table. The Primary Key is usually indexed, in some systems that is required. The primary key is normally the field or combined fields by which joins are linked. All data within each row or record should be dependent on the  entirety of the primary key. Primary Keys are used to normalize data tables.

A RELATION
This is a table which, as one of its attributes has a unique identifier for each of it's records, also known as a primary key. In most cases, the primary key is indexed to enhance performance of the system by speeding the lookup capabilities of the DBMS.

In the above example you can see the Product_ID is unique for each item. This entire table, with the unique field is called a relation.


A RELATIONAL DATABASE
Relational database we entails some forms of data relationship. It gets its name for it's relation to other tables within the database. A relational database is set up so that the a key is presented in two or more tables. In one table it will be the primary key, however, in the other table it will be the foreign key. Where the primary key matches the foreign key is where the relationship occurs. You may have a one to one relation where only one of each key members can be present in each table. You may also have a one to many relationship, where only one member can exist in one table but many occurrences can be present in the other table. An finally you can have a many to many relationship, where many occurrences can be present in both tables. Below is an example of a one to many relationship. There is only one occurrence of the Product_id in the products table, But many occurrences can exist in the transaction table.layout of the tables, attribute types and sizes, which fields are indexed, the relationships, domains, and business rules concerning a database. It is the design from which the database as well as its application programs were built. In a nutshell, the schema encompasses everything about the database.entire function. For example a sales transaction. You need the following.

THE RUNTIME SUBSYSTEM
This subsystem processes the application components that are developed using the design tools. For example Access has a runtime component that links data to forms, and reports. This is just part of the DBMS. The user or the developer need be concerned with how it works. When a given form is opened the runtime subsystem opens the required tables extracts the data and displays it to the user. There is also a component that facilitates the read and write requests for the applications.

SCHEMA
The SCHEMA is the design of the database, and why it was created. The schema is the



TRANSACTIONS
Transactions are a group of sql statements which work together to perform an
  1. A statement to add a record to the transaction table.
  2. A statement update the Inventory Table.
  3. A statement update the customer table. If necessary.
  4. A statement to commit the data.
One of two things MUST happen. All of these statements must work together to accomplish their goal, or none of the statements work. That is the key to transaction processing, all or nothing. Log files are kept by the system to record what has been accomplished so, in the event something goes wrong, we know where to start. This is a way of maintaining the integrity of our data.

USER DATA
User data is just as the name implies. User data is the data which the user enters into the database tables.

0 comments: