Session 8: Databases Teaching Computing to GCSE Level with Python.

Slides:



Advertisements
Similar presentations
Database Management Using Microsoft Access Xinhua Chen, Ph.D. Chinese Association of Professionals in Science and Technology March 23, 2003.
Advertisements

Organisation Of Data (1) Database Theory
A Guide to SQL, Seventh Edition. Objectives Understand the concepts and terminology associated with relational databases Create and run SQL commands in.
“DOK 322 DBMS” Y.T. Database Design Hacettepe University Department of Information Management DOK 322: Database Management Systems.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Database Design Concepts Info1408
Chapter 12 Information Systems. 2 Chapter Goals Define the role of general information systems Explain how spreadsheets are organized Create spreadsheets.
Relational Databases What is a relational database? What would we use one for? What do they look like? How can we describe them? How can you create one?
Information systems and databases Database information systems Read the textbook: Chapter 2: Information systems and databases FOR MORE INFO...
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Database Software Application
Database Design IST 7-10 Presented by Miss Egan and Miss Richards.
Transaction Processing Systems, & Management Information Systems.
Chapter 4 Relational Databases and Enterprise Systems
Databases & Data Warehouses Chapter 3 Database Processing.
PHASE 3: SYSTEMS DESIGN Chapter 7 Data Design.
GCSE Computing The Database concept
2.3 Organising Data for Effective Retrieval
Unit 18: Database Modelling
ASP.NET Programming with C# and SQL Server First Edition
Chapter 1 Overview of Database Concepts Oracle 10g: SQL
CST203-2 Database Management Systems Lecture 2. One Tier Architecture Eg: In this scenario, a workgroup database is stored in a shared location on a single.
Simple Database.
1 Chapter 1 Overview of Database Concepts. 2 Chapter Objectives Identify the purpose of a database management system (DBMS) Distinguish a field from a.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
CHAPTER 8: MANAGING DATA RESOURCES. File Organization Terms Field: group of characters that represent something Record: group of related fields File:
Database Management. ICT5 Database Administration (DBA) The DBA’s tasks will include the following: 1. The design of the database. After the initial design,
Lecture 2 An Overview of Relational Database IST 318 – DB Admin.
HNDComputing – DeMontfort University  DeMontfort University 2011 Database Fundamentals wk2 Database Design ConceptsDatabase Design Concepts Database Design.
Management Information Systems MS Access MS Access is an application software that facilitates us to create Database Management Systems (DBMS)
Data Modelling. ICT5 Introduction Historical development with most organisations Small-scale origins Individual computers bought for particular applications.
DAY 12: DATABASE CONCEPT Tazin Afrin September 26,
1.file. 2.database. 3.entity. 4.record. 5.attribute. When working with a database, a group of related fields comprises a(n)…
MS Access 2007 Management Information Systems 1. Overview 2  What is MS Access?  Access Terminology  Access Window  Database Window  Create New Database.
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
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.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management
Database Management Supplement 1. 2 I. The Hierarchy of Data Database File (Entity, Table) Record (info for a specific entity, Row) Field (Attribute,
Database Management Systems (DBMS)
Information Systems Today: Managing in the Digital World TB3-1 3 Technology Briefing Database Management “Modern organizations are said to be drowning.
BSA206 Database Management Systems Lecture 2: Introduction to Oracle / Overview of Database Concepts.
IST 220 – Intro to Databases Lecture 2 Touring Microsoft Access.
Instructor: Pavlos Pavlikas1 How Data is Stored Chapter 8.
Chapter 13.3: Databases Invitation to Computer Science, Java Version, Second Edition.
UNIVERSITI TENAGA NASIONAL “Generates Professionals” MODULE 5 : Part 1 INTRODUCTION TO DATABASE.
Sample Table Standard Notation Entity name in uppercase
Presentation on Database management Submitted To: Prof: Rutvi Sarang Submitted By: Dharmishtha A. Baria Roll:No:1(sem-3)
The Database Concept and the Database Management System (DBMS) Databases.
Copyright © it’sLearning 365. All rights reserved. DATABASE CONCEPTS Understanding Databases Start …
1 Management Information Systems M Agung Ali Fikri, SE. MM.
Database (Microsoft Access). Database A database is an organized collection of related data about a specific topic or purpose. Examples of databases include:
1 Section 1 - Introduction to SQL u SQL is an abbreviation for Structured Query Language. u It is generally pronounced “Sequel” u SQL is a unified language.
Introduction to Database Programming with Python Gary Stewart
Lesson 10 Databases.
Query Methods Simple SQL Statements Start ….
IST 220 – Intro to Databases
Databases Chapter 16.
Database Concepts Relational Databases Start ….
Databases and Information Management
Databases.
Databases and Information Management
Computer Science Projects Database Theory / Prototypes
Database Design Hacettepe University
Spreadsheets, Modelling & Databases
The ultimate in data organization
A Very Brief Introduction to Relational Databases
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.
Presentation transcript:

Session 8: Databases Teaching Computing to GCSE Level with Python

Topics today Databases theory  Databases  Using SQL Programming in Python with sqlite

Programming warm up (optional) Task Write a function to convert from pounds to euros that takes two parameters, the number of pounds and the exchange rate. The function will convert pounds to euros and return the number of euros. Extension Write a main() function that will ask the user to enter the number of pounds and the exchange rate and then will call the function you wrote above and then output the answer.

From the specification OCR Candidates should be able to: (a)describe a database as a persistent organised store of data (b)explain the use of data handling software to create, maintain and interrogate a database. (c)separation of data from applications and why this is desirable (d)describe the principal features of a DBMS and how they can be used to create customised data handling applications. (e)understand the relationship between entities and tables (f)understand the components of a relational database, such as tables, forms, queries, reports and modules AQA  know how to read and write data from an external database in a way that is appropriate for the programming language(s) used and the problem being solved  understand the basic concepts of a relational database as a data store  be able to explain the terms record, field, table, query, primary key, relationship, index and search criteria  be able to create simple SQL statements to extract, add and edit data stored in databases  have experience of using these SQL statements from within their own coded systems  be able to use databases from within their own web based applications

What is a database? A database is a collection of related data, organised such that efficient data processing may be carried out on the data contained in it. The software used to control access to the data is known as a Data Base Management System (DBMS)

Relational Database  A collection of tables similar to the one above CarRegMakeModelColourYear AB02ERTPeugeot206Silver2002 AG51DRTFordFocusGreen2001

Terminology Quiz – these are the answers!  Field  Table  Report  SQL  Index  Entity  Query  Module  Relationship  Primary Key  Record  Form

Definitions (or clues) to follow There are 10 questions – write down the terms

A unique field of a record which is used to identify that record.

An object, person, event or thing of interest of an organisation about which data is to be held

Setting criteria to extract particular data from a database

A feature of database software used to view and enter data

A collection of fields describing one instance in a table

The name of a column of data stored in a table

A feature of database software used to produce output from a database

The implementation of an entity in a database

A link or association between two entities.

Storage of an ordered list of key values

A standard language used to describe and query data in a database.

Answers!

An Example Data Dictionary for Contact(Surname, FirstName, Title, Street, Town, PostCode, TelNo)

Relationship lA relationship is a link or association between two entities

Types of Relationship lOne-to-one lHusband and Wife lPerson and Guide Dog lOne-to-many lMother and Children lBorrower and Library book lMany-to-many lStudent and Course lFilm and Film Star

Entity - Relationship Diagrams one - to - one one - to - many many - to - many

Enitity-Relationship Diagrams Specify both degree and name of relationship Blind Person Guide Dog

Enitity-Relationship Diagrams The name of a relationship helps to establish its degree Blind PersonGuide Dog owns has

Enitity-Relationship Diagrams WardPatient The name of a relationship helps to establish its degree

Enitity-Relationship Diagrams WardPatient holds/has is The name of a relationship helps to establish its degree

Enitity-Relationship Diagrams WardPatient The name of a relationship helps to establish its degree

Enitity-Relationship Diagrams Patient

Enitity-Relationship Diagrams Patient attacks suffers from has

Enitity-Relationship Diagrams attacks suffers from has Patient Illness Many-to-many relationship

Many to Many relationships  The tables that make up a relational database cannot represent many-to- many relationships  A many-to-many relationship can be removed by creating a link entity  The link entity’s identifier (primary key) will often be made up of the original entities’ identifiers

Removing many-to-many  E.g. Student and course STUDENTCOURSE Create a link table Create a link table STUDENTCOURSE ENROL

Removing many-to-many  Using the table notation Student( StudentID, Surname, DOB) Course( CourseID, CourseName, Level)  With the link table Student( StudentID, Surname, DOB) Course( CourseID, CourseName, Level) Enrol( StudentID, CourseID)

QBE Example: The query is applied to the student table: The result of the query is

Structured Query Language  A standard language used to extract data from a database. More flexible and powerful than QBE and database independent.  Key commands for selecting data  SELECT  FROM  WHERE  ORDER BY 37

Structured Query Language To create a table CREATE TABLE To insert data INSERT INTO VALUES

Create Table create table customer( customerID integer, firstName text, lastName text, dateOfBirth text, primary key (customerID))

TASK: sqLite Browser sqLiteBrowser is open source software that works with sqlite It can be downloaded from herehere We use it prior to using Python and sqLite3 to give some familiarity with SQL first It can be a bit ropey so write your SQL in a text file first! – and then paste in. Use Sqlite to test the examples on the next three slides then experiment with different types of SELECT statement

Create Table create table car( carReg text, make text, model text, yearOfReg integer, primary key (carReg))

INSERT INTO INSERT INTO car (carReg, make, model, yearOfReg) Values ("MF59 YXS","Hyundai","i20",2009)

SELECT.. FROM.. WHERE SELECT CarReg, Make FROM Car WHERE YearOfReg=2009

BREAK Python and sqlite3