You are on page 1of 28

Бази даних і засоби

управління
Lecture 1. Introduction
Teacher
Petrashenko Andrii Vasilyovich, Ph.D., associate professor - lectures,
laboratory work. Email: petrashenko@gmail.com
Students
Попередня робота:

1) Зареєструватись на Gmail: використовуйте українське ім’я та


прізвище (наприклад., Андрій Петрашенко).
2) Використовуйте цю GMail-адресу у ВСІХ активностях
дисципліни (Classroom, Google Forms)
3) Створити обліковий запис та репозиторій Git на github.com або
bitbucket.org для збереження там коду лабораторних робіт.
4) Приєднайтесь до групи Telegram, перегляньте своє ім’я та прізвище!
5) Приєднайтесь до Google Classroom
Discipline: organizational issues
Organization of discipline:

1. Lectures: on Tuesdays at 12:20 - Zoom (link in Telegram)


2. Laboratory classes: on Thursdays (me: КV-03, KV-04, V.I.Pavlovsky: KV-01,
KV-02) using Zoom and Telegram group
3. Calculation of the final rating:

Laboratory works: 3x20 = 60 points

Tests: 4x10 = 40 points (monthly at lectures - 45 minutes)

Total: 100 points


Laboratory works
Assignments for laboratory work can be obtained at Google Classroom

Delivery dates:

LR№1: 01.10.2022, LR№2: 01.11.2022, LR№3: 01.12.2022

Protection procedure:

1. Sending a student work report to the Google Classroom.


2. The teacher checks and evaluates the work, if necessary, discusses the
results with the student by Email, Zoom, telegram.
Requirements for laboratory work
1. File type - Google Docs
2. Content:
● General task.
● Option of the student's task.
● Screenshots according to the task.
● Answers to control questions.
● Other requirements (see task).
1. Performance evaluation:
● Correspondence of the presented results to the task (0-16 points).
● Report quality (0-3 points).
● Penalty points for untimely defense.
● +1 point for early protection (two weeks before the end of the term)
● Maximum number of points for laboratory work: 20.
Tools used in Database Course
Database server: PostgreSQL
Database GUI: pgAdmin4
Programming language: Python
Database language: SQL
IDE: PyCharm Community Edition, Visual Studio Code

Корисні ресурси з дисципліни:


https://docs.google.com/document/d/1pMpSvVqBBb6M1sBF6O-ybkWdSXyOaj
QdRYUY69Zi3Gw/
Attendance
Use this form to confirm your presence at a lecture
Discipline: general information
Databases
Customer and
business analyst Programmer Administrator
(developer) (dev-ops)

Design Programming Optimization

Modeling "Entity- Creating and


Query and
relationship", data debugging queries
performance
schema and its SQL, triggers, views,
optimization etc.
normalization etc.
Discipline: topics of lectures (1)
Lecture topics:

1. Introduction. History, basic concepts and functions of databases and


DBMS (database management systems). Classification of data models.
2. Information and logic modeling as the first step to efficient data
representation in a computer.
3. Relational model as a formal apparatus for building modern relational
databases. Constraints and relational algebra.
4. SQL language (DDL, DML, DTL) as a language tool for access to data
structures (eg, tables) and the actual data (rows) in the database.
Discipline: lectures (2)
Lecture topics:

5. Normalization of the data scheme as a tool to avoid data redundancy.


6. PostgreSQL data schema objects: tables, views, triggers, functions and
others as an extension of the "purely relational" capabilities of the
database.
7. Transactions as a tool for sharing data. ACID properties, transaction
isolation levels. Data blocking strategies.
8. Indexes as means of accelerating the execution of SQL queries. Types of
indexes, algorithms. Ways to organize data files.
Discipline: topics of lectures (3)
Lecture topics:

9. Approaches to automatic query optimization (EXPLAIN command). Ways


of organization of joins in relational DBMS.
10.Partitioning tables as a means of reducing the amount of data that
processed.
11.Replication as a means of increasing the reliability of data storage.
12.Distributed databases. NoSQL (non-relational databases) as a tool for
processing extra large (peta-bytes) data volumes. Big Data.
Discipline: topics of laboratory work
Topics of laboratory works:

1. Design and development of a database (selection of subject area, creation


of ER-diagram (www.draw.io), conversion into a tabular representation of
the PostgreSQL database, normalization of the data scheme and filling
with data using pgAdmin4. (The assignment is here)
2. Creating a database console application by means of language Python.
Basic CRUD operations (create, read, update and delete).
3. ORM. Objects of the PostgreSQL schema: view, trigger, function, as well as
the study of transaction isolation levels.
Lecture 1. Definition
A database is an organized collection of data, generally stored and accessed
electronically from a computer system. Where databases are more complex
they are often developed using formal design and modeling techniques.

Database - set of data, which describes the subject area and the
relationship between their elements (simplified).

The database management system (DBMS) is the software that interacts


with end users, applications, and the database itself to capture and analyze
the data. The DBMS software additionally encompasses the core facilities
provided to administer the database. Examples of DBMS are PostgreSQL,
Oracle, MS SQL Server, redis, MongoDB, etc.
Brief history (data-information-
knowledge)
1960s: the first data models: network (CODASYL) and hierarchical (IMS), linear
files. Feature of all: the dependence of data structures on physical media.

1970s: relational model (E. Codd) - the independence of the logical model
(subject area) from the implementation in the computer.

1976: The “entity-relationship” model, which allowed the “non-specialist


customer” to separate the essential elements of his subject area.
1980s: Structured Query Language (SQL) - the main language for accessing
data
1990-2000: era of automated database programming tools, Internet
databases
2010-2020: NoSQL, Machine Learning, Big Data, Data Science. - the era of
knowledge.
DBMS rating 2021
Monthly DBMS rating according to their popularity and mention on the
Internet:
DBMS rating 2022
Monthly DBMS rating according to their popularity and mention on the
Internet:

https://db-engines.com/en/ranking
Data model
The ability of the database to process data from various subject areas is
ensured by the presence of a universal formal (mathematical) presentation of
information - a data model.

Data model allows to separate the most essential aspects of the subject area:

- meaningful objects (entities) and relations (links) between them,


- constraints and basic operations on specified objects.

Examples of database models are relational (object - relationship, operations


- union, intersection, Cartesian product, etc.), hierarchical (in particular, based
on the XML family of languages), object-oriented (based on the principles of
object-oriented programming), graphs, key-value etc
An example of a subject area
Data model - the most significant objects of the subject area, restrictions,
operations.

Example of the description of the subject area "University" in terms of model:

Objects: (faculties, accounting, personnel department, dormitories, sports


complex, palace of culture). What is most important for the problem to be solved:
student assessments or the personnel department? ..

Limitation (constraints): faculties include departments, specialties, groups,


students. The student studies in only one group, etc.

Operations: CRUD + statistics by faculties, groups; by months, weeks, days, the


best, the worst ...
Presentation of the database in the form of
files
CSV data model: XML data model:

Faculty of IT; CT-31; Petrenko PS <? xml version = "1.0" encoding = "UTF-8"?>
<root>
Faculty of IT; CT-31; Vitenko VV <row>
Faculty of IT; CT-32; Palchenko AA <FIELD1> Faculty of IT </FIELD1>
<FIELD2> CT-31 </FIELD2>
Faculty of IT; CT-32; Sidorenko KS <FIELD3> Petrenko PS </FIELD3>
</row>
... <row>
Faculty of RT; RP-31; Maslov AR <FIELD1> Faculty of IT </FIELD1>
<FIELD2> CT-31 </FIELD2>
... <FIELD3> Vitenko VV </FIELD3>
</row>
<row>
<FIELD1> Faculty of IT </FIELD1>
<FIELD2> CT-32 </FIELD2>
<FIELD3> Palchenko AA </FIELD3>
</row>
...
</root>
Relational approach

Student's Name Group Group Faculty


number
KT-31 IT
1 Petrenko KT-31
KT-32 RT
2 Palchenko KT-31
... ..
3 Sidorenko KT-32

... .. ...

Data integrity ("connectivity"), reduction of redundancy


Document and graph model
{
"root": {
"row": [
{
"FIELD1": "Faculty of IT", Vitenko
"FIELD2": "KT-31",
Petrenko
"FIELD3": "Petrenko PS"
},
{
"FIELD1": "Faculty of IT",
"FIELD2": "KT-31",
"FIELD3": "Vitenko VV" Palchenko
},
...] ......
}
}
22
Files or databases?
It is necessary to consider:

● Redundancy.
● Integrity control, for example, connections between entities.
● Ability to adapt to changes in requirements (functional and non-
functional).
● The speed of processing large amounts of data.
● Simultaneous access.
● Reliability of storage and recovery after failures.

Conclusion: the simplest DBMS (for example, Sqlite) is better than files
Classification of data models
Infologic (closest to the human), for example, Entity-Relationship or ER-
diagrams

Datalogic (relational, key-value, graph, document, object-oriented, etc.).

Physical (organization of data files).


Levels of data abstraction
External (representation for the user depending on access rights, usually in a
visual form: tables, graphs, charts).

Conceptual / logical (data representation in the database, data schema, data


access language, such as SQL).

Physical (presentation of data on media: RAM, hard disk, tape, SSD; ways to
organize files, indexes, etc.).

Most DBMSs work on this modular principle


DBMS structure
RDBMS are

1.Oracle
2.MySQL
3.Microsoft SQL Server
4.PostgreSQL
5.DB
6.SQLite
7.Sybase
8.Tera data
9.Firebird
RDBMS concept

RDBMS - Relational
Database management
system
Conclusion
Advantages of using DBMS:

● DBMS is used for maintenance and processing of large data sets.


● Benefits include: fail recovery, concurrent access, fast application
development, data integrity, and security.
● Levels of abstraction provide data independence.
● The database usually has a multilayer architecture.
● Database developers hold positions of responsibility and are well paid.
● Databases are one of the promising areas of IT in the Web, the Internet of
Things (IoT), artificial intelligence, processing of large data and more.

You might also like