INTRODUCTION TO DATABASE Lecture #1
25.02.2025
SYSTEMS Ketevan Grigalashvili
THE ROLE OF DATABASES IN MODERN
SOFTWARE ARCHITECTURES
Software architecture is the high-level structure of a
software system, defining its components,
interactions, and design principles to ensure
scalability, maintainability, and performance.
Databases are a key part of this because they store,
organize, and manage all the important data.
MAIN TERMINOLOGY AND CONCEPTS
SQL (Structured Query Language) – A standardized programming language used to manage
and manipulate relational databases;
Server – A system or an engine, which is used to give user the necessary access to the
database, web site or applications;
Database – Structured and organized set of data, which we can access, manage and update;
Database object – A database object in SQL Server refers to the defined structure that
contains data or metadata;
SQL Query/Script – A command or a set of commands to interact with the database;
Transaction – A sequence of one or more database operations (such as inserting, updating, or
deleting data) that are executed as a single unit;
Schema – A way to organize the tables and objects within the database.
WHAT IS SQL SERVER?
SQL Server is Microsoft's relational database management system (RDBMS)
First version - SQL Server 1.0 (1989); last version - SQL Server 2022 (2024)
SQL SERVER MANAGEMENT STUDIO
(SSMS)
A tool to manage SQL Server and the databases as well as write T-SQL code.
3 types of encryption:
Mandatory – always uses the encryption, required by law or policy;
Optional – doesn’t necessarily use the encryption, mostly is used with legacy systems;
Strict – uses the strong and advanced encryption algorithms, can be applied selectively (is
available for SQL Server 2022).
Authentication types:
Windows Authentication;
SQL Server Authentication.
MAIN SHORTCUTS IN SSMS
For the results set:
Ctrl+C – copy results;
Ctrl+Shift+C – copy results with their headers;
Ctrl+A – select the entire results set;
Ctrl+Space – select the column;
Shift+Space – select the row.
For the query/script:
Ctrl+F – find a word/text/combination;
Ctrl+H – replace a word/text/combination.
TYPES OF DATABASE OBJECTS
1) Tables – the fundamental building blocks of a database. They store data in rows
and columns, where each row represents a record and each column represents a field
in that record;
2) Views – virtual tables that provide a way to present data from one or more
tables;
3) Stored Procedures – precompiled SQL statements that can be executed to
perform a specific task. They allow for reusable code, contain business logic, and can
accept parameters;
4) Functions – similar to stored procedures but are used primarily for calculations and
can return a value;
5) Indexes – improve the performance of queries by allowing SQL Server to find
rows more quickly;
6) Triggers – special types of stored procedures that automatically execute in
response to specific events on a table.
DATA TYPES
Numeric: INT – for integer numbers, FLOAT – for decimal numbers;
Date&Time: DATE; DATETIME; TIME;
String: CHAR – Latin characters (‘Character’), fixed number of bytes;
NCHAR – Non-Latin characters (‘National Character’), fixed number of bytes;
VARCHAR – Latin characters (‘Variable Character’), maximum number of
bytes (can differ for values in a field);
NVARCHAR – Non-Latin characters (‘National Variable Character’), maximum
number of bytes (can differ for values in a field).
TYPES OF INT
UNDERSTANDING NULL VALUES
A field with a NULL value is a field with no value. If a field in a
table is optional, it is possible to insert a new record or update a
record without adding a value to this field.
Note: A NULL value is different from a zero value or a field that
contains spaces. A field with a NULL value is one that has been left
blank during record creation.
DATA DEFINITION LANGUAGE VS DATA
MANIPULATION LANGUAGE
DDL is a Data Definition Language that is used to define data
structures. For example: creating a table, and altering a table are
instructions in SQL.
DML is a Data Manipulation Language that is used to manipulate
data itself. For example, inserting, updating, removing, and
retrieving data from a database.