Presentation is loading. Please wait.

Presentation is loading. Please wait.

COMU114: Introduction to Database Development 1. Databases and Database Design.

Similar presentations


Presentation on theme: "COMU114: Introduction to Database Development 1. Databases and Database Design."— Presentation transcript:

1 COMU114: Introduction to Database Development 1. Databases and Database Design

2 Teaching staff Jim Paterson Room M628 James.Paterson@gcal.ac.uk COMU114 Introduction to Database Development 1. Databases and Database Design #2

3 Online resources Blackboard Announcements Assessment information www.paterson.co.uk/gcal/intro2db.html Lecture notes, lab & tutorial sheets, etc Links to other resources COMU114 Introduction to Database Development 1. Databases and Database Design #3

4 Reading No set text – notes will be provided The following books may be useful additional reading: Beginning Database Design: From Novice to Professional (Clare Churcher, Apress, ISBN 1- 59059-769-9) Head First SQL (Lynn Beighley, O'Reilly, ISBN 0- 596-52684-9) Many other books on databases and SQL in the library COMU114 Introduction to Database Development 1. Databases and Database Design #4

5 What is a database? Any collection of data can be described as a database Computerised database systems are now very commonplace Information is stored in a database every time we: use a bank account book a travel ticket make an appointment with a doctor etc. COMU114 Introduction to Database Development 1. Databases and Database Design #5

6 Database mangement systems A database is simply the collection of data which you need to store To actually store the data, and to do anything useful with it, you need a Database Management System (DBMS) A DBMS controls the way the data is stored on the computer, and provides ways of getting data in and out of the system COMU114 Introduction to Database Development 1. Databases and Database Design #6

7 Data models The way in which data is organised for storage in a database is known as the data model Early computer databases developed in the 1960’s used a hierarchical model Similar to the way files and folders are still organised in modern computer file systems Most data does not fit very well into a simple hierarchy COMU114 Introduction to Database Development 1. Databases and Database Design #7

8 Data models Hierarchical data “Real-world” data – no clear hierarchy COMU114 Introduction to Database Development 1. Databases and Database Design #8

9 Relational databases Complex data like this is better handled with the relational model Devised by Edgar Codd around 1970 Most databases nowadays are relational databases although there are others: object databases, XML databases A database management system which uses the relational model is called an RDBMS COMU114 Introduction to Database Development 1. Databases and Database Design #9

10 Databases and Enterprise Information Systems COMU114 Introduction to Database Development 1. Databases and Database Design #10

11 Simpler architecture Commonly used for smaller systems Doesn’t scale well Can be harder to maintain COMU114 Introduction to Database Development 1. Databases and Database Design #11 work of Business tier is distributed between other tiers

12 Popular RDBMSs Microsoft Access aimed at small businesses, and useful for desktop applications and systems with a small number of users Oracle scalable and secure, and widely used by large organisations MySQL open-source and quite powerful, widely used in web sites JavaDB a compact DBMS written in Java, and suitable for mobile devices in particular...and many more COMU114 Introduction to Database Development 1. Databases and Database Design #12

13 RDBMS tools Most RDBMSs include tools to create complete application, for example: form designers – to allow data entry forms to be created for the user interface report designers – to present data to the user stored procedures – to perform processing of data according to business rules COMU114 Introduction to Database Development 1. Databases and Database Design #13

14 RDBMS and other tools Can use your RDBMS and its tools for everything, or Can use the RDBMS as a component and use other tools and programming languages to create the other components For example the GCUTours case study: data entry forms and reports are created as web pages business logic uses Java COMU114 Introduction to Database Development 1. Databases and Database Design #14

15 SQL – the language of relational databases To develop applications which use relational databases you usually need to use SQL Structured Query Language This is the language which is used to define queries A query is a request to a DBMS for some specific information Relational databases are sometimes referred to as SQL databases COMU114 Introduction to Database Development 1. Databases and Database Design #15

16 SQL example SQL queries can be quite easy to understand For example, the following query finds the last name of all the customers in a database: SELECT lastName FROM Customers; SQL can also be used to add, update or delete data, and to build the database in the first place COMU114 Introduction to Database Development 1. Databases and Database Design #16

17 SQL standards SQL is supposed to be a standard language which is supported by all RDBMSs In fact, you need to be careful because there are some important differences between the versions of SQL used by different systems Different versions of SQL standards (SQL92, SQL99,etc.) Different implementations by RDBMS vendors COMU114 Introduction to Database Development 1. Databases and Database Design #17

18 Designing a database A well-designed database helps to make sure that the data stored is accurate and consistent and can be retrieved easily What do we mean by inconsistencies? It would, for example, be inconsistent to store a booking without storing the details of the customer making the booking With careful design, we can make sure the database won’t allow this to happen COMU114 Introduction to Database Development 1. Databases and Database Design #18

19 Steps in designing a database Determining the intended uses of the system Creating a data model Implementing the database COMU114 Introduction to Database Development 1. Databases and Database Design #19

20 The domain model Data model = domain model COMU114 Introduction to Database Development 1. Databases and Database Design #20

21 Data modelling techniques We are using object-oriented techniques with UML to design our data model There are other methods which are also commonly used in database design One widely used method is called Entity Relationship Modelling (ERM) Represents the data model as an Entity Relationship Diagram (ERD) COMU114 Introduction to Database Development 1. Databases and Database Design #21

22 From data model to database Need to consider how the data model can be represented in a specific RDBMS This requires some further design RDBMS software has specific ways of representing and enforcing the entities, attributes and relationships in the data model For example, a data model entity is represented as a table in the relational database COMU114 Introduction to Database Development 1. Databases and Database Design #22

23 Representing the data model in an RDBMS COMU114 Introduction to Database Development 1. Databases and Database Design #23

24 Different representations business tier for example as Java classes and objects business logic in Java methods database tier data is stored permanently in a database system queries database to get data it needs to carry out a particular action The system needs to map data from database tables to classes COMU114 Introduction to Database Development 1. Databases and Database Design #24


Download ppt "COMU114: Introduction to Database Development 1. Databases and Database Design."

Similar presentations


Ads by Google