Databases Explained Tables © Dolinski 2007.

Slides:



Advertisements
Similar presentations
Build a database I: Design tables for a new Access database
Advertisements

Organisation Of Data (1) Database Theory
Databases. Objectives Define what a database is. Understand the difference between a flat and relational database Design and create a relational database.
Relational Database Need to Knows. What is a database? Data - is just a pile of numbers or stats. A business "organises" the data to be meaningful and.
WJEC Applied ICT Databases – Terminology and Notation DEFINITION A database is a collection of data or information which is held together in an organised.
Lesson 1 -What is a Database? -Fields and Records
BUS1MIS Management Information Systems Semester 1, 2012 Access: Creating a Database Week 6 Lecture 2.
Microsoft ® Office Access ® 2007 Training Build a database I: Design tables for a new Access database ICT Staff Development presents:
CSC 240 (Blum)1 Introduction to Database. CSC 240 (Blum)2 Data versus Information When people distinguish between data and information, –Data is simply.
Complete theory from last lesson… Put today’s date in the front of your book Read pages 46 and 47 of the textbook…
Normalisation. NoKats Dog Club A club formed since Keeps records of members and their dogs on index cards. Cards are managed by the secretary and.
Information Systems & Databases 2.2) Organisation methods.
ATADESAB. BATLE CORDER DLEIF Lesson objectives In this lesson you will learn some basic database terms and learn how a database is created.
DATABASE What exactly is a database How do databases work? What's the difference between a spreadsheet database and a "real" database?
Microsoft ® Office Access 2003 Training Get to know Access CGI presents:
Access Review. Access Access is a database application A database is a collection of records and files organized for a particular purpose Access supports.
Database revision.
Quiz questions. 1 A data structure that is made up of fields and records? Table.
Introduction to Access Chapter 13 pages 1-4. What is a database??? Related information is stored in databases  All SC student information is stored in.
Planning & Creating a Database By Ms. Naira Microsoft Access.
Databases 101 © Dolinski What you will learn How relational databases work What are the components that make up a database How to create each component.
Access Lessons 1, 2 and 3 ©2009 M and K Solutions, LLC – All Rights Reserved.
A table is a set of data elements (values) that is organized using a model of vertical columns (which are identified by their name) and horizontal rows.
* Database is a group of related objects * Objects can be Tables, Forms, Queries or Reports * All data reside in Tables * A Row in a Table is a record.
Databases Database Normalisation. Learning Objectives Design simple relational databases to the third normal form (3NF).
INFORMATION TECHNOLOGY DATABASE MANAGEMENT. A database is a collection of information organized to provide efficient retrieval. The collected information.
DAY 9: DATABASES Rohit February 17,
Access Lessons 1, 2 and 3 ©2009 M and K Solutions, LLC – All Rights Reserved.
Copyright © it’sLearning 365. All rights reserved. DATABASE CONCEPTS Understanding Databases Start …
Normalisation Unit 6: Databases. Just to recap  What is an Entity  What is an Attribute?
DATABASES Define Software that can hold large amounts of data and allow users to retrieve specific information quickly. (Access, Oracle, etc.) Data is.
N5 Databases Notes Information Systems Design & Development: Structures and links.
Database Relationships
Our world depends on databases
Component 2 5A-F.
IGCSE 4 Cambridge Designing a database table Computer Science
Lesson 10 Databases.
Prepared By: Bobby Wan Microsoft Access Prepared By: Bobby Wan
Fundamentals of Database
Databases Chapter 9 Asfia Rahman.
Databases Key Revision Points.
GO! with Microsoft Office 2016
CHAPTER 7 DATABASE ACCESS THROUGH WEB
Creating a Database Microsoft Access.
Databases Chapter 16.
Normalisation Ham Ham’s Hammy Club.
Database Systems Unit 16.
Database Concepts Relational Databases Start ….
GO! with Microsoft Access 2016
Mr C Johnston ICT Teacher
Database Relationships
Database Management  .
Database Design ERD and Normalisation
PHP and MySQL.
What is a Database? A collection of data organized in a manner that allows access, retrieval, and use of that data.
Databases Software This icon indicates the slide contains activities created in Flash. These activities are not editable. For more detailed instructions,
Databases Explained Reports © Dolinski 2007.
INTRODUCING DATABASES
Using a database.
Let’s Learn About Spreadsheets
Database Normalisation
Database Relationships
Flat Files & Relational Databases
Spreadsheets, Modelling & Databases
A Very Brief Introduction to Relational Databases
ICT Database Lesson 2 Designing a Database.
Introducing a Database
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.
Information system analysis and design
Presentation transcript:

Databases Explained Tables © Dolinski 2007

What you will learn What a database is What a table is How tables are structured Difference between a flat file database and a relational database

What is a database? A database is like a filing cabinet. You can store records about different things inside a filing cabinet, just like in a database! They are used by all organisations to keep records about stock, personnel, projects and lots more.

Why use databases? Databases make storing information a lot easier. Files are stored in an organised way. Files can be searched quickly. You can merge database software with other software: Mail merging is a way of extracting information from a database to speed up a process such as writing a letter to lots of people.

What is a database made of? Primarily – A database is made up of tables. A table looks a lot like a spreadsheet. The only difference is YOU decide how many rows and columns there are.

What is a table? A table will hold lots of records. The table is like a draw inside a filing cabinet. Each draw holds a different kind of record.

What is a table? For example, a table may hold information about all the members of a video rental shop.

Where can you find a database? Your mobile phones have a database built into them… Your address book has a single table which stores information about people’s telephone numbers!

How do tables work? Every table is made up of rows and columns. A column represents a piece of data. A row is a collection of data. This collection makes up information. This collection of information is known as a record.

Data Types Each piece of data must have a Data Type. These include: Auto number Text Number Date/Time Yes/No

Member table data types This table contains the following data types: MemberID – Auto Number FirstName – Text LastName – Text DOB – Date/Time HouseNo – Text PostCode – Text Mobile - Text

Why are some numbers text? Think about Excel. What would happen if you type in the number 021? How would it be displayed? Number data types should be used if you are going to be performing a calculation with the data.

Questions What are the data types for the following things? A unique number A name A birthday A telephone number A postcode Someone’s Height in cm A field which indicates if someone has paid for their order.

How are tables linked? Tables are linked using relationships. Relationships work by having a common piece of data in both tables.

A dog is a man’s best friend! A man can own many dogs. A dog can be a friend to only one man.

How are tables involved? A table is used to store records about a particular thing. In this case we need two tables: OWNER DOG Each table needs to have its own data.

OWNER table DOG table OwnerID Name DogID 01 Bill D01 D02 02 Nancy D03 Breed D01 Turnip Bulldog D02 Spot Poodle D03 Pooch

OWNER table DOG table OwnerID Name DogID 01 Bill D01 D02 02 Nancy D03 We can cross reference to see who owns which dog! DogID Name Breed D01 Turnip Bulldog D02 Spot Poodle D03 Pooch

OWNER table DOG table OwnerID Name DogID 01 Bill D01 D02 02 Nancy D03 We can cross reference to see who owns which dog! DogID Name Breed D01 Turnip Bulldog D02 Spot Poodle D03 Pooch

OWNER table DOG table OwnerID Name DogID 01 Bill D01 D02 02 Nancy D03 Repeated attributes aren’t very good. If Bill’s name changed then we would have to change ALL the records for bill. How can we fix this? DOG table DogID Name Breed D01 Turnip Bulldog D02 Spot Poodle D03 Pooch

The solution. Add a third table Owner Owns Dog Now if we change a name it wont affect any other table. OwnerID Name 01 Bill 02 Nancy OwnerID DogID 01 D01 D02 02 D03 DogID Name Breed D01 Turnip Bulldog D02 Spot Poodle D03 Pooch

Students and their classes A student has many lessons. A lesson has many students. This is a many-to-many relationship. A problem with many-to-many relationship is that data can be duplicated many times within one table… Something we already know we need to avoid.

Many-to-Many problem Student Lesson We have lots of repeated data…boo! StudentID Name ClassID 01 Wilkinson ICT Maths German 02 Masters Art French LessonID Teacher StudentID ICT Dolinski 01 02 Maths Wade Art Cooper German White French Conner

Fixing the many-to-many Add a third table! Student Stu_Les Lesson StudentID Name 01 Wilkinson 02 Masters StudentID LessonID 01 ICT Maths German 02 Art French LessonID Teacher ICT Dolinski Maths Wade Art Cooper German White French Conner

Things to remember A table must have a primary key. A primary key must be unique…only one record can have it. The primary key is used to link to a foreign key in another table. The foreign key is the primary key the linking table.

Student Lesson Example The primary key for students is their ID. The foreign key is in the Stu_Les table. Student Stu_Les Lesson StudentID Name 01 Wilkinson 02 Masters StudentID LessonID 01 ICT Maths German 02 Art French LessonID Teacher ICT Dolinski Maths Wade Art Cooper German White French Conner

Student Lesson Example The primary key for students is the ID. The foreign key is in the Stu_Les table. Student Stu_Les Lesson StudentID Name 01 Wilkinson 02 Masters StudentID LessonID 01 ICT Maths German 02 Art French LessonID Teacher ICT Dolinski Maths Wade Art Cooper German White French Conner

Student Lesson Example The combination of these two keys makes a unique primary key (or compound key). Student Stu_Les Lesson StudentID Name 01 Wilkinson 02 Masters StudentID LessonID 01 ICT Maths German 02 Art French LessonID Teacher ICT Dolinski Maths Wade Art Cooper German White French Conner

Student Lesson Example Although we have some repeating data, it is minimised. What is the other benefit of having our tables like this? Student Stu_Les Lesson StudentID Name 01 Wilkinson 02 Masters StudentID LessonID 01 ICT Maths German 02 Art French LessonID Teacher ICT Dolinski Maths Wade Art Cooper German White French Conner