COMP3311 Week 1 Tuesday Lecture
COMP3311 23T1 ♢ Week 1 Tuesday Lecture ♢ [0/22]
COMP3311 23T1
Database Systems
https://webcms3.cse.unsw.edu.au/COMP3311/23T1/
COMP3311 23T1 ♢ Week 1 Tuesday Lecture ♢ [1/22]
| |
Name: | | John Shepherd |
Email: | | cs3311@cse.unsw.edu.au |
Consults: | | TBA |
Roles: | | Convenor, COMP3311 23T1 Deputy Head of School (edu) |
Research: | |
Information Extraction
Information Retrieval
e-Learning Technologies
Multimedia Databases
|
Extras: | | GABS, AFL, KD, NW |
|
What to call me? jas, John, Dr Shepherd, Your Majesty
COMP3311 23T1 ♢ Week 1 Tuesday Lecture ♢ [2/22]
| |
Name: | | Dylan Brotherston |
Email: | | cs3311@cse.unsw.edu.au |
Roles: | | COMP3311 23T1 Admin COMP1521 23T1 Admin |
|
Despite the picture, Dylan is not a bat
COMP3311 23T1 ♢ Week 1 Tuesday Lecture ♢ [3/22]
Many, many students ⇒ many tutors ...
- Carly Lim
- Dylan Brotherston
- Evan Krul
- Jason Gong
- Kyu-sang Kim
- Manhua Lu
|
|
- Max Xue
- Minyi Zhong
- Ronan Davis
- Shirley Zhou
- William Feng
- Yifan He
|
COMP3311 23T1 ♢ Week 1 Tuesday Lecture ♢ [4/22]
❖ How COMP3311 23T1 will run | |
Sources of information:
- content videos (Slides and Videos) ... primary content
- lectures (Lecture Material) ... summarises content + examples
- Course Notes ... more detailed version of content video slides
- textbooks ... most detailed version of topics
Activities:
- lectures ... work though (new) examples, ask questions
- tutorials ... work through exercises, ask questions
- prac exercises ... learn the systems and skills
- assignments ... practice your skills
- exam ... demonstrate your knowledge/skills
COMP3311 23T1 ♢ Week 1 Tuesday Lecture ♢ [5/22]
❖ How COMP3311 23T1 will run (cont) | |
Classes:
- lectures ... live, recorded but not live-streamed
- tutorials ... mainly live (f2f), some online, starting week 2
- exam ... in-lab, invigilated 3-hour exam (no offshore/at-home)
Note on lecture enrolments:
- 1UGB = I plan to attend live lectures (CLB6)
- WEB = I do not plan to attend live lectures
Not everyone can attend live: CLB6 holds ~200, Class is ~600
COMP3311 23T1 ♢ Week 1 Tuesday Lecture ♢ [6/22]
❖ Know your course website | |
Access via
https://webcms3.cse.unsw.edu.au/COMP3311/23T1/
- Home: where Notices and Upcomings appear
- Course Outline: the "contract"
- Timetable: info on tutors and locations for tutorials
- Slides and videos: short-form, topic based videos
- Lectures: slides, videos and exercise solutions
- Tute Exercises: questions and, eventually, answers
- Course Notes: more detailed slides (incl. optional material)
- Activities: quizzes and polls
COMP3311 23T1 ♢ Week 1 Tuesday Lecture ♢ [7/22]
Software versions that we'll be running this semester (TBC):
- PostgreSQL 13, SQLite 3.x, Python 3.9+, psycopg2 2.8+
If you install them at home:
- get versions "close to" these
- test all work at CSE before submitting
Alternative to installing at home:
- log in to the
vxdb2
server in a terminal window and work there
COMP3311 23T1 ♢ Week 1 Tuesday Lecture ♢ [8/22]
How to access the vxdb2
server
- from Vlab:
ssh YourUserName@nw-syd-vxdb2
- from Home:
ssh YourUserName@d2.cse.unsw.edu.au
On the
vxdb2
server you have
- your standard CSE directories
- a special directory
/localstorage/YourUserName/
The actual hostname of the
vxdb2
server is
nw-syd-vxdb2
The only software you should run on vxdb2
is PostgreSQL (no vscode)
COMP3311 23T1 ♢ Week 1 Tuesday Lecture ♢ [9/22]
❖ Exercise: Play with vxdb2 | |
Login to vxdb2
Find your /localstorage
directory
Set up your environment
Install your PostgreSQL server
Explore the files in your PostgreSQL server
More details on doing this are in Prac Exercise 02.
COMP3311 23T1 ♢ Week 1 Tuesday Lecture ♢ [10/22]
Aims of data modelling:
- describe what information is contained in the database
(e.g., entities: students, courses, accounts, branches, patients, ...)
- describe relationships between data items
(e.g., John is enrolled in COMP3311, Tom's account is held at Coogee)
- describe constraints on data
(e.g., 7-digit IDs, students can enrol in no more than 3 courses per term)
Data modelling is a design process
- converts requirements into a data model
COMP3311 23T1 ♢ Week 1 Tuesday Lecture ♢ [11/22]
Consider the following while working through exercises:
- start simple ... evolve design as problem better understood
- identify objects (and their properties), then relationships
- most designs involve kinds (classes) of people
- keywords in requirements suggest data/relationships
(rule-of-thumb: nouns → data, verbs → relationships)
- don't confuse operations with relationships
(operation: he buys a book; relationship: the book is owned by him)
- consider all possible data, not just what is available
COMP3311 23T1 ♢ Week 1 Tuesday Lecture ♢ [12/22]
❖ Exercise: Course Outline Data Model | |
Imagine that we wante a database of course outlines.
Work out requirements by looking at real course outlines.
Develop an informal data model for it by identifying:
- the data items involved (objects and their attributes)
- relationships between these data items
- constraints on the data and relationships
COMP3311 23T1 ♢ Week 1 Tuesday Lecture ♢ [13/22]
❖ Exercise: Instagram Data Model | |
Consider Instagram (photos, videos, viewers)
Develop an informal data model for it by identifying:
- the data items involved (objects and their attributes)
- relationships between these data items
- constraints on the data and relationships
COMP3311 23T1 ♢ Week 1 Tuesday Lecture ♢ [14/22]
❖ Exercise: GMail Data Model | |
Consider the
GMail system (or any other modern mail client)
Develop an informal data model for it by identifying:
- the data items involved (objects and their attributes)
- relationships between these data items
- constraints on the data and relationships
COMP3311 23T1 ♢ Week 1 Tuesday Lecture ♢ [15/22]
❖ Entity-Relationship Data Modelling | |
The world is viewed as a collection of inter-related entities.
ER has three major modelling constructs:
- attribute:
data item describing a property of interest
- entity:
collection of attributes describing object of interest
- relationship:
association between entities (objects)
The ER model is not a standard, so notational variations exist
Lecture notes use notation from SKS and GUW books (simple)
COMP3311 23T1 ♢ Week 1 Tuesday Lecture ♢ [16/22]
❖ Entity-Relationship (ER) Diagrams | |
ER diagrams are a graphical tool for data modelling.
An ER diagram consists of:
- a collection of entity set definitions
- a collection of relationship set definitions
- attributes associated with entity and relationship sets
- connections between entity and relationship sets
Terminology abuse:
- we say "entity" when we mean "entity set"
- we say "relationship" when we mean "relationship set"
- we say "entity instance" to refer to a particular entity
Key = set of attributes that uniquely identifies each entity instance
COMP3311 23T1 ♢ Week 1 Tuesday Lecture ♢ [17/22]
❖ Entity-Relationship (ER) Diagrams (cont) | |
Example ER diagram:
COMP3311 23T1 ♢ Week 1 Tuesday Lecture ♢ [18/22]
❖ Entity-Relationship (ER) Diagrams (cont) | |
Example of attribute notations:
COMP3311 23T1 ♢ Week 1 Tuesday Lecture ♢ [19/22]
❖ Exercise: Relationship Semantics | |
Describe precisely the semantics of the following relationships:
COMP3311 23T1 ♢ Week 1 Tuesday Lecture ♢ [20/22]
Using the ER diagram below
- give examples of entity values
- describe the semantics of the relationships
COMP3311 23T1 ♢ Week 1 Tuesday Lecture ♢ [21/22]
For each of the informal data models
- course outline
- Instagram
- Gmail
give a suitable ER diagram
COMP3311 23T1 ♢ Week 1 Tuesday Lecture ♢ [22/22]
Produced: 14 Feb 2023