COMP3311 22T3 ♢ Overview ♢ [0/26]
COMP3311 Database Systems
(If Webcms3 is unavailable, try http://www.cse.unsw.edu.au/~cs3311/22T3/)
COMP3311 22T3 ♢ Overview ♢ [1/26]
Every significant computer application involves Large Data.
This needs to be:
- stored (typically on a disk device)
- manipulated (efficiently, usefully)
- shared (by many users, concurrently)
- transmitted (all around the Internet)
Green stuff handled by databases;
blue by networks.
Challenges in building effective databases:
efficiency, security, scalability, maintainability,
availability, integration, new media types (e.g., music), ...
COMP3311 22T3 ♢ Overview ♢ [2/26]
❖ Databases: Important Themes | |
The field of databases deals with:
- data ... representing application scenarios
- relationships ... amongst data items
- constraints ... on data and relationships
- redundancy ... one source for each data item
- data manipulation ... declarative, procedural
- transactions ... multiple actions, atomic effect
- concurrency ... multiple users sharing data
- scale ... massive amounts of data
COMP3311 22T3 ♢ Overview ♢ [3/26]
❖ What is Data? What is a Database? | |
According to the Elmasri/Navathe textbook ...
- Data = known recorded facts, with implicit meaning
- e.g. a student's name, a product id, a person's address or birthday
- Database = collection of related data, satisfying constraints
- e.g. a student is enrolled in a course, a product is sold at a store
- DBMS = database management system
- software to manage data, control access, enforce constraints
- RDBMS = relational database management system
- e.g. PostgreSQL, SQLite, Oracle, SQL Server, MySQL, ...
COMP3311 22T3 ♢ Overview ♢ [4/26]
❖ Studying Databases in CSE | |
COMP3311 introduces foundations & technology of databases
- skills: how to build database-backed applications
- theory: how do you know that what you built was good
After COMP3311 you can go on to study ...
-
COMP9313: managing Big Data
(Hadoop, Spark, NoSQL techniques)
-
COMP9315: how to build relational DBMSs
(write your own PostgreSQL)
-
COMP9318: techniques for data mining
(discovering patterns in DB)
-
COMP9319: Web data compression and search
(XML data)
-
COMP6714: information retrieval, web search
(dealing with text data)
-
COMP9321: data services
(making data available via a network)
COMP3311 22T3 ♢ Overview ♢ [5/26]
Core syllabus ...
- Data modelling and database design
- ER model, ODL, ER-to-relational
- Relational model (design theory, algebra)
- Database application development
- SQL, views, stored procedures, triggers, aggregates
- SQLite:
sqlite3 (an SQL shell)
- PostgreSQL:
psql (an SQL shell),
PLpgSQL (procedural),
- Programming language access to databases
(Python, ORMs)
The
brown stuff is not covered in tutes/pracs and is not examinable
COMP3311 22T3 ♢ Overview ♢ [6/26]
❖ Syllabus Overview (cont) | |
More syllabus ...
- Database management systems (DBMSs)
- DBMS architecture: query processing, index structures
- Transaction processing: transactions, concurrency control, recovery
- Future of Databases
- Limitations of RDBMS's, potential future technologies
Blue and
green stuff is covered only briefly, and is not examinable
To learn more about the green stuff, take COMP9313, ...
To learn more about the blue stuff, take COMP9315, ...
COMP3311 22T3 ♢ Overview ♢ [7/26]
We assume that you ...
- have experience with procedural programming
- have some background in data structures
- hopefully, have some knowledge of Python
You might have acquired this background in
- COMP1511, COMP1531, COMP2521
If you don't know Python, look at some online tutorials soon.
e.g. https://www.python.org/about/gettingstarted/
COMP3311 22T3 ♢ Overview ♢ [8/26]
Stuff that is available for you:
- Textbooks: describe most syllabus topics in detail
- Topic Videos: summarize all syllabus topics
- Lectures: brief summary, work through examples
- Tutorial sessions: theory/prac questions (+ solutions)
- Prac exercises: lab-like exercises
- Assignments: more detailed practical exercises
- Quizzes: periodic progress check
COMP3311 22T3 ♢ Overview ♢ [9/26]
❖ Teaching/Learning (cont) | |
On the course website, you can:
- find out the latest course news
(important annoucements will also be emailed)
- view the topic-based slides/videos
- get details of tute/prac exercises
- get assignment specs/material
- do the quizzes
- get your questions answered (via the Forums)
URL:
https://webcms3.cse.unsw.edu.au/COMP3311/22T3/
(If Webcms3 is unavailable, try http://www.cse.unsw.edu.au/~cs3311/22T3/)
COMP3311 22T3 ♢ Overview ♢ [10/26]
2-hour live lectures on Monday 12-2, Tuesday 2-4
Lectures will be recorded but not live-streamed
Different lecture enrolments
- 1UGA (Ritchie Th) = I plan to attend live lectures
- 1UGB (Online) = I do not plan to attend live lectures
Note: Ritchie Th holds ~200 students, course has ~600 students
COMP3311 22T3 ♢ Overview ♢ [11/26]
Two assignments, which are critical for learning
- SQL/PLpgSQL, 15%, due end week 5, beer database
- Python/SQL/psycopg2, 20%, due end week 9, movie database
All assignments are done
individually, and ...
- submitted via
give
or Webcms3
- automarked (so you must follow specifcation exactly)
- plagiarism-checked (copying solutions ⇒ 0 mark for assignment)
- rent-a-coder monitored (buying solutions ⇒ exclusion)
COMP3311 22T3 ♢ Overview ♢ [12/26]
Six quizzes, each worth 4 marks
- cover material in previous few weeks lectures
- aim to check your understanding of recent material
- done via Webcms3 in your own time
- primarily multiple-choice
- held in weeks 2, 3, 4, 7, 8, 10
- released Monday 9am, due Friday midnight
- can be submitted multiple times
- answers released on following Monday
COMP3311 22T3 ♢ Overview ♢ [13/26]
Marking
- marked automatically by Webmcs3
- penalties for late submission
- 0 marks if submitted after answers released
- total available = 6×4 = 24
- total scored quiz marks = Q
- final quizzes mark = Q × 15 / 24
If you have special consideration for a quiz
- total scored quiz marks = Q' from 5 quizzes
- final quizzes mark = Q' × 15 / 20
COMP3311 22T3 ♢ Overview ♢ [14/26]
The Final Exam includes questions on ...
- SQL, PLpgSQL, (Python), design exercises, analyses
- 50% prac questions, 50% "theory" questions
In-lab, closed-book exam exam during exam period
- exam runs for 3 hours
- all questions typed in and submitted online (
give
)
Offshore students will sit invigilated exam offshore
Sample exam will be available on the course website in Week 10
COMP3311 22T3 ♢ Overview ♢ [15/26]
❖ Supplementary Assessment Policy | |
Everyone gets exactly one chance to pass the Exam
If you attempt the Exam
- I assume that you are fit/healthy enough to take it (fit-to-sit)
- no second chance exams, even with a medical certificate
All Special Consideration requests:
- must document how you were affected
- must be submitted to UNSW (useful to email lecturer as well)
Supplementary Exams are held ... (maybe) in mid-January!
COMP3311 22T3 ♢ Overview ♢ [16/26]
Your final mark/grade will be determined as follows:
quizzes = mark for on-line quizzes (out of 15)
ass1 = mark for assignment 1 (out of 15)
ass2 = mark for assignment 2 (out of 20)
exam = mark for final exam (out of 50)
okExam = exam >= 20 (after scaling)
mark = ass1 + ass2 + quizzes + exam
grade = HD|DN|CR|PS if mark >= 50 && okExam
= FL if mark < 50 && okExam
= UF if !okExam
COMP3311 22T3 ♢ Overview ♢ [17/26]
- Elmasri, Navathe
Fundamentals of Database Systems (7th ed, 2016)
- Garcia-Molina, Ullman, Widom
Database Systems: The Complete Book (2nd ed, 2008)
- Ramakrishan, Gehrke
Database Management Systems (3rd ed, 2003)
- Silberschatz, Korth, Sudarshan
Database System Concepts (7th ed, 2019)
- Kifer, Bernstein, Lewis
Database Systems: Application-Oriented Approach (2nd ed, 2006)
Earlier editions of texts are ok
COMP3311 22T3 ♢ Overview ♢ [18/26]
❖ Database Management Systems | |
Two example DBMSs for prac work:
- SQLite (open-source, free, no server needed)
- PostgreSQL (open-source, free, full-featured)
Comments on using a specific DBMS:
- the primary goal is to learn SQL (a standard)
- the specific DBMS is not especially important **
- but, each DBMS implements non-standard features
- we will use standard SQL as much as possible
- PG docs describe all deviations from standard
** Unless it seriously violates SQL standards ... I mean you, MySQL
COMP3311 22T3 ♢ Overview ♢ [19/26]
❖ Further Reading Material | |
The on-line documentation and manuals provided with:
Some comments on technology books:
- tend to be expensive and short-lived
- many provide just the manual, plus some examples
- generally, anything published by O'Reilly is useful
Aside: once you understand the concepts, the documentation is sufficient
COMP3311 22T3 ♢ Overview ♢ [20/26]
Software versions that we'll be running this semester (TBC):
- PostgreSQL 12/13, SQLite 3.x, Python 3.7+, 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:
- use
vlab
to log in to the d2
server in a terminal window
Details on setting up a PostgreSQL server are in the first Prac Exercise.
COMP3311 22T3 ♢ Overview ♢ [21/26]
How to access the d2
server
- from Vlab:
ssh YourUserName@nw-syd-vxdb2
- from Home:
ssh YourUserName@d2.cse.unsw.edu.au
On the
d2
server you have
- your standard CSE directories
- a special directory
/localstorage/YourUserName/
The actual hostname of the
d2
server is
nw-syd-vxdb2
More details on how to set up PostgreSQL in first Prac Exercise
COMP3311 22T3 ♢ Overview ♢ [22/26]
❖ Overview of the Databases Field | |
COMP3311 22T3 ♢ Overview ♢ [23/26]
❖ Database Application Development | |
A variation on standard software engineering process:
- analyse application requirements
- develop a data model to meet these requirements
- check data model for redundancy (using relational theory)
- implement the data model as relational schema
- define operations (transactions) on this model
- implement operations via SQL and procedural PLs
- construct a program interface to these operations
- monitor performance and "tune" the schema/operations
At some point, populate the database
(may be via interface)
During the course, we consider these in the order 2, 4, 6, 7, 3
COMP3311 22T3 ♢ Overview ♢ [24/26]
❖ Database System Architecture | |
The typical environment for a modern DBMS is:
SQL queries and results travel along the client↔server links
COMP3311 22T3 ♢ Overview ♢ [25/26]
❖ Database System Architecture (cont) | |
SQLite is not a client-server system:
Although it does have an API for use from programming languages.
COMP3311 22T3 ♢ Overview ♢ [26/26]
Produced: 11 Sep 2022