Presentation is loading. Please wait.

Presentation is loading. Please wait.

Section 1.1: Slide 1 of 24 Introduction to Relational Databases.

Similar presentations


Presentation on theme: "Section 1.1: Slide 1 of 24 Introduction to Relational Databases."— Presentation transcript:

1 Section 1.1: Slide 1 of 24 Introduction to Relational Databases

2 Section 1.1: Slide 2 of 24 Database: An Introduction l What is Data? l What is a Database/DBMS? l What is SQL? l Why Use Computers?

3 Section 1.1: Slide 3 of 24 Why Use Computers? l To do calculations. What computers were originally built to do. ‘Computer’ = ‘Calculator’. Examples: scientific calculations, decypher codes. l To ‘switch’ communication links. Examples: telephone exchanges, route computer data on networks. l To store data. Examples: names and addresses, electricity account details.

4 Section 1.1: Slide 4 of 24 What is Data ? l Numbers l Dates l Pictures l Videos l Text l Maps l Audio l etc. 1, -99, 1,035,758 14 January 2001 ‘A3*=<32’ Might wish to store all of these kinds of data about something. Example : species of bird. Number of birds observed, textual description of characteristics, dates of observations, map of migration routes, pictures of birds, audio recording of bird calls, video of flight.

5 Section 1.1: Slide 5 of 24 Logical Data and Physical Data Logical Data Character Field Record File Physical Data Bit Byte Word Block Area

6 Section 1.1: Slide 6 of 24 Logical Data NameTelRoomemailHrs Black, Paul3637D100cmu55 Taylor, Ian3667P203cmu515 Bennet, Carol3384E202ciz90 Evans, Dave3667E200ciz810 Borthwick, Brenda4750E200ciz80 Jenkins, Haydn3643D314ciz515 Wooley, Adrian4726D314ciz65 NameTelRoomemailHrs Black, Paul3637D100cmu55 Taylor, Ian3667P203cmu515 Bennet, Carol3384E202ciz90 Evans, Dave3667E200ciz810 Borthwick, Brenda4750E200ciz80 Jenkins, Haydn3643D314ciz515 Wooley, Adrian4726D314ciz65 NameTelRoomemailHrs Black, Paul3637D100cmu55 Taylor, Ian3667P203cmu515 Bennet, Carol3384E202ciz90 Evans, Dave3667E200ciz810 Borthwick, Brenda4750E200ciz80 Jenkins, Haydn3643D314ciz515 Wooley, Adrian4726D314ciz65 NameTelRoomemailHrs Black, Paul3637D100cmu55 Taylor, Ian3667P203cmu515 Bennet, Carol3384E202ciz90 Evans, Dave3667E200ciz810 Borthwick, Brenda4750E200ciz80 Jenkins, Haydn3643D314ciz515 Wooley, Adrian4726D314ciz65 NameTelRoomemailHrs Black, Paul3637D100cmu55 Taylor, Ian3667P203cmu515 Bennet, Carol3384E202ciz90 Evans, Dave3667E200ciz810 Borthwick, Brenda4750E200ciz80 Jenkins, Haydn3643D314ciz515 Wooley, Adrian4726D314ciz65

7 Section 1.1: Slide 7 of 24 Relationships Between Data l Bird example showed that we store items of data (= facts). l Not just interested in isolated items of data. Want to know relationships between the data items. Example : species of bird Which bird numbers, descriptions, etc relate to which bird species ? Useful to know which birds have similar migration routes. l All sorts of relationships possible : some essential to make sense of data, some useful for different purposes.

8 Section 1.1: Slide 8 of 24 Quantities of Data Amounts of data may be large or small: l Example (small) : names and addresses of members of a golf club (say 500 members). l Example (large) : electricity company stores all customers’ account details (say name & address, a/c no., meter reading, amount owed, payment method, …. ; 1,000,000 customers). l Example (very large) : supermarket stores customer purchase details for analysis (say average 10 purchases × 1000 customers × 400 stores × 355 days × 5 years = 7.1 billion purchase details).

9 Section 1.1: Slide 9 of 24 What is a Database ? Definition: “A collection of data that is permanently stored”. In a database we should be able to have : l data items of different types, l relationships between data items, l different sized data collections.

10 Section 1.1: Slide 10 of 24 Computerised Databases What is the benefit of a computerised database (= DB) compared to a manual paper-based collection of data ? l Compact. Less bulky than filing cabinets. l Speedy. Computer can retrieve and change data faster than a human being. l Less drudgery. Removes tedium. l Current. Easier to ensure data is up-to-date.

11 Section 1.1: Slide 11 of 24 A Shared Computerised Database Some databases are shared by several/many users. Then there are further benefits : l Consistency. All users have the same data. l Centralised management. The data collection can be properly managed on behalf of the whole organisation. Sharing consistent and well-managed data is much easier to achieve if the database is computerised.

12 Section 1.1: Slide 12 of 24 Database Management Systems l Need special software to manage the DB if the benefits are to be obtained. l Don’t want to have to write our own computer programs to do this. Therefore buy a Database Management System (= a DBMS). A DBMS should provide the means to : l change the DB contents to keep them up-to-date; l find and retrieve data from the DB; l protect the data from accidents and intruders; l store it in an efficient way on the computer.

13 Section 1.1: Slide 13 of 24 DBMS l DataBase Management System l A body of software which manages a database l Examples of commercial DBMSs l MS Access l Oracle l Foxpro l Each manages Relational Databases l Relational DBMSs

14 Section 1.1: Slide 14 of 24 DBMS In order to provide these facilities and obtain the benefits, a DBMS should provide the following : l A Data Description Language (= DDL). A means of telling the DBMS what sort of data to store. Example: For each species of bird, store the number of birds observed, a description of their characteristics,..... l A Data Manipulation Language (= DML). Has two tasks : l Manipulation : to specify the data of interest. Example: the migration route of the ‘great white swift’. l Action : what to do with the specified data. Example: retrieve it, only permit certain users to see it.

15 Section 1.1: Slide 15 of 24 DBMS A DBMS Manages: l Access l Everything to do with physical access to data Stored Database

16 Section 1.1: Slide 16 of 24 DBMS A DBMS Manages: l Security l Who has what sort of access: read, write, read/write Stored Database

17 Section 1.1: Slide 17 of 24 A DBMS Manages: l Integrity l Completeness l Consistency l Dealing with System Failure l Synchronisation l Multi-processing l Simultaneity

18 Section 1.1: Slide 18 of 24 Relational DBMS Why relational ? Because : l relational DBMSs are based on simple mathematical principles; l so they are easy to learn and use, and can be very powerful and flexible. Therefore : l they are the most common type of database (over 90% of the market); l they are very important in practice.

19 Section 1.1: Slide 19 of 24 What is SQL? l Structured Query Language l A Language for communicating with a Relational DBMS l... and a Data Manipulation Language (DML) l Provides a Data Definition Language (DDL)...

20 Section 1.1: Slide 20 of 24 Data Definition in SQL CREATE TABLE EMP ( EMP_NO CHAR(3), EMP_NAME CHAR(20), SALARY INTEGER); EMP NOEMP NAMESALARY E01Jim Jones24000 E02Jane Doe32000 E10Helen Smith35000... INSERT INTO EMP VALUES(“E01”, “Jim Jones”,24000);

21 Section 1.1: Slide 21 of 24 Data Manipulation in SQL SELECT EMP_NAME,SALARY FROM EMP WHERE SALARY > 25000 ORDER BY SALARY DESCENDING; EMP NAMESALARY Helen Smith35000 Jane Doe32000

22 Section 1.1: Slide 22 of 24 Review Note the following key points from the introduction and ensure you focus on them in the following material : l The need for a DBMS to cope with different kinds of data, relationships between data, and different volumes of data. l The benefits of a computerised DB. l A DBMS should provide an effective DDL and DML, in order to provide an optimal way of storing data on a computer. Read Chapter 1 in the set text - Elmasri/Navathe, Fundamentals of Database Systems 2nd edition, Addison Wesley or Read Chapter 1 in the text – Date, An Introduction to Database Systems 7 th edition, Addison Wesley.

23 Section 1.1: Slide 23 of 24 Summary l Data l Physical Data l Logical Data l Database l A Definition l DBMS l Functions l SQL

24 Section 1.1: Slide 24 of 24 Exercises Here is an Exercise that you should try,Exercise based on the material covered in this topic. When you have performed the exercise, you will be given a solution to look at.


Download ppt "Section 1.1: Slide 1 of 24 Introduction to Relational Databases."

Similar presentations


Ads by Google