Component 2 5G, H, I, J, K.

Slides:



Advertisements
Similar presentations
MODULE 4 File and Folder Management. Creating file and folder A computer file is a resource for storing information, which is available to a computer.
Advertisements

Introduction to Structured Query Language (SQL)
 When you receive a new you will be shown a highlighted in yellow box where your can be found  To open your new just double click.
Database Design IST 7-10 Presented by Miss Egan and Miss Richards.
DAY 21: MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Akhila Kondai October 30, 2013.
Validation and Verification
Encoding, Validation and Verification Chapter 1. Introduction This presentation covers the following: – Data encoding – Data validation – Data verification.
HNDComputing – DeMontfort University  DeMontfort University 2011 Database Fundamentals wk2 Database Design ConceptsDatabase Design Concepts Database Design.
Management Information Systems MS Access MS Access is an application software that facilitates us to create Database Management Systems (DBMS)
Access 2013 Microsoft Access 2013 is a database application that is ideal for gathering and understanding data that’s been collected on just about anything.
System Development Lifecycle Verification and Validation.
MS Access 2007 Management Information Systems 1. Overview 2  What is MS Access?  Access Terminology  Access Window  Database Window  Create New Database.
Database Systems Microsoft Access Practical #3 Queries Nos 215.
Databases. What is a database?  A database is used to store data. The word DATA is actually Latin for FACTS. A database is, therefore, a place, or thing.
Views Lesson 7.
AS Computing Verification. Once sensible data has been entered, the second of method of ensuing data integrity can be employed. Verification is the process.
AS computing Validation and verification. Introduction It is important to maintain the integrity of any database of information. Any data item must always.
ITGS Databases.
Microsoft Access. Microsoft access is a database programs that allows you to store retrieve, analyze and print information. Companies use databases for.
 When you receive a new you will be shown a highlighted in yellow box where your can be found  To open your new just double click.
Verification & Validation. Batch processing In a batch processing system, documents such as sales orders are collected into batches of typically 50 documents.
Database Management Systems (DBMS)
CHAPTER 1 – INTRODUCTION TO ACCESS Aliya Farheen March 5, 2014.
Database Objective Demonstrate basic database concepts and functions.
NSF DUE ; Wen M. Andrews J. Sargeant Reynolds Community College Richmond, Virginia.
Software. Because databases can get very big, it is important to decide exactly what is going to be stored in each field. Fields can be text, number,
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
Data Capture Forms What are they?. Example 1 Example 2.
N5 Databases Notes Information Systems Design & Development: Structures and links.
SchoolSuccess for Coordinators
DATA TYPES.
- The most common types of data models.
Fundamentals of DBMS Notes-1.
Microsoft Office Access 2010 Lab 1
Prepared By: Bobby Wan Microsoft Access Prepared By: Bobby Wan
DATA COLLECTION Data Collection Data Verification and Validation.
Visual Basic 2010 How to Program
Databases Chapter 9 Asfia Rahman.
Databases.
GO! with Microsoft Office 2016
Practical Office 2007 Chapter 10
GO! with Microsoft Access 2016
Microsoft Office Illustrated Fundamentals
Validation Bury College.
Access Database for CIS17
STRUCTURED QUERY LANGUAGE
Chapter 2 Database Environment Pearson Education © 2009.
Chapter 2 Database Environment.
Accounting System Design
Creating and Modifying Queries
Setting up an online account
NextGen Trustee General Ledger Accounting
Teaching slides Chapter 8.
Exploring Microsoft® Access® 2016 Series Editor Mary Anne Poatsy
Databases Software This icon indicates the slide contains activities created in Flash. These activities are not editable. For more detailed instructions,
Access Database for CIT12
Flat Files & Relational Databases
Computer Science Projects Database Theory / Prototypes
Database Fundamentals
Spreadsheets, Modelling & Databases
The ultimate in data organization
Summary Data Modeling SDLC What is Data Modeling
Indexes and more Table Creation
Commercial Data Processing
Databases This topic looks at the basic concept of a database, the key features and benefits of a Database Management System (DBMS) and the basic theory.
Chapter 2 Database Environment Pearson Education © 2009.
Understanding Core Database Concepts
Chapter 2 Database Environment Pearson Education © 2009.
QUICK GUIDE TO CIRCULATION IN ALMA
Presentation transcript:

Component 2 5G, H, I, J, K

Assessment outcomes 5G - Describe the advantages of different users having different views of the data in a database. 5H (A2) - Explain how the data can be manipulated to provide the user with useful information. 5I - Explain and apply appropriate techniques for data validation and verification of data in databases. 5J (A2) - Explain the purpose of query languages. 5K (A2) - Construct and run queries using Structured Query Language (SQL).

5G - Describe the advantages of different users having different views of the data in a database. There are three fundamental views and they are useful to different groups of people. It is called the three-level architecture schema Internal or Physical View Conceptual View External View Extra help? https://www.youtube.com/watch?v=Puhgh6icKLw

5G - Internal or Physical View This view exposes all the internal details of how the data is stored on the physical computer. For example the data structures used in memory, the nature of the indexes used for searching, what physical devices are used to store the database and so on. At this level the operating system is interacting with the database. The kind of person interested in this level of detail would be the engineers putting together the physical equipment and the core designers of the RDBMS itself. Database Architects Database Engineers Network Managers

5G - Conceptual View At this level, there is no concern about the physical nature of the database, but rather the concept behind the database. It shows: a model of all the information within the database the kind of records it holds the type of authorisation and validation methods used. This is the kind of view the database designer is using to set out the whole database Database Engineers Database Designers Database Architects

5G – External View This is the view discussed in the previous examples. It sets out what an authorised user can see of the database. It sets out the data they are allowed to see and their authority level to change the records.

5G – External View: Bank Examples Group 1: Customers A customer needs to enter a PIN, then they can only see their own accounts. They are not allowed to change details such as the account number or to open and close accounts directly Group 2: Bank teller They can access any customer accounts (audit trail of course) and can change some of the account details with the permission of a customer. They cannot see the bank's own financial records. Group 3: Finance staff These look after the finances of the bank itself, so they may be able to see how many active accounts there are, their type, how much money is in each type and so on. They probably cannot see individual accounts but they can get grouped summary reports.

5H (A2) - Explain how the data can be manipulated to provide the user with useful information. Databases contain data in the form of records within tables and a number of relationships between them. But there has to be a method of setting up a database in the first place and also a method of accessing the data according to some criteria. This is why SQL was developed. SQL stands for Structured Query Language. SQL is now maintained as a standard language by the American National Standards Institute (or ANSI).

5H - Create The CREATE TABLE statement is used to create a table in a database. Tables are organized into rows and columns; and each table must have a name. http://www.w3schools.com/sql/sql_create_table.asp

5H - Insert Once an empty table has been created, the next thing is to load some records into it. This is done using the sql INSERT command Carrying on with the example of the clubs table, the command below will insert one record into the table INSERT INTO `test`.`clubs` (`ClubID`, `ClubName`) VALUES ('1', 'The Pullman Club'); http://www.w3schools.com/sql/sql_insert.asp

5H – Selecting or retrieving data Once the database has been set up and the tables populated with records, it is time to use the database in earnest by selecting records out of it. The returned results can be used to generate nicely formatted reports or they can be used to process the data in some way. The most widely used command to extract records from a database is the SELECT command. The example we have used has been expanded slightly to include three records

5H – Selecting Data Selecting All Selecting One If we wanted to extract ALL records from the table, the following command is issued SELECT * FROM `clubs` The command begins with the word SELECT, then a star * symbol which means 'all fields' in sql followed by the FROM statement and a table name. The generic command is SELECT {fields to be extracted} FROM {table} The command extracts all records because there is no WHERE clause to qualify the records. This is quite an useful command of itself if you intend to process every record in the defined table in some way. The sql SELECT command can be extended in order to extract records that meet a specific criteria. Example: extracting a single record The easiest way to do this is to target the primary key with a single value. Like this SELECT * FROM `clubs` WHERE `ClubID`=2 This returns a single record as shown below The new part of the command is the WHERE clause which in this case only selects the record whose primary key is 2

5H – Selecting Data Selecting Some We have described how to pull all records (absent WHERE clause) and we have described how to extract a single record (WHERE includes single value primary key). But another very common requirement is to extract a sub-set of the table records. For instance the command SELECT * FROM `clubs` WHERE `ClubID`>1 This has a WHERE clause that will select any record whose primary key is greater than one. The result in the example is : The WHERE clause of an sql query can be very complicated in order to extract some specific records.

5H – Reporting Data Reporting data to users is one of the main purposes of electronic databases. Reports can be produced from the data stored or queries run Whilst tables hold lots of data and that data can be sorted into a logical order or extracted as part of a query, the output doesn't look very professional. If you are just searching the database for information for yourself, that would be fine, but if you are going to show the information to a manager or a customer, it needs to be presented in a more professional way, probably with the company house style and logo as well. This can be done by producing a database report.

5I - Explain and apply appropriate techniques for data validation and verification of data in databases. Validation Verification Validation is the term used to ensure that only 'sensible' data is entered into a database. These rules are set up, for example, on a database on a computer and the computer then automatically checks the data entered against these rules. Sensible data means that it is of the correct data type and it follows the rules set up for that piece of data. (Don't use the phrase 'correct data’ - some exam boards don't like it!) There are a number of different ways of setting up validation rules. We will look at these in turn. Once sensible data has been entered, verification techniques should be employed. Verification is the process of checking that the sensible data entered is actually the data you want! For example, suppose you have a field NAME. You enter JONNS. This is valid data. But when you double check it, you realise that it should be JONES not JONNS. You can then correct it. This is verification. There are a number of verification methods in common use.

5I - Validation Range checks Format check You can set up rules to ensure that if someone enters a number it must follow some mathematical rules, for example, be greater than a number, or less than or equal to a number or be between two numbers and so on. We have already seen an example of setting up rules for an AGE field. If a value is entered outside of this range, then a helpful error message should be displayed. These are the maths symbols used in range checks: < Less than  < = Less than or equal to > Greater than > = Greater than or equal to < > Not equal to If you have a problem remembering which maths symbol is which for less than and greater than, try remembering that the L in Less looks very similar and points in the same direction as the maths symbol <. Sometimes, especially with membership and ID identifying codes, the code is made up of a mixture of numbers and letters. For example, a national chess club may have a membership ID that is made up of 2 letters, followed by 3 numbers, followed by a letter, for example, RG662P. You can set up rules that look for patterns such as: LETTER-LETTER-NUMBER-NUMBER-NUMBER- LETTER. If TYP23F is entered into a data input form, it will not get put in the database. It will be rejected and a helpful error message should pop up! This kind of check is known as a ‘format check’.

5I - Validation Length check Allowable values check In text fields, you can tell a database to accept an entry only if it is less than a certain number of characters. For example, you might set a field up called COLOUR to be less than or equal to 10 characters. If someone entered BLUE WITH A HINT OF MANGO, it would get rejected because it doesn't follow the validation rule. You can set up fields to only accept certain values. For example, you might have the Boolean field GENDER set up to only accept MALE or FEMALE. You might set up a text field called WHEN DO YOU WANT TO LEAVE? so that it can only accept MORNING, NOON or EVENING.

5I - Validation Check digit Commonly used on bar codes, this is a technique used to see if a number has been entered correctly. A number, called a check digit, is placed at the end of a code. The bar code is read and the check digit calculated. If the result is the same as the check digit, then the code has been read correctly. If they are different, then the item will have to be read in again. There are different methods of working out check digits. For example, the 13 digit ISBN code for this book is 978-0-954351472. The check digit is the number on the right hand side, 2. A barcode scanner would read the first 12 digits of the ISBN code and then see if it got a 2. If it did get a 2, it would know that the ISBN code had probably been scanned correctly. How does it work out the check digit? First, it multiplies each digit in turn by a 1, then a 3, then a 1, then a 3 and so on, and adds up the result, like this: (9 x 1) + (7 x 3) + (8 x 1) + (0 x 3) + (9 x 1) + (5 x 3) + (4 x 1) + (3 x 3) + (5 x 1) + (1 x 3) + (4 x 1) + (7 x 3) = 138 Next, it divides the 138 by 10 to get 13 remainder 8. Finally, it subtracts the reminder from 10, so 10 – 8 = 2. (This system uses something called ‘modulo 10’, which just means the remainder after you divide a number by 10). As you can see, the check digit is 2, which is also the number on the right hand side of the 13 digit ISBN code. Do note that 10 digit ISBN numbers use a different system to the one described here.

5I – Validation Presence or ‘Required’ check Some fields are more important than others and must be filled in. For example, suppose you had a database that stored car adverts. A customer rings up to place an advert and the operator types the advert into the database using a data input form. If the customer doesn't know the colour of the car, it is not a disaster and so it doesn't need to be filled in. If the customer has forgotten his or her telephone number, however, this is a problem - how can anyone contact him to buy the car? This field cannot be left blank. If the operator presses ENTER to enter the whole advert and this field has been missed out, then a helpful error message should appear. This kind of rule is known as a ‘presence check’.

5I – Verification Re-Type a value Re-enter whole data files This is commonly used when you set up or change a password. You type in your password once, and then you type it in a second time. If they both match, then your password is accepted. If they don't match, even though both entries are valid, it is rejected and you are asked to try again. This is used in data processing environments. Operator A types in a set of paper-based orders, for example. They are saved in a file, but not entered into the database yet. When operator A has finished typing in the orders, the paper-based orders are passed to operator B. He re-types them all in. As operator B types in an order, it is checked by the software to see if what he has typed in is the same as what is held on file, what operator A typed in. If they are the same, then the order is entered into the database. If they are not the same, then an error is flagged up and the order needs to be carefully checked. Flagging up can be done in a number of ways. The keyboard could 'beep'. An error message could be displayed, or all of the errors saved to file and an error report printed out at the end of data entry. Although this may seem a little long-winded, it is an important method of verification for critical data, such as for entering in data from passport applications.

5I – Verification Reading back Tick the box and click to proceed When you book a holiday at a travel agent, you give them all of your details and they type them into their computer. They can verify that your details are correct simply by reading them back to you and asking you if they're correct! Sometimes, organisations need you to confirm some details they have given you. In this case, they may print out what you told them on a form and then ask you to confirm the details, sign and return it. If you have ever ordered anything over the phone, then you will know that after you have placed your order, the operator will read it back and ask you to confirm that the order is correct. If you buy something on the Internet, you will typically place an order by typing it into a form. The order will then be prepared, possibly rearranged and then displayed back to you on the screen. You will be asked to check it carefully, tick a CONFIRM button and then click a PROCEED button (or variations of this procedure). This procedure is another example of a verification method. Indeed, it may be followed up with a confirmation email, which is a further method of verification.

5I – Validation and Verification Remember: Data validation: Automatic checking that the data you entered is sensible in that it follows the rules you set up for the data when entered into a computer. Data verification: Manual and / or automatic checking that the sensible data you entered is actually the data you meant to enter in the first place!

5I – Database Corruption! A database can still become corrupt It should be recognised that even with clever validation and verification techniques in place, the data entered into a database could still be compromised. For example, it is possible that both operators during validation entered in the same, but wrong, data - perhaps they both misunderstood the handwriting on the paper-based forms. It is possible that both operators entered in the information on the form, but the information on the form was wrong! Even with the best methods of validation and verification in place, data can still be compromised.

5J (A2) - Explain the purpose of query languages Broadly speaking, there are two main functioning parts to a DBMS. These are the DDL and the DML. Data Definition Language (DDL) The Data Definition Language (DDL) is one part of the DBMS. It is used by the designer of a database rather than a user. The DDL is used to set up the structure of a database as well as for maintaining the database. For example, using the DDL, they can set up tables of data about data (names of attributes, data types, validation rules etc). The data about data is often called ‘meta-data’. The DDL is also used to set up the security systems in the database. This is done using the DDL by describing the whole database (the ‘schema’) and then describing data in parts of the database (the ‘sub-schema’). Once this has been done, the designer can control access to each of the sub-schema. For example, if a receptionist needs to know each employee’s department, extension and job title, then a sub-schema will be defined with these data items in it. The receptionist is then given access to that sub-schema (she is allowed to view that data on her screen) but not other sub-schema. That means she cannot, for example, access how much an employee earns, or the contents of their personnel file. Using the DDL, then, different users of a database can be allowed to access certain sub-schema but not others.  Users can be given different ‘views’ of the same data in a database.

5J – DDL and DML Data Manipulation Language (DML) The DML is another important part of the DBMS. It is commonly used by the users of a database to access and update data. This language allows users to actually work on the data in your database. They could, for example, write programs that add, delete, modify or retrieve data! The DML is a high level language. This ensures that minimal programming skills are necessary to actually use it. 

5J – SQL The industry standard for DDL and DML is called Structured Query Language, or SQL. We should get some experience using SQL.

5J – What is SqL? SQL, or Structured Query Language, is a language that is used for gaining access to and manipulating tables of data. It is a ‘standard’ language in that it has been defined by the American National Standards Institute (ANSI) and so will work with many different applications such as Access, Informix and Oracle, for example. Although there are a number of different SQL versions in existence, they all support the basic ANSI standard and so all can carry out certain functions in the same way, such as SELECT and DELETE. We will see examples of these later. 

5K (A2) - Construct and run queries using Structured Query Language (SQL) We are going to create a database for the tables: You will need to create and populate the tables. You will then need to alter the tables to add the links

5K – Write SQL Create tables - http://www.w3schools.com/sql/sql_create_table.asp Alter tables to create foreign key links - http://www.w3schools.com/sql/sql_alter.asp, http://www.w3schools.com/sql/sql_foreignkey.asp Populate tables - http://www.w3schools.com/sql/sql_insert.asp Query tables - http://www.w3schools.com/sql/sql_select.asp, http://www.w3schools.com/sql/sql_where.asp

5K – Query examples This query will select all dogs who are poodles SELECT * FROM dogs WHERE Type = ‘Poodle’;