320 likes | 471 Views
Databases. What is a database?. A database is an organised collection of related information. What is a database application package?. A database application package is a program that lets you manipulate pieces of data. What is the difference between data and information?.
E N D
Databases Databases
What is a database? A database is an organised collection of related information. What is a database application package? A database application package is a program that lets you manipulate pieces of data. Databases
What is the difference between data and information? • Data is raw facts and figures - no meaning • Information is in context - has a meaning • Data is processed into information Databases
What makes up a database? • File - every thing • Record - one thing • Field - details about one thing Databases
Record Another Field Field Another Record A Table Databases
A Query Databases
A Form Databases
A Report Databases
Creating a database - analysis • What do you want to hold information about? • Why do you want to hold the information? • What type of questions (queries) do you expect your database to be able to answer? • Decide what data has to be stored. Databases
Data is stored in Fields • Decide what fields you need • Decide what type each field should be. Choose from • Text • Number (numeric) • Graphic • Currency • Date/Time • Yes/No Databases
Implementing a database • Create the file • Create a record by creating the fields • Add the data • We can then • alter the record format • edit the records • or … Databases
Operations in a database • Search using a keyword • simple • complex • Sort • ascending • descending • Computed (calculated) field Databases
Calculated fields A calculated field in a database takes • the contents of two (or more) fields already in the database • performs a calculation using these contents • displays the results of the calculation Databases
Examples of Calculated fields First Run: 20 s Second Run: 22 s Third Run: 18 s Average Run: 20s Databases
Examples of Calculated fields Date of Birth: 19/12/2001 Age: 4 years This calculated field also needs to find the current date on the computer system Databases
Examples of Calculated fields Name: Billy Clark Sales: £2,365 Target: £2,100 Bonus: Yes This calculated field compares the contents of two fields. Databases
Sales example in Access Databases
Query as displayed Databases
Query Design Databases
Query syntax Total: [First Quarter sales]+[Second Quarter sales]+[Third Quarter sales]+[Last Quarter sales] Bonus: IIf([Total]>1500,"Yes","No") Be careful!!! Not if but IIf Databases
Form as displayed Databases
Form design Databases
Report as displayed Databases
Report design Databases
Storage requirements Perform a calculation Databases
Storage requirements First, an easy problem.. If an apple costs 23p and I have £2, how many apples can I buy? The price of apples is in pence, so the money I have has to be in pence. If an apple costs 23p and I have 200p, how many apples can I buy? Number of apples = total money available / cost of one apple = 200/23 = 8.69 I can’t buy part of an apple, so the number of apples I can buy is 8. Databases
Storage requirements And now.. If a record takes up 300kB and I have 1.44MB of storage, how many records can I store? The size of a record is in kB, so the storage I have has to be in kB. 1MB = 1024kB 1.44MB = 1.44 x 1024 = 1474kB Databases
Storage requirements And so.. If a record takes up 300kB and I have 1474kB of storage, how many records can I store? Number of records = total storage available / size of one record = 1474/300 = 4.91 I can’t store part of a record, so the number of records I can store is 4. Databases
Security and Privacy • What is security? • What is privacy ? • Control of access • Passwords • Levels of access • Physical access • Data Protection Act • principles • data subject, user • Computer Misuse Act • Unauthorised access (hacking) • Viruses Databases
Is the data correct? • Verification • Performed by people • usually double entry of data • Validation • Performed by program • Types of checks • Presence • Data type • Range • Limited choice Databases
Going forward • Better HCI • Alter screen input format • Alter output format • Knowledge base • Artificial intelligence Databases
The End Databases