You are on page 1of 24

,

-10 2

: . //


.
.
www.emust.edu.mn
4. SQL (Structured Query Language)
SQL ?
SQL /Structured Query Language/
, ,
, ,
.


.

// .
query .

, -
www.emust.edu.mn
2
, query SQL (Structured Query
Language)
.
SQL
.

.
1.DML/Data Manipulation Language/ , ,

2.DDL/Data Definition Language/ ,

3. DQL/Data Query Language/

, -
www.emust.edu.mn
3
4.1 Data manipulation Language (DML)

statement - .
Y :
SELECT -

UPDATE v
DELETE
INSERT INTO -
Select DISTINCT major from student;
UPDATE titles SET title='Linux, 5th ed.' WHERE titleID=1
DELETE FROM student;
INSERT INTO titles (title, publID, year)VALUES ('MySQL & mSQL', 4, 1999)
, -
www.emust.edu.mn
4
4.2 Data Definition Language (DDL)

, ,
statement .
CREATE TABLE -
ALTER TABLE - .
DROP TABLE .
CREATE INDEX
DROP INDEX -

Drop table Student WHERE Student_ID= ' ';


, -
www.emust.edu.mn
5
5.

/DATA NORMALIZATION/

6
5. :

1-




2-

3-
, -
1.

www.emust.edu.mn
7

1.
. . . .
/

2.
. . . . . .

/

, -
www.emust.edu.mn
8
5.1 1-
-

.
:
-

.
: = {, , ,
, }


, -
www.emust.edu.mn
9
1-
1. 2.
. . . .

3. 4. 5.
. . . . .

6. &
. . . . . . .

7.
. .

, -
www.emust.edu.mn
10
5.2 2-

-

, , ... -
- ,
-
- .
: { , ,
}

, -
www.emust.edu.mn
11 11
-


.
:
- ( , , , )
- ( , , ,
)

, -
www.emust.edu.mn
12
-




.

&( , )
, - 13
www.emust.edu.mn
13
2-

1. 2.
. . . . .

3. & 4.
. . . . . .

5. 6. 7.
. . . .. .

8. 9.
. . .. .. ..

, -
www.emust.edu.mn
14
5.3 3-
-
, ,
-, -
- - .
.
-
:
( , , , )

, -
www.emust.edu.mn
15

2 .

- ( , , )
- & ( , )

, -
www.emust.edu.mn
16
3-

1. 2.
. . . . .

3. & 4.
. . . . . .

5. 6. 7.
. . . .. .

8. 9.
. . . .. .. ..

10. &

, -
www.emust.edu.mn
17
6. (Online transaction processing)
,

.
, ,
.

.
(Transaction processing)

,
,
.
, -
www.emust.edu.mn
18
6.1 (Exclusive control)


.
.
1)

. 2 .
(Exclusive lock)- ,
.
(Shared lock)- .
, ,
.
2 .

, -
www.emust.edu.mn
19
,





:
50
. 2

.

20
, -
www.emust.edu.mn
20
2)
. :
15 .
.
,
.
.
6.2

log file .

log .

.
, -
www.emust.edu.mn
21
6.3

-
. 2
.
Roll Forward- log

.
Roll back -
,

13.
, -
www.emust.edu.mn
22

?
, -
www.emust.edu.mn 23

1. U.IT101 6
2. U.IT101

You might also like

  • Lecture 15
    Lecture 15
    Document40 pages
    Lecture 15
    Amarsaikhan Tuvshinbayar
    No ratings yet
  • Lec1-1 Corporate Activity Shine
    Lec1-1 Corporate Activity Shine
    Document61 pages
    Lec1-1 Corporate Activity Shine
    Amarsaikhan Tuvshinbayar
    0% (1)
  • Programming Lec 6
    Programming Lec 6
    Document51 pages
    Programming Lec 6
    Amarsaikhan Tuvshinbayar
    No ratings yet
  • Lecture 13
    Lecture 13
    Document46 pages
    Lecture 13
    Amarsaikhan Tuvshinbayar
    100% (2)
  • Lecture 12
    Lecture 12
    Document34 pages
    Lecture 12
    Amarsaikhan Tuvshinbayar
    No ratings yet
  • Lecture - 10
    Lecture - 10
    Document35 pages
    Lecture - 10
    Amarsaikhan Tuvshinbayar
    No ratings yet
  • Lecture 9
    Lecture 9
    Document46 pages
    Lecture 9
    Amarsaikhan Tuvshinbayar
    No ratings yet
  • Lecture 2 2018
    Lecture 2 2018
    Document33 pages
    Lecture 2 2018
    Amarsaikhan Tuvshinbayar
    100% (1)
  • Lecture 7 20108
    Lecture 7 20108
    Document47 pages
    Lecture 7 20108
    Amarsaikhan Tuvshinbayar
    75% (4)
  • Lecture 11
    Lecture 11
    Document24 pages
    Lecture 11
    Amarsaikhan Tuvshinbayar
    100% (2)
  • Lecture 8 2018
    Lecture 8 2018
    Document54 pages
    Lecture 8 2018
    Amarsaikhan Tuvshinbayar
    100% (3)
  • Lecture 6 2018
    Lecture 6 2018
    Document50 pages
    Lecture 6 2018
    Amarsaikhan Tuvshinbayar
    100% (3)
  • Lecture 1
    Lecture 1
    Document54 pages
    Lecture 1
    Amarsaikhan Tuvshinbayar
    100% (2)
  • Lecture 1 2018
    Lecture 1 2018
    Document39 pages
    Lecture 1 2018
    Amarsaikhan Tuvshinbayar
    100% (6)
  • Lecture 5 2018
    Lecture 5 2018
    Document54 pages
    Lecture 5 2018
    Amarsaikhan Tuvshinbayar
    100% (2)
  • Lecture 4 2018
    Lecture 4 2018
    Document47 pages
    Lecture 4 2018
    Amarsaikhan Tuvshinbayar
    100% (4)
  • Lecture 3 2018
    Lecture 3 2018
    Document42 pages
    Lecture 3 2018
    Amarsaikhan Tuvshinbayar
    No ratings yet
  • Baikal Hotolbor
    Baikal Hotolbor
    Document2 pages
    Baikal Hotolbor
    Amarsaikhan Tuvshinbayar
    No ratings yet
  • Baikal Hotolbor
    Baikal Hotolbor
    Document2 pages
    Baikal Hotolbor
    Amarsaikhan Tuvshinbayar
    No ratings yet
  • IT101 Lecture 4
    IT101 Lecture 4
    Document72 pages
    IT101 Lecture 4
    Amarsaikhan Tuvshinbayar
    No ratings yet
  • Lecture 3
    Lecture 3
    Document72 pages
    Lecture 3
    Amarsaikhan Tuvshinbayar
    No ratings yet
  • Lecture 3
    Lecture 3
    Document72 pages
    Lecture 3
    Amarsaikhan Tuvshinbayar
    No ratings yet
  • Programming Lec 8
    Programming Lec 8
    Document32 pages
    Programming Lec 8
    Amarsaikhan Tuvshinbayar
    100% (1)
  • Lecture 2
    Lecture 2
    Document80 pages
    Lecture 2
    Amarsaikhan Tuvshinbayar
    No ratings yet
  • Programming Lec 6
    Programming Lec 6
    Document51 pages
    Programming Lec 6
    Amarsaikhan Tuvshinbayar
    No ratings yet
  • Koosen 2018 Algorithm Programming 3
    Koosen 2018 Algorithm Programming 3
    Document46 pages
    Koosen 2018 Algorithm Programming 3
    Amarsaikhan Tuvshinbayar
    100% (1)
  • Programming Lec 9
    Programming Lec 9
    Document39 pages
    Programming Lec 9
    Amarsaikhan Tuvshinbayar
    No ratings yet
  • PL - 3
    PL - 3
    Document47 pages
    PL - 3
    Amarsaikhan Tuvshinbayar
    No ratings yet
  • Programming Lec 7
    Programming Lec 7
    Document57 pages
    Programming Lec 7
    Amarsaikhan Tuvshinbayar
    No ratings yet
  • Programming Lec 4
    Programming Lec 4
    Document39 pages
    Programming Lec 4
    Amarsaikhan Tuvshinbayar
    No ratings yet