1 / 18

Databases

Databases. Organise this:.

manju
Download Presentation

Databases

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Databases

  2. Organise this: • Jenny is 17 and studies chemistry and physics. Tom is her best friend, he’s also 17. Her sister Jackie is friends with Sally, who is 18. Jackie is also 18. The oldest is Jim, who is 17 and also has Tom as a best friend. Jenny is engaged to be married to Tim, who is 119 and studies biology and maths. Sally and Jackie study Maths, but Sally also studies Sport, though Jackie studies three subjects, as she also takes French.

  3. Probably the best way:

  4. Note • If people are best friends, then they should be connected • There is no way to “lock” best friends • Some people’s subjects get repeated, so that wastes storage space and typing time • There are several ways to write the subjects • You could wrongly enter nothing at all if it’s just a simple table • No validation has been performed, especially in the case of Tim aged 119 & Jenny/Jennie

  5. A database is • A persistent, organised store of data. • People depend on databases, many businesses cannot function without them. • So, the database must be • Accurate (correct) • Up-to-date (current) • Readily available to whoever needs access • Protected from people who shouldn’t have access

  6. Some definitions: • Entity – the complete real-world object for which you need to hold data • Instance – one of the entities, also called a record • Attribute – a characteristic of an entity • Values – word or number information about the entity • Relationship – a connection between entities • Table – the way that most databases hold data • DBMS – a database management system – “a computer-based system to manage a database or collection of databases”

  7. Examples: • Entities: customers, employees, films, pupils • Instance: you, me, “Rain Man”, you • Attribute: address, gender, length, age • Value: 1 Darwin Lane, start date, 45mins, 15 • Relationship: is_customer_of • Table: pupils table, teacher table (etc.) • DBMS: SIMS

  8. Typical Types of Data: • Strings (text) – characters, usually up to 256 or 512 bytes long • Numbers – as integers • Real numbers – with a decimal point and maybe an displayed in a form of scientific notation • Prices – in whichever currency you want • Yes/No data (Boolean) • Dates • Times These are all simple types, you may also see records – a compound data type, consisting of several fields of different simple types

  9. Give examples of each type: • Text/string: • Integer: • Real: • Currency • Boolean • Date • Time

  10. What information might you need to store about ….. • A CD in a DJ’s record collection? • A candidate entering for an exam? • The same CD in a record shop like HMV? • A part in a car parts database? • An item in a supermarket database? • A customer buying travel insurance? • A pupil in a school database? • A patient in a hospital database?

  11. We want to avoid: • Errors • Lost data • Insufficient data • Inconsistent data • Unauthorised access

  12. Errors can result in: • Embarrassment – sending bills to dead people, for example • Financial loss – banks need everything correct • Life-or-death situations like air traffic control or airport data or navigational data for planes and ships.

  13. Aims of managing a database: • Minimisingstorage requirements • Minimising repetition or redundancy • Fast entry of validdata • Avoidance of someverification • Fast and easy searches • Prints in neat layouts as reports

  14. Data security • Not just keeping out intruders, but also minimising the damage from: • Natural catastrophes like fire and flood • Accidental actions • Malicious actions Data integrity • Making sure the data is accurate / correct / trustworthy • Needs validation • Software design that avoids inconsistent data

  15. Validation and verification • Validation – checking that the data is valid – that is, it means something for the field it is entered into. • You could check for: • the right type • the right length • Right punctuation/syntax • Sensible values

  16. How to protect data: • Making backups • Mirror servers • Off site storage • Restricted access to buildings • Passwords on the computer • Audit trails (who did what, when)

  17. Creating a database in Access:

  18. Exercise • Start “Access” • Create a data table for one or more of these examples:

More Related