Unit 5.1 The Database Concept



Similar documents
Chapter 6: Physical Database Design and Performance. Database Development Process. Physical Design Process. Physical Database Design

Files. Files. Files. Files. Files. File Organisation. What s it all about? What s in a file?

Unit Storage Structures 1. Storage Structures. Unit 4.3

Database Database Management System (DBMS)

Chapter 5. Microsoft Access


MS Access Lab 2. Topic: Tables

14 Databases. Source: Foundations of Computer Science Cengage Learning. Objectives After studying this chapter, the student should be able to:

7. Databases and Database Management Systems

Course: CSC 222 Database Design and Management I (3 credits Compulsory)

Databases in Engineering / Lab-1 (MS-Access/SQL)

MS SQL Performance (Tuning) Best Practices:

Introduction to Computing. Lectured by: Dr. Pham Tran Vu

AQA GCSE in Computer Science Computer Science Microsoft IT Academy Mapping

MS Access. Microsoft Access is a relational database management system for windows. Using this package, following tasks can be performed.

A Brief Introduction to MySQL

ICOM 6005 Database Management Systems Design. Dr. Manuel Rodríguez Martínez Electrical and Computer Engineering Department Lecture 2 August 23, 2001

Physical Data Organization

C omputer D riving L icence

Oracle Database 12c: Introduction to SQL Ed 1.1

SPECIMEN A451 GENERAL CERTIFICATE OF SECONDARY EDUCATION COMPUTING. Duration: 1 hour 30 minutes. Unit A451: Computer systems and programming

Database Fundamentals

Microsoft Access XP Session 1 Week 8

Intro to Databases. ACM Webmonkeys 2011

MICRO-COMPUTER BASED REAL ESTATE DECISION MAKING AND INFORMATION MANAGEMENT - AN INTEGRATED APPROACH

2) What is the structure of an organization? Explain how IT support at different organizational levels.

Data Hierarchy. Traditional File based Approach. Hierarchy of Data for a Computer-Based File

Oracle Database 10g: Introduction to SQL

IT2305 Database Systems I (Compulsory)

Physical Database Design Process. Physical Database Design Process. Major Inputs to Physical Database. Components of Physical Database Design

Microsoft Access 2007

Database Concepts. Database & Database Management System. Application examples. Application examples

Symbol Tables. Introduction

Introduction to Microsoft Jet SQL

Access Queries (Office 2003)

European Computer Driving Licence

SQL. Short introduction

DATABASE MANAGEMENT SYSTEMS

MIS S S t S ru r ct u ur u e r & & Pl P a l nn n i n n i g

IT2304: Database Systems 1 (DBS 1)

High-Volume Data Warehousing in Centerprise. Product Datasheet

A Comparison of Database Query Languages: SQL, SPARQL, CQL, DMX

Chapter 13 File and Database Systems

Chapter 13 File and Database Systems

DATABASE MANAGEMENT SYSTEMS

Creating Tables ACCESS. Normalisation Techniques

Database Optimizing Services

1 File Processing Systems

Tutorial on Relational Database Design

Microsoft Access 3: Understanding and Creating Queries

DBMS / Business Intelligence, SQL Server

Developing an Online Tool for Sales Representatives of Cosmetic Products

QW SQL Wizard (July 13, 2010)

Documentation techniques and databases

Cloud and Big Data Summer School, Stockholm, Aug Jeffrey D. Ullman

Relational Database Basics Review

Database Systems. Lecture 1: Introduction

VBA and Databases (see Chapter 14 )

Getting Started Guide SAGE ACCPAC INTELLIGENCE

Financial Data Access with SQL, Excel & VBA

Foundations of Business Intelligence: Databases and Information Management

Clustering through Decision Tree Construction in Geology

ERSSTOCK INVENTORY SOFTWARE FOR PC. USER GUIDE - v 1.00

12 File and Database Concepts 13 File and Database Concepts A many-to-many relationship means that one record in a particular record type can be relat

Summit Public Schools Summit, New Jersey Grade Level / Content Area: Mathematics Length of Course: 1 Academic Year Curriculum: AP Computer Science A

æ A collection of interrelated and persistent data èusually referred to as the database èdbèè.

Comparing SQL and NOSQL databases

Pastel Evolution BIC. Getting Started Guide

Lesson 07: MS ACCESS - Handout. Introduction to database (30 mins)

Module 3: File and database organization

DATA BASE.

Getting Started Guide

Introduction. Introduction: Database management system. Introduction: DBS concepts & architecture. Introduction: DBS versus File system

Physical Design. Meeting the needs of the users is the gold standard against which we measure our success in creating a database.

InfiniteInsight 6.5 sp4

INFORMATION BROCHURE Certificate Course in Web Design Using PHP/MySQL

Business Insight Report Authoring Getting Started Guide

How To Save Data On A Spreadsheet

Operating Systems CSE 410, Spring File Management. Stephen Wagner Michigan State University

Information Technology NVEQ Level 2 Class X IT207-NQ2012-Database Development (Basic) Student s Handbook

Introduction: Database management system

SQL - QUICK GUIDE. Allows users to access data in relational database management systems.

Creating and Using Databases with Microsoft Access

C A R I B B E A N E X A M I N A T I O N S REPORT ON CANDIDATES S WORK IN THE CARIBBEAN SECONDARY EDUCATION CERTIFICATE EXAMINATION MAY/JUNE 2012

RESEARCH. Figure 14-1 Research Options on Main Menu. All 4 Catalogs will search the Objects, Photos, Archives, and Library catalogs.

Physical DB design and tuning: outline

DBMS Questions. 3.) For which two constraints are indexes created when the constraint is added?

Getting Started with Access 2007

INFORMATION SYSTEMS. Written examination. Friday 12 November 2004

Database Management. Chapter Objectives

CHAPTER 6 DATABASE MANAGEMENT SYSTEMS. Learning Objectives

Microsoft Access Basics

Lesson Plan. Course Title: Advanced Computer Programming Session Title: Databases. Preparation

A database is a collection of data organised in a manner that allows access, retrieval, and use of that data.

Database Design and Programming

Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification

Multimedia im Netz Online Multimedia Winter semester 2015/16

Annex III: Data Base Management System

Benefits of databases

4.3: Multimedia Database Systems Multimedia Database Management System Data Structure Operations on Data Integration in a Database Model

Transcription:

Unit 5.1 The Database Concept Candidates should be able to: What is a Database? A database is a persistent, organised store of related data. Persistent Data and structures are maintained when data handling applications are no longer running (they are held on some form of permanent medium such as a disk or flash memory). Organised Related a. Describe a database as a persistent organised store of data. b. Explain the use of data handling software to create, maintain and interrogate a database. Data is stored in a very structured way, using tables, records and fields. Easy for users and applications to add, delete, edit, search & manipulate data. Individual items of data have a connection of some sort. The data in a database is not just a haphazard collection of facts Computerised Databases are better than Manual Databases (paper) because data can be accessed by multiple users at the same time data can be queried / interrogated and resulting answers viewed data can be modified and made available to all end users quickly fewer errors in data processing data can be output to suit users needs (e.g. graphs, reports, forms), on screen or printed A computerised database is a collection of related data stored in one or more computerised files in a manner that can be accessed by users or computer programs. Most computerised databases are operational databases, meaning that data going into the database is used in real time to support the on-going activities of a business. A supermarket accounting system is an example: as items are sold, the inventory database is updated and the inventory information is made available to the sales staff. Computers have the ability to store large amounts of data in a compact space and to process it speedily. Organisations of all sizes use databases to store, sort, interrogate and manage their data. 1

Hospitals Details of patients, doctors and treatments Admissions Consultations Staffing Stock control Businesses Manage and monitor sales, stock and staff etc. Analyse performance of business / employees Monitor trends in customer purchases to identify market opportunities Internet Search engines Google, Bing, Yahoo, etc. Powerful databases to collect the details of websites, search criteria etc. Database Levels A database can be viewed at three levels: The external view The conceptual view The physical view Further details can be found here: http://www.basicsofcomputer.com/three_level_architecture_of_database_system.htm External View: This is what the user sees. It is a view that is designed to be useful for a particular job. Generally there will be a user-friendly interface that will allow the end-user to interact with the data contained within the database. The user does not need to be aware of the physical structure of the database, or how the data is stored within it. 2

Conceptual View: This is concerned with how the data is organised. It has to do with the design of the tables, the types of data stored, validation rules used and how tables are linked. This is the equivalent of the Design View when using MS Access. Physical View: This is concerned with how the data is actually stored on the storage medium. The designers and the users of the database are not concerned with this detail. It is looked after by the database software. Types of Database Databases can be constructed in various ways according to the user s requirements. Flat file Database This is a single table such as can be set up in a spreadsheet. Only suitable for very simple data-handling requirements, such as an address book. As soon as requirements become more complicated, they lead to all sorts of problems. 3

Relational Database In some situations, items in a database relate to each other like the branches on a tree. Then a hierarchical database might be suitable. Database Software It is important not to confuse a database with the software that handles it. Software is needed to make use of the data in the database. The software may be specially written in a programming language like C++ or it might be part of a Database Management System (DBMS). You do not normally buy database software applications off the shelf because each business is different and therefore has specific needs regarding its data. The DBMS will enable a user to perform specific actions such as: Creating an empty database Deleting an entire database Creating and deleting tables Inserting new records into tables Updating and deleting records Being able to extract data sets Being able to produce reports that summarise the data Being able to process the data to create new data There are many database management systems that are either commercial products or free open source applications. Examples include: MySQL Access Base Oracle A very popular, free open source system, widely used on web sites Included in some versions of the Microsoft Office suite Part of the free Open Office suite A multi-user enterprise level database management system. Widely used in industry 4

GCSE Computing A451 Unit 5.1 The Database Concept www.mrfraser.org Use of Data Handling Software: Creating a Database The Data Handling software that you will be most familiar with is probably MS Access, although you may have experience of others! Whichever software you choose, the structure and mechanics remain the same Creating the Database Structure 1. Create relevant FIELDS with appropriate data types, sizes & validation rules e.g. Field Name StudentID Surname FirstName DoB... Data Type Validation Integer Required. Must be Unique String Required. Max 25 Characters String Required. Max 25 Characters Date/Time Required. < 01/01/1995...... 2. Nominate or create a KEY FIELD for each table (StudentID) 3. Save FIELDS as a TABLE e.g. Student 4. Enter Data into database fields to form Records e.g. StudentID 0001 0002 0003 0004... Surname FirstName DoB etc... Banks Robin 19/06/1991... Dover Eileen 25/06/1994... Fischel Arty 08/05/1990... Peace Warren 17/03/1992............ Each complete set of fields forms a single record with a unique entry in the KEY FIELD. This example database FILE contains just one table and is known as a flat-file database. There are number of limitations to such databases. Relational contain multiple linked tables and offer many advantages over flat-file databases. 5

Using Data Handling Software to Maintain a Database Database maintenance involves the following: Add / Insert new records into a database in the correct location (e.g. new student) Delete existing data records (e.g. remove records of old students) Update / Edit existing data items within existing data records (e.g. update exam grades) Using Data Handling Software to Interrogate a Database Database interrogation involves using the database management software to query (search) the database for information. Example Reasons to query data: Identify a group of records that share a certain attribute e.g. List all Rock music in your itunes library Calculate totals based on the information held in records e.g. calculating the total value of the assets held by a company. Update the details of a specific record or group of records e.g. update termly levels for all students in a year group / class The above list shows that queries are a means of producing information from data. This information is used by the decision makers in organisations to plan strategies and tactics. Databases usually allow users to create, save and then reuse queries. Query Design Specifies which records to search for and which fields to display. Simple Query - looks for data in one field only (e.g. all songs in playlist by Led Zeppelin) Complex Query - looks for data in multiple fields (e.g. all songs in playlist by Led Zeppelin from the album Led Zeppelin II) The example of a simple query below uses a Microsoft Access database table and a query to find the names of all songs that are classified as Rock and have been played more than 10 times. This involves the following steps: Adding the 'Songs' table to the query; Selecting the fields to display; Adding the search criteria against the correct fields ( Genre and Plays ) 6

SQL The standard language for manipulating a database is called Structured Query Language (SQL). Each DBMS supports a standard set of commands such as: CREATE DATABSE DROP DATABASE CREATE TABLE DELETE TABLE EMPTY TABLE INSERT {Record} UPDATE {Record} SELECT {Records} DELETE {Records} There are also SQL commands that can summarise data sets and to carry out mathematical operations on the relevant data types. In order to carry out a task on a database an instruction is written using one or more of the above statements. This instruction is called an SQL query. These can be fairly simple or they can be extremely complicated. Example of an SQL statement SELECT * FROM MyDatabase.Names WHERE 'First_Name' = 'John' The first keyword is 'SELECT' which means a set of records is going to be extracted from the database. The asterisk * means 'every field in the record'. Then comes FROM which defines which parts of the database is to be used, in this case a single table called 'Names' from the database called 'MyDatabase'. Then comes the very important WHERE clause. This defines a condition that causes only a sub-set of the table(s) to be extracted. In this case the field called 'First_Name' must contain the name 'John'. In English, this says Get me all the records from Names that have the first name John. SQL fun & games: http://www.sqlzoo.net 7

Data Storage The data in a database can be physically stored in different ways, each offering particular advantages and disadvantages. Serial Data files In a serial data file the each record is as large as the data to be stored and there are no empty records. Serial data files are therefore often the most memory efficient way to store data. In this type of file structure the computer has to read through the data record-by-record until it finds the record that is needs to access. This makes accessing data from a serial file relatively slow. If a record is deleted or edited then the complete altered file is re-written back to the storage medium which is relatively slow and may involve writing to a temporary file until the process is completed. The original file is then replaced by the altered temporary file. Sequential Data Files Basically the same as serial files except that the records are stored in order of a designated key field. This means records can be found more quickly. Similar issues remain when new records need to be inserted, or old records need to be deleted. Indexed Sequential Data Files Used for very large sequential data files. Records are stored in order of their key field, but also stored with an index, which allows a search to jump straight to the correct block of records in the file. Think of it like a book with an index that specifies the page number for each chapter, or a bookshelf where books are ordered A-Z by author, but there are also markers placed on the shelf for the start of each letter of the alphabet. Random Access data files In a random access data file each record is identified with a record number in sequence and each record takes up the same amount of memory. The computer therefore quickly access to any record by simply calculating its position in the data file based on the record number and then directly accessing that record. However, random access files can be wasteful of disk space if the data stored in each field varies in length because space is allocated for the longest possible field in every record (the field storing the data item MOUSE would occupy the same number of bytes as one storing the data item COMPUTER). 8

Each time a new record is created it is simply added to the end of the file and the record number increased by one. However, deleting a record would upset the numbering system so this cannot be done. Instead the record is kept but the contents deleted. Before long, quite a number of records will be 'blank' and a growing proportion of the data file becomes wasted space. Indexed data files In an indexed data file the records do not have a fixed length, they match the length of the data in the same way as a serial data file and there is no wasted space. However, the start position of each record is stored in an index which is part of the file. This allows the computer to quickly access any record in the same way as with a random access data file. If a record is deleted it is left in the data file but the index entry is deleted. If a record is altered then the updated record is simply added to the end of the data file and the index updated. The data file will eventually contain a lot of wasted data that is not indexed because it had been deleted or edited. However it is relatively easy for a computer to re-write an indexed data file data file, deleting all the un-indexed data and re-indexing the rest. SUMMARY: Serial data files are slow to access to particular records within the file but they make efficient use of storage space. Random access data files allow fast access to particular records within the file but can be inefficient in their use of storage space when records are added and deleted. Indexed data files allow quick and easy access and make efficient use of space. However, the data file does need to be periodically re-written and re-indexed to maintain this efficiency. Keywords Conceptual view External view Flat-file database Hierarchical database Relational database Physical view SQL Structured Query Language How the data is organised in a database. What the user sees of a database application. A database of only one table. A database organised on a tree structure with multiple linked tables. A database with multiple tables linked by common fields. How the data is stored on the secondary storage. A way to program queries to interrogate, maintain and set up a database. 9