Presentation on theme: "UNIVERSITY OF PALESTINE business computer application College of Business Instructor: Mr. Ahmed Abumosameh."— Presentation transcript:
UNIVERSITY OF PALESTINE business computer application College of Business Instructor: Mr. Ahmed Abumosameh
Database Lecture 8
Databases A database is a structured collection of data. Simple example is a standard telephone directory or library card index. Electronic databases can store all sorts of information, from phone numbers to music, videos and images. Allow quick searching and are good for keeping historical data, for example weather history.
Electronic Databases Electronic databases are generally managed using a program, such as MySQL or Access. These programs are often called databases, but are more accurately referred to as database management systems or DBMS. Integral to the design, development and services offered by websites.
A relational database is a collection of tables from which data can be accessed in many different ways without having to reorganize the database tables. DON’T DUPLICATE DATA That is, once relationships are created, tables can “talk” to each other. We can link (relate) the tables to find: Which schools are in a system? Which students are in which class? Which classes are filling up? what is a Relational Database Management System (RDMS)?
Entities and Attributes Entities - are specific objects or things in the mini-world that are represented in the database; for example, the EMPLOYEE John Smith, the Research DEPARTMENT, the ProductX PROJECT Attributes are properties used to describe an entity; for example, an EMPLOYEE entity may have a Name, SSN, Address, Sex, BirthDate A specific entity will have a value for each of its attributes; for example, a specific employee entity may have Name=‘John Smith’, SSN=‘ ’, Address=‘731 Fondren, Houston, TX’, Sex=‘M’, BirthDate=‘09-JAN-55’
Table “A table is the primary unit of physical storage for data in a database.” 1 Usually a database contains more than one table.
A Database with Multiple Tables PublishersBooksCustomers AuthorsInventoryOrders 
Field (Column) a field Customers
Record (Row) a record Customers
Primary Key primary key field Customers Primary key is a unique identifier of records in a table. Primary key values may be generated manually or automatically.
Foreign Key foreign key field primary key field parent table Directors Movies child tablerelationship When tables relate, the primary key of one table becomes a foreign key of the other table
One-to-One Only one matching record between two tables This relationship is the least common because it is not a very efficient use of tables
One-to-Many Most common type of relationship One record in Table A links to multiple records in Table B For example: A list of suppliers for the music store is contained in Table A. It is linked by the supplier ID field to Table B which contains all of the products used by the music store. When Table B is searched for a specific product (record), such as a CD carrying case, the manager can view the supplier’s contact information, which is stored in Table A.
Many-to-Many Multiple records in Table A are linked to multiple records in Table B For example: In the music store database, Table A contains customer information and Table B contains CD inventory. A record for Bob from Table A may be linked to several records of CDs in Table B by linking the Customer ID fields. If Table B contains the CD inventory, a record for a particular CD can be linked to several customers in Table A.
Queries A means of asking questions (querying) of your data Can look across a number of Tables and other Queries Can perform Calculations and Combine fields
Forms A friendlier view of the database Used for data input, menus, display and printing Can perform Calculations and Combine fields
Reports Output of information in a printed report Allows you to group and summarize data Can perform Calculations and Combine fields Cannot Edit Data Can Make Labels
Working Together Employees Customers Tables Queries Customer Company Name Address City Telephone Contact Name Forms Reports
Design and Document Your Database A designers best tools are a pencil and paper It is important to plan what you are going to do The sooner you touch the computer the sooner you’ll make a mistake If you don’t plan you will often have to start again Document what you are doing, will you remember what you did in three months time?
Questions To Ask Yourself What have I got? (Inputs) What do I want? (Outputs) What do I need to do to get there? (Process) How am I going to build it? (Application/Program)
Why Use Access? Familiar look and feel of Windows Easy to start building simple databases Can build sophisticated systems It’s already on your computer True relational database