1 / 13

Relational Database

Relational Database. Need to Knows. Data - is just a pile of numbers or stats.  A business "organises" the data to be meaningful and help make decisions.  Database (DB) – brings “order” to the data using relationships. What is a database?. It is a DB with 1 table only

amalia
Download Presentation

Relational Database

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. Relational Database Need to Knows

  2. Data - is just a pile of numbers or stats.  • A business "organises" the data to be meaningful and help make decisions.  • Database (DB) – brings “order” to the data using relationships. What is a database?

  3. It is a DB with 1 table only • An excel spreadsheet is an example of a flat file database. • It stores information in columns and rows. • Column – a field or entity e.g. customer name or date of birth; • Row – a record e.g. a customer • Table – a collection of columns and rows e.g. customers What’s a Flat File database?

  4. Column vs Row

  5. Typical spreadsheet that shows Sales Reps, their hourly rates and email details. • Note – Column e.g. Name; Row e.g. Ayla’s name, pay rate and email address. Flat File Example

  6. What if you wanted to track the Sales Reps projects they were working on, and hours? • We could add two more columns e.g. Job Description and Job Hours. • If Carla does 3 different projects, we’d need to enter her 3 times in the spreadsheet. Flat File cont…

  7. Redundancy – the same data duplicated in multiple places e.g. Carla’s email address. • What if this flat file had 1000 records, and she changed her email address? • Inefficient way to keep track of data using a single table Problems?

  8. Use two tables to track the same information – Sales Rep table that stores all information about the Sales Reps. • Then create a second Job Table to track all the jobs the sales reps do. • Decreases redundancy because if her email or pay rate change, just change it in the one place i.e. customer table. Better solution?

  9. Anomalies – what happens if I accidentally delete Carla from the Sales rep table? • In a flat file DB like this spreadsheet, there is no “integrity” checks to make sure “orphan” entries don’t happen. • To avoid Anomalies, Redundancy and to improve data efficiency, use a Relational Database. Problem?

  10. Entity – A table should be a collection of data about a single “entity” or “theme” e.g. customer; employee; orders; • Field – the column headings that describe the entity e.g. customer firstname; customer lastname; DOB; Email; Phone; • Data Type – specifies what type of data can be stored in a field e.g. Number or Text. From Flat File to Relational:

  11. Look at this spreadsheet, what “entities” or tables could you pull from this data? • Clue – look at fields/columns that duplicate information. Identifying Entities…

  12. Possible Entities / Tables

  13. Now try and write what fields and their types you’d have under each table. • When you have had these ticked off by Miss, look at the information in the assessment task on the wiki, and complete Database Design Task 1a) • You can either use the sample data in the task, OR your own club/information. What Fields and Types?

More Related