Presentation is loading. Please wait.

Presentation is loading. Please wait.

Database Theory.

Similar presentations


Presentation on theme: "Database Theory."— Presentation transcript:

1 Database Theory

2 Table Databases store data or information in tables, just like the one below: Tables can store many records, from a few dozen for a small database up to millions for a large company database.

3 Record A record is all of the data or information about one person or one thing.

4 field a 'field' is one piece of data or information about a person or thing.

5 What am I? John Smith Callum Brown 1 Sandown Drive Huyton Merseyside
5 Rodney Street WA12 9PT Collection of members details A class list with mock grades results and expected grades Nathan Rigby 8H 15/2/91 Beech Hill A list of customers ids and the films they have rented out

6 Data types Alphanumeric or Text
This allows you to type in text, numbers and symbols Number This allows a whole number or a decimal number. Only numbers can be entered, no letters or symbols Currency This automatically formats the data to have a £ or $ or Euro symbol in front of the data and also ensures there are two decimal places. Date/Time This restricts data entry to a true date. It checks that a date can actually exist, for example, it would not allow 31/02/06 to be entered. It formats the data into long, medium or short date/time Autonumber This datatype will automatically increase by 1 as records are added to the database Logical, Boolean, Yes/No This datatype is often referred to as different things, you may hear it called 'logical', or 'boolean' or 'yes/no'. All it means is that the data is restricted to one of only two choices Give students datatype word ladder

7 Primary key It is important that every single record in a database has something to uniquely identify it and this is called the 'Primary Key' or sometimes the 'Key Field'. Imagine a patient going to have an operation. 'Oh hello Mr Jones, I have 4 Mr Joneses having an operation today, can you tell me if yours is to remove your tonsils, your arm, put your leg in a cast or give you a hair transplant?'. I think that would be one very worried patient!

8 Pick the primary key!! Ford KA 1.2 2003 blue MH03 STU Every car has it’s own unique registration number

9 Field size Most databases will have a default field length set up, usually 50. This means that each text field is able to store up to 50 letters, numbers or symbols. The reason that you shouldn't just leave the field length as the default number is because every single character space allowed takes up one byte of storage space in the database, so a field size of 50 would need 50 bytes of storage. On its own, that doesn't sound a lot, but multiply that by all of the fields in the database and then by every single record being stored and you could soon have a large database that becomes a bit slow and sluggish.

10 What’s the difference between verification and validation????
Type check, range check, presence check, format check It is very important to remember that Validation cannot stop the wrong data being entered, you can still enter 'Smiht' instead of 'Smith' or 'Brown' instead of 'Green' or '78' instead of '87'. What Validation can do, is to check that the data is sensible, reasonable and allowable. What’s the difference between verification and validation????

11 Flat file A database that contains only one table:
This table might seem pretty logical at first. But think about it …. Every single time the pet has an appointment, the customer's title, surname, street, town, county, and phone number have to be entered. Also, the pet's name, type and d.o.b. also have to be entered. That would get fairly tedious having to enter so much data each time and there would be a great risk of making a mistake. It also means you have a lot of duplicate data (redundant data) taking up space on your hard drive. Ask students why this table is not ideal for use in a vet’s practice

12 Relational database Appointments table Pet table Customer table
In this database the data is split up into sensible groups i.e. customer data, pets data and appointments data. Then a separate table is made for each group. The main benefit of a relational database is that data doesn't have to be duplicated. When a customer books an appointment for their pet, a new record is created on the 'appointment's table' and the relevant Customer and Pet IDs are chosen. Can anyone spot the deliberate mistake in this database???


Download ppt "Database Theory."

Similar presentations


Ads by Google