You are on page 1of 3

Chapter 5 Database Processing Organizations use databases to organize and keep track of their collection of data records.

. With database technology, users can easily keep track of data with multiple themes. A database is a collection of tables, relationships and metadata. In database: characters or bytes are group into columns or fields (ex. Customer ID, Customer Name) columns or fields are group into rows or records (ex. rows or records are group into tables or files (ex. Customer table)

Users set primary key to a column with unique attribute (such as SSN or unique customer ID) in a table to help identify each unique row or record. For instance, each customer in the above table has a unique customer ID, so Customer ID could be set as the primary key and used to identify each individual customer. A primary key in one table can become a foreign key in another table. Foreign keys are used to represent relationship among the rows in the tables.

The primary key for the Customer Purchase Table is the Purchase ID, and the foreign key is the Customer ID. From this, we know that customer 01 (Amble Adams) made two purchases (Purchase ID A1 and A3) in February. Metadata are special data that describe data. For instance, metadata for any column in a table will include: Field name name of the column (ex. Purchase Date) Data type type of data the column may hold, it can be text, auto number, date, number, currency, etc (ex. Data type for Purchase Date in the Customer Purchase Table is date) Description explains the source or use of the column (ex. Date the customer make the purchase) Database management system (DBMS) is a program used to create, process, and administer a database. Some popular DBMS are DB2, Access, SQL Server, Oracle and MySQL. Structured Query Language (SQL) is an international standard language for processing a database.

Database application is a collection of forms, reports, queries, and application programs that process a database. Form use to read, insert, modify, and delete data Report show data in a structured and meaningful context Query request information from the database Database developers need to create a data model, which is a representation of the database data before they can start designing the database. A data model can be constructed using the entityrelationship (E-R) model. An entity is something the users want to track; it can represent a physical object (Customer) or a logical construct or transaction (Cash receivable). Each entity has a set of attributes that describe the characteristic of the entity. For instance, attributes for Customer includes CustomerName, CustomerPhoneNumber, CustomerAddress, etc. Attribute(s) that can be used to uniquely identify an entity instance is called an identifier. CustomerID would be an example of an identifier for the entity Customer. Relationships among entities can be illustrated using entity-relationship (E-R) diagrams. Below is an example of an E-R diagram using crows foot notation.

Cardinality is used to shows the relationship between two entities (Table A & Table B): One-to-one relationships (1:1) A record (entity instance) in Table A can only relate to at most one record in Table B, and a record in Table B can only relate to at most one record in Table A One-to-many relationships (1:N) A record in Table A can relate to any number of records in Table B, but a record in Table B can only relate to at most one record in Table A Many-to-many relationships (N:M) A record in Table A can relate to any number of records in Table B, and a record in Table B can relate to any number of records in Table A Maximum cardinality represents the maximum number of entities (records) can be involved in a relationship. Minimum cardinality represents the minimum number of entities must be involved in a relationship. After an entity-relationship data model is complete, database developers then convert the data model into a relational database design. Each entity is represented by a table Each attribute of an entity becomes a column of the table The identifier of the entity becomes the primary key of the table

Relationships between entities (now tables) are express using foreign keys A poorly-structured table can lead to data integrity (data validity) problem, which will results in inconsistent and incorrect data output. A poorly-structured table can be converted into two or more well-structured tables through the process called normalization. Each normalized table can only has one theme.

Customer CustomerID CustomerName Address City State

Purchase PurchaseID PurchaseDate Amount

You might also like