This document provides an introduction and overview of graph databases. It begins with trends in data becoming bigger, more connected, and semi-structured. It then discusses NoSQL databases like key-value stores, column families, and document databases. Graph databases are introduced as optimized for interconnected data with nodes and relationships. Neo4j is presented as a graph database with an explicit graph structure and property graph model. Examples of using Cypher and Gremlin to query a graph are provided.
The document discusses modeling techniques in UML and ORM. It compares how UML and ORM represent various modeling concepts such as associations, attributes, constraints. It notes that while UML has become dominant, ORM allows representing some concepts like n-ary associations and constraints in a more precise way. The document also discusses modeling concepts in UML like generalization/specialization, associations, attributes.
This document provides an overview of cryptography and its applications. It discusses the history of cryptography beginning in ancient Egypt. It defines basic cryptography terminology like plaintext, ciphertext, cipher, key, encryption, decryption, cryptography, and cryptanalysis. It describes classical ciphers like the Caesar cipher and substitution ciphers. It also discusses cryptanalysis techniques, transposition ciphers, modern symmetric ciphers, public key cryptography including RSA, key distribution methods, and hybrid encryption.
2. Faculty of Information Technology
Nguy畛n Mai Huy
nmhuy@ntt.edu.vn
01
Th畉o lu畉n + BT (10%)
Ki畛m tra gi畛a k畛 (30%)
Thi t畛 lu畉n (60%)
03
T鱈n ch畛: 3
L箪 thuy畉t: 30 ti畉t
Th畛c hnh: 30 ti畉t
Bi t畉p: TH + 畛 nh
02
際際滷 Bi gi畉ng
Ti li畛u tham kh畉o
(Cu畛i slide)
04
3. Nguy畛n Mai Huy Master of Information technology
Overview of the subject
T畛ng quan v畛 DBMS
DML Commands
(Insert into, Update, Delete, )
DDL Commands
(Create, Alter, Drop, )
Select command
(Wild card, Filter, Order, )
4. Nguy畛n Mai Huy Master of Information technology
Overview of the subject
Select command
(Join, Group, Having, )
Triggers
(After or For, Instead of)
Views
Functions
(Built-in, User-define)
5. Nguy畛n Mai Huy Master of Information technology
Overview of the subject
Stored Procedure
(Control-of-flow statements)
n t畉p, gi畛i h畉n KT
Stored Procedure
(Cursors, Handling Exceptions)
Thi ki畛m tra cu畛i h畛c k畛
7. Nguy畛n Mai Huy Master of Information technology
SQL: "Ng担n ng畛 truy v畉n d畛 li畛u c坦 t鱈nh c畉u tr炭c" - l lo畉i ng担n ng畛 l畉p tr狸nh cho m叩y t鱈nh, ph畛c
v畛 cho c叩c m畛c 鱈ch: T畉o, S畛a, v L畉y d畛 li畛u t畛 m畛t h畛 qu畉n tr畛 c董 s畛 d畛 li畛u quan h畛 (DBMS -
Database Management System).
Th叩ng 6 nm 1970, t畉p ch鱈 Communications of the ACM c担ng b畛 m担 h狸nh A Relational Model of
Data for Large Share Data Banks ("M担 h狸nh quan h畛 cho d畛 li畛u d湛ng trong ng但n hng d畛 li畛u chia
s畉 c坦 kh畛i l動畛ng l畛n") c畛a ti畉n s挑 Edgar F. Codd, m担 h狸nh ny sau 坦 達 動畛c ch畉p nh畉n r畛ng r達i
v 動畛c xem l m担 h狸nh ti棚u chu畉n d湛ng cho h畛 th畛ng qu畉n l箪 c董 s畛 d畛 li畛u quan h畛.
Gi畛a nh畛ng nm 1970, m畛t nh坦m chuy棚n gia thu畛c trung t但m nghi棚n c畛u c畛a IBM t畉i San Jose ph叩t
tri畛n h畛 th畛ng c董 s畛 d畛 li畛u "H畛 th畛ng R" d畛a tr棚n m担 h狸nh c畛a Codd, l畉y t棚n l Structured
English Query Language, vi畉t t畉t l "SEQUEL" ("Ng担n ng畛 truy v畉n c坦 c畉u tr炭c d畛a tr棚n ti畉ng
Anh"), ng担n ng畛 ny 動畛c thi畉t k畉 畛 qu畉n l箪 v truy xu畉t d畛 li畛u l動u tr畛 trong H畛 th畛ng R. Sau
ny, t棚n vi畉t t畉t SEQUEL 動畛c r炭t g畛n thnh SQL 畛 tr叩nh vi畛c tranh ch畉p nh達n hi畛u (t畛 SEQUEL
達 動畛c m畛t c担ng ty m叩y bay c畛a UK l Hawker-Siddeley ng k箪 tr動畛c 坦).
M畉c d湛 SQL b畛 畉nh h動畛ng b畛i c担ng tr狸nh c畛a ti畉n s挑 Edgar F. Codd nh動ng n坦 l畉i 動畛c thi畉t k畉 b畛i
Donald D. Chamberlin v Raymond F. Boyce t畉i IBM.
History
8. Nguy畛n Mai Huy Master of Information technology
SQL 動畛c th畛a nh畉n l ti棚u chu畉n c畛a ANSI (American National
Standards Institute) vo nm 1986 v ISO (International Organization for
Standardization) nm 1987. ANSI 達 c担ng b畛 c叩ch ph叩t 但m ch鱈nh th畛c c畛a
SQL l "ess kyoo ell", nh動ng r畉t nhi畛u c叩c chuy棚n gia c董 s畛 d畛 li畛u n坦i
ti畉ng Anh v畉n g畛i n坦 l "SEQUEL".
History
Nm T棚n T棚n kh叩c Ch炭 gi畉i
1986 SQL-86 SQL-87
動畛c c担ng b畛 畉u ti棚n b畛i ANSI. 動畛c ph棚
chu畉n b畛i ISO nm 1987.
1989 SQL-89 Thay 畛i nh畛.
1992 SQL-92 SQL2 Thay 畛i l畛n.
1999 SQL:1999 SQL3
2003 SQL:2003
9. Nguy畛n Mai Huy Master of Information technology
Data Definition Language DDL (is used to define data structures stored in
the database. DDL statements allow to create, modify or destroy individual database objects.
Object types allowed depend on the DBMS used, and usually include databases, users, tables
and some smaller housekeeping objects like roles and indexes.)
Data Manipulation Language DML ( is used to query and change data
stored in the database. DML statements allow to select, insert, update and delete data in the
tables. Sometimes pure select statements are not classified as part of DML, since they dont
change the state of the data. All SQL DML statements are declarative.)
(CRUD: Create Retrieve Update Delete)
Create insert
Retrieve Read: select
Update Modify: update
Delete Destroy: delete
Types of sub-language in SQL
10. Nguy畛n Mai Huy Master of Information technology
Data Control Language DCL ( is used to control access to data stored in the
database. DCL statements operate with privileges and allow to grant and revoke privileges on
applying certain DDL and DML commands to certain database objects.)
Transaction Control Language TCL (is used to control processing of
transactions in the database. Usual TCL statements are commit to apply the changes
introduced by the transaction, rollback to undo them and savepoint to divide the transaction
into several smaller parts.)
Types of sub-language in SQL
DDL DML
TCL DCL
SQL
13. Nguy畛n Mai Huy Master of Information technology
S董 畛 h畛 th畛ng DBMS
14. Nguy畛n Mai Huy Master of Information technology
dBASE
FoxPro
Microsoft Access
MySQL
Microsoft SQL Server
SQLite
IBM DB2
Oracle
PostgreSQL
. . .
M畛t s畛 DBMS ph畛 bi畉n
16. Nguy畛n Mai Huy Master of Information technology
Transact-SQL (T-SQL) l m畛t m畛 r畛ng 畛c quy畛n c畛a Microsoft v Sybase
cho SQL d湛ng 畛 t動董ng t叩c v畛i c董 s畛 d畛 li畛u quan h畛. T-SQL m畛 r畛ng d畛a
tr棚n SQL 畛 cho ph辿p l畉p tr狸nh th畛 t畛c, khai b叩o v s畛 d畛ng c叩c bi畉n c畛c
b畛, c叩c hm h畛 tr畛 kh叩c nhau cho x畛 l箪 chu畛i, x畛 l箪 ngy, to叩n h畛c,
畛ng th畛i thay 畛i c叩c l畛nh DELETE v UPDATE.
Transact-SQL l ng担n ng畛 l畉p tr狸nh quan tr畛ng trong vi畛c khai th叩c v s畛
d畛ng Microsoft SQL Server. T畉t c畉 c叩c 畛ng d畛ng giao ti畉p v畛i SQL Server
畛u th畛c hi畛n g畛i c叩c c但u l畛nh Transact-SQL d動畛i d畉ng TEXT 畉n m叩y
ch畛 c董 s畛 d畛 li畛u, v nh畉n v畛 k畉t qu畉 th畛c thi tr棚n CSDL m kh担ng h畛 ph畛
thu畛c vo giao di畛n ng動畛i d湛ng c畛a 畛ng d畛ng.
T-SQL
17. Nguy畛n Mai Huy Master of Information technology
C坦 3 i畛m kh叩c bi畛t ch鱈nh gi畛a SQL v T-SQL
SQL l 1 ng担n ng畛 l畉p tr狸nh, c嘆n T-SQL l m畛t m畛 r畛ng
c畛a SQL.
T-SQL cho ph辿p l畉p tr狸nh h動畛ng th畛 t畛c v畛i c叩c bi畉n c畛c
b畛, c嘆n SQL th狸 kh担ng.
T-SQL l 畛c quy畛n, c嘆n SQL l m畛t 畛nh d畉ng m畛.
SQL vs T-SQL
18. Nguy畛n Mai Huy Master of Information technology
Microsoft SQL Server l m畛t h畛 th畛ng qu畉n l箪 c董 s畛 d畛 li畛u quan h畛 動畛c ph叩t
tri畛n b畛i Microsoft. SQL Server ho畉t 畛ng nh動 m畛t m叩y ch畛 c董 s畛 d畛 li畛u, 但y
l m畛t s畉n ph畉m ph畉n m畛m c坦 ch畛c nng ch鱈nh l l動u tr畛 v truy xu畉t d畛 li畛u
theo y棚u c畉u c畛a c叩c 畛ng d畛ng ph畉n m畛m kh叩c, c坦 th畛 ch畉y tr棚n c湛ng m畛t m叩y
t鱈nh hay tr棚n m畛t m叩y t鱈nh kh叩c 畛ng th畛i cho ph辿p k畉t n畛i th担ng qua m畉ng m叩y
t鱈nh (bao g畛m c畉 Internet).
Microsoft cung c畉p nhi畛u phi棚n b畉n Microsoft SQL Server, nh畉m vo c叩c 畛i
t動畛ng kh叩c nhau, cho c叩c kh畛i l動畛ng c担ng vi畛c kh叩c nhau. T畛 c叩c 畛ng d畛ng 董n
l畉, kh畛i l動畛ng c担ng vi畛c nh畛, cho 畉n c叩c 畛ng d畛ng l畛n v畛i nhi畛u ng動畛i d湛ng
畛ng th畛i truy c畉p th担ng qua Internet.
What is SQL Server?
19. Nguy畛n Mai Huy Master of Information technology
MS SQL Server for OS/2 : 1989, by Sybase, Ashton-Tate, and Microsoft.
SQL Server 4.2 for NT : 1993.
SQL Server 6.0 : 1995 (Microsoft k畉t th炭c qu叩 tr狸nh h畛p t叩c v畛i Sybase, l炭c ny Sybase
ti畉p t畛c ph叩t tri畛n m畛t bi畉n th畛 kh叩c Sybase Adaptive Server Enterprise, 畛c l畉p v畛i Microsoft).
SQL Server 7.0 : 1998.
SQL Server 2005, (hon t畉t vi畛c chuy畛n 畛i m達 c滴 do Sybase ph叩t tri畛n sang Microsoft).
SQL Server 2017, (b畛 sung c叩c h畛 tr畛 cho n畛n t畉ng Linux)
Ph棚n b畉n & c叩c m畛c quan tr畛ng
20. Nguy畛n Mai Huy Master of Information technology
Database Engine Thnh ph畉n ch鱈nh, c坦 nhi畛m v畛 l動u tr畛, x畛 l箪 c叩c giao
d畛ch v畛i t畛c 畛 nhan v gi畛 nhi畛m v畛 b畉o m畉t 畛i v畛i c董 s畛 d畛 li畛u.
SQL Server 但y l d畛ch v畛 d湛ng 畛: Kh畛i 畛ng, D畛ng, T畉m ng動ng hay ti畉p
t畛c thi hnh 畛i v畛i c叩c th畛c th畛 SQL Server.
SQL Server Agent D畛ch v畛 ny s畉 th畛c thi c叩c nhi畛m v畛 ( role) theo l畛ch
tr狸nh, ho畉c t畛 畛ng th畛c thi c叩c nhi畛m v畛 d畛a tr棚n c叩c s畛 ki畛n c滴ng nh動 c叩c y棚u
c畉u t畛 b棚n ngoi.
SQL Server Browser D畛ch v畛 ny th動畛ng 動畛c d湛ng 畛 k畉t n畛i c叩c y棚u
c畉u 動畛c g畛i 畉n t畛 b棚n ngoi v畛i SQL Server instance mong mu畛n.
SQL Server Full-Text Search 動畛c s畛 d畛ng 畛 cho ph辿p ng動畛i d湛ng
ch畉y c叩c truy v畉n 畛 d畉ng Full-Text 畛i v畛i d畛 li畛u character trong c叩c b畉ng SQL.
The key components
21. Nguy畛n Mai Huy Master of Information technology
SQL Server VSS Writer Cho ph辿p sao l動u v ph畛c h畛i c叩c t畉p tin d畛 li畛u
khi SQL Server kh担ng ho畉t 畛ng.
SQL Server Analysis Services (SSAS) D畛ch v畛 ny 動畛c s畛 d畛ng 畛
cung c畉p c叩c ph但n t鱈ch, khai th叩c d畛 li畛u v kh畉 nng h畛c m叩y. M叩y ch畛 SQL c滴ng
動畛c t鱈ch h畛p v畛i Python v R 畛 ph但n t鱈ch d畛 li畛u n但ng cao.
SQL Server Reporting Services (SSRS) D畛ch v畛 ny 動畛c s畛 d畛ng
畛 cung c畉p c叩c t鱈nh nng v kh畉 nng ra quy畉t 畛nh bao g畛m c畉 vi畛c t鱈ch h畛p v畛i
Hadoop.
SQL Server Integration Services (SSIS) D畛ch v畛 ny 動畛c s畛 d畛ng
畛 th畛c hi畛n c叩c l畛nh ETL (Extract, Transform, and Load process) cho c叩c lo畉i d畛
li畛u kh叩c nhau t畉p h畛p t畛 nhi畛u ngu畛n.
The key components
22. Nguy畛n Mai Huy Master of Information technology
SQL Server Architecture
23. Nguy畛n Mai Huy Master of Information technology
SQL Server Architecture
Relational Engine Contains the query parser, optimizer, and the executor;
and the execution happens in the relational engine.
Command Parser Checks the syntax of the query and converts the query to
machine language.
Optimizer Prepares the execution plan as output by taking statistics, query and
Algebrator tree as input.
Query Executor This is the place where queries get executed step by step
Storage Engine This is responsible for storage and retrieval of data on the storage
system, manipulation of data, managing and locking transactions.
25. Nguy畛n Mai Huy Master of Information technology
SSMS from the start menu
26. Nguy畛n Mai Huy Master of Information technology
When you open the SQL server management studio from
the start menu, a window will open similar to the window shown
in the picture below.
Accessing Database Engine
27. Nguy畛n Mai Huy Master of Information technology
Here, mention the Server Name, Authentication Mode and click
on Connect. After you click on Connect, you will see the
following screen at the next slide.
Authentication Mode:
Windows authentication
SQL Server authentication
Authentication Mode
28. Nguy畛n Mai Huy Master of Information technology
Windows authentication
29. Nguy畛n Mai Huy Master of Information technology
Windows authentication
30. Nguy畛n Mai Huy Master of Information technology
SQL Server authentication
Choose server name
Select Authentication as SQL Server authentication
Login with: sa account
Password : you have entered in the installation before
31. Nguy畛n Mai Huy Master of Information technology
SQL Server authentication
32. Nguy畛n Mai Huy Master of Information technology
Ng担n ng畛 truy v畉n d畛 li畛u c坦 c畉u tr炭c : SQL
SQL & Transact SQL
C叩c nh坦m l畛nh 畉c tr動ng c畛a T-SQL
Microsoft SQL Server Management Studio (SSMS)
C叩c h狸nh th畛c truy c畉p vo SQL Server
H畛 qu畉n tr畛 c董 s畛 d畛 li畛u :: DBMS
M担 h狸nh truy xu畉t d畛 li畛u tr棚n h畛 th畛ng DBMS
Nh畛 g狸 ?!!!
33. Nguy畛n Mai Huy Master of Information technology
Itzik Ben-Gan, Microsoft速 SQL Server 速 2012 T-SQL Fundamentals,
OReilly Media Inc, 2012
Itzik Ben-Gan, Dejan Sarka, Ed Katibah, Greg Low, Roger Wolter, and Isaac
Kunen, Inside Microsoft SQL Server 2008: T-SQL Programming,
Microsoft Press, 2010
w3schools, Introduction to SQL,
https://www.w3schools.com/sql/sql_intro.asp, 10:54PM, 18/06/2020
Microsoft SQL Server Tutorial, Tutorials for SQL Server,
https://docs.microsoft.com/en-us/sql/sql-server/tutorials-for-sql-server-2016,
10:54 PM, 18/06/2020
Ti li畛u tham kh畉o