INFO90002 Week1-2 DatabasesIntro
INFO90002 Week1-2 DatabasesIntro
This material has been reproduced and communicated to you by or on behalf of the
University of Melbourne pursuant to Part VB of the Copyright Act 1968 (the Act).
The material in this communication may be subject to copyright under the Act.
Any further copying or communication of this material by you may be the subject
of copyright protection under the Act.
2
Learning Objectives
Difference between data and information
Unstructured/Semi-structured/Structured data
Problems with flat files
Database and DBMS – not the same!
Relational DBMS
Client server architecture
Database development lifecycle and importance of database design
3
Context: software and data
4
The Modern Data Challenge
Modern organisations need to store and retrieve
large amounts of data
• handwritten notes
• printed books
• spreadsheets
(semi-structured?)
etc.
6
Unstructured Data
Unstructured data is not organised in a pre-defined manner.
The organisation does not know the format, nor the content of the data in advance.
Consider data sourced from social media, email, etc. The contents are unpredictable.
• The data may contain text, audio, video, links, images. One item may include many data
about many organisational functions.
How do organisations store such data so that it can be retrieved, collated, analysed?
7
Semi-Structured Data
Semi-structured data is information that doesn't match the requirements of a relational
database.
We will briefly deal with the topic of semi-structured data in future weeks
8
Structured Data
Relational Database Management Systems require data to be stored in a very structured
way.
These systems deal with data that has a repetitive pattern or format.
Consider Student data stored by a University. While every student is different, the
university wants to store data in the same format for every student. Data Types are also
specified for each piece of information.
• Student ID – Numeric/Digits HomeAddress - Alphanumeric
• Student Name – Alpha PhoneNo – Numeric or Digits+space+brackets
• Gender – Alpha NextOfKin – Alpha
• DateOfBirth – Date
9
File Processing
13
Client-
Server
Architecture
Introduction to MySQL Server
and MySQL Workbench
Identifier first line
Second line
14
RDBMS and Database Servers
A database server is a computer that is networked to other computers
The database server stores databases
Users on the network can access the data stored in the databases
RDBMSs allow multiple users on the network to update data in database tables.
• Many people can check the price of product 20
• Many people may choose to enroll in INFO90002 simultaneously
• Many users may purchase tickets for a flight at the same time
15
Client Server – In Industry
Server computer
DBMS application / web server
(database management
system)
Client computers
Database DBMS Web
client admin tool browser,
SAP client
16
… in teaching (and development)
info90002db.eng.unimelb.edu.au 127.0.0.1 (local host)
VPN
18
Relational Data Model
RDBMSs are based on the Relational Data Model
• Developed by Ted Codd in 1970.
• Data is represented in the form of two-dimensional tables.
All Relational Database Management Systems are based on the Relational Data Model. 19
Relational Data Model (cont.)
Table
20
Relational Databases
A relational database is a collection of related tables
The relational model’s foundation is a mathematical concept known as a relation
• A relation is a two-dimensional structure composed of intersecting rows and columns
– Imagine it as a table
• Each row in a relation is called a tuple and each column represents an attribute
Example:
• Student Table (stores data about students)
• Subject Table (stores data about university subjects)
• Enrolment Table (stores data about a student’s enrolment into a specific subject in a
specified year and semester)
21
RDBMS
A RDBMS is a collection of programs that allow developers / users to store
and retrieve data from relational databases
It allows users to perform CRUD (create, read, update and delete) operations
on data in the tables, e.g.
• Create a student record
• Retrieve the student's details
• Update the student's details
• Delete the student from a table
22
Setting up a RDBMS
Tables
• Follow a 2-dimensional structure
• Each row of data is identified by a unique Primary Key
• No duplicates, e.g. Student ID
23
Case Study - Overview
Let's consider a business called Pizza OnLine
24
Case Study - Customer Details
Customers need to supply personal details:
• Name
• Address
• Credit Card No
25
Case Study – Order Details
The Order Form
• This is One order.
• The customer may add multiple items and
different quantities.
26
Case Study - Customer Details
Add any delivery instructions that are required for the order:
27
Case Study – The completed Order
This Order is for
Customer C2045.
Order No Date Time Delivery Total Code Pizza name Price Quan
Instructions tity
3224 1/09/2021 17:35 The bell does 59.55 P1 Mario’s 6.95 2
not work, Supreme Pizza
3224 1/09/2021 17:35 The bell does 59.55 P3 Hawaiian Pizza 6.95 1
not work,
3224 1/09/2021 17:35 The bell does 59.55 P4 Hot ‘n’ spicy 6.95 1
not work, Pizza
Problems:
• Order details repeated for every pizza ordered
• How do we link the order to the customer? 29
Tables in the Pizza Online Database
Customer ID Surname First name Address Postcode Credit card
C2045 Smith Fred 1 John St, Hawthorn 3122 1234234534564567
C2048 Nguyen Vincent 2/7 Oak Ave, Altona 3018 4554123423457899
C2146 Davis Liz 32 Lyle St, Toorak 3142 4564564578970022
31
Manipulating Table Contents
Customer ID Surname First name Address Postcode Credit card
C2045 Smith Fred 1 John St, Hawthorn 3122 1234234534564567
C2048 Nguyen Vincent 2/7 Oak Ave, Altona 3018 4554123423457899
C2146 Davis Liz 32 Lyle St, Toorak 3142 4564564578970022
32
Database lifecycle
34
Database Development Lifecycle
Database Design
Database Planning • Planning how to do the
Conceptual Design project.
Systems Definition • How does the
Logical Design enterprise work
Requirements Definition
and Analysis
• Enterprise data
Physical Design model
• How can the stages be
Application Design
completed efficiently and
effectively.
Requirements Analysis
Physical Design
Application Design
Operational
Implementation
Maintenance
Operational
Implementation
Maintenance
Application Design
• Mostly outside scope of
the course, but briefly
discussed in the Web
Operational Apps lecture
Implementation
Maintenance
Application Design
Operational
Implementation
Maintenance
Operational
Implementation
Maintenance
Systems Definition
Logical Design
Application Design
Warning
This material has been reproduced and communicated to you by or on behalf of the
University of Melbourne pursuant to Part VB of the Copyright Act 1968 (the Act).
The material in this communication may be subject to copyright under the Act. Any
further copying or communication of this material by you may be the subject of
copyright protection under the Act.