12.
This presentation is the property of its rightful owner.
Sponsored Links
1 / 24

Запрос на обновление PowerPoint PPT Presentation


  • 75 Views
  • Uploaded on
  • Presentation posted in: General

Лекция 12. Запросы манипулирования данными (DML) . Специальные запросы. Запросы управления транзакциями (TCL) . Запросы контроля данных (DCL).

Download Presentation

Запрос на обновление

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


5983044

12. (DML). . (TCL). (DCL).

(DML) , , , .

, . . , , . . , .

: , , .


5983044

, . :

UPDATE < > SET < > = (<> , NULL}

[ SET < > = {<> , NULL } ... ]

[WHERE < >]

(NULL) . . :

UPDATE

SET = "Pent-III 800", = + 250

WHERE = "Pent-III 350";


5983044

( ) , .

:

INSERT INTO < > [(< >)] VALUES (< >)

INSERT INTO < > [(< >)] < SELECT>


5983044

INSERT , . , VALUES. . , .

INSERT , SELECT ( ). ( , , ), INSERT INTO, SELECT. :

INSERT INTO (, ) VALUES ("Pent II 233", 450);

INSERT INTO (, , ) SELECT , , FROM WHERE = "";


5983044

, . . . , . :

DELET FROM < > [WHERE < >]

WHERE , . . , .

:

DELET FROM WHERE LIKE "Celeron*";


5983044

. . :

SELECT < > INTO < >

FROM < > [WHERE < >]

, SELECT, ,

SELECT ., ., . INTO FROM WHERE .[ ]<#1984/01/04#;


5983044

TRANSFORM () , , , - . TRANSFORM :

TRANSFORM < ( >

SELECT < GROUP BY ( )>

PIVOT< , >

, . , , .


5983044


5983044

TRANSFORM Sum(.*. ) AS

SELECT . FROM INNER JOIN ON . = .

WHERE . [ ] BETWEEN#2002/1/1 # And #2002/30/4#

GROUP BY .

PIVOT Format([ ], "mmm yyy");

PIVOT Datepart ("m",[],1,0), .


5983044

UNION ( ). = U . , SELECT, , . SELECT ( ). SELECT . . ORDER BY, SELECT:


5983044

SELECT & " " & & " " & AS , FROM

UNION SELECT , FROM

ORDER BY , ;

UNION SQL : - ( = - . , ) - INTERSECT( = . K , , ). , () .

, UNION UNION ALL


5983044

SELECT * FROM Orders

WHERE amount=(SELECT MAX(amount)FROM Orders)

UNION

SELECT * FROM Orders

WHERE amount=(SELECT MIN(amount)FROM Orders)

ORDER BY id;


5983044

(TCL).

, SQL, . , , , .

SQL BEGIN TRANSACTION. :

) COMMIT, . ;

) ROLLBACK, , , ;

) , SQL.


5983044

, SQL , COMMIT, - ROLLBACK. SET TRANSACTION (READ ONLY READ WRITE) , , . , , , T1, T2 , T1. : READ UNCOMMITED ( ), READ COMMITED ( ), REPEATABLE ( ), SERIALIZABLE. SERIALIZABLE ( ), .


5983044

(DCL)

, , , . SQL GRANT REVOKE, . , . ( ), , , . , SQL ().


5983044

SQL ( , ). . GRANT, :

GRANT {< > | ALL PRIVILEGES} ON < {< > | PUBLIC} [WITH GRANT OPTIONS]

SQL , :

SELECT- ;

INSERT [< >] - ;

UPDATE [< >] - ;

DELETE - ;

REFERENCE [< >] - ;

USAGE - .


5983044

WITH GRANT OPTIONS, . , , .

REVOKE:

REVOKE [GRANT OPTION FOR] {< > | ALL PRIVILEGES} ON < > FROM {< > | PUBLIC } [RESTRICT | CASCADE]

GRANT OPTION FOR .


5983044

, :

CREAT USER < > [IDENTIFIED BY [PASSWORD] '<>'];

. IDENTIFIED BY, .

PASSWORD , , ( CREAT USER).

PASSWORD ('< >');


5983044

:

CREAT USER 'anna' IDENTIFIED BY 'annapassword';

GRANT SELECT ON *.* TO 'anna';

GRANT INSERT ON SalesDept.* TO 'anna' WITH GRANT OPTION;

GRANT DELETE ON SalesDept.Customers TO 'anna';


5983044

, , . MySQL , .

, :

1. ;

2. , .


5983044

, , .

, . , , , , , .

. , , .


5983044

.

, MYSQL --log-bin. . , --log-bin :

mysqld-nt --log-bin


5983044

MySQL Windows , , MySQL Administrator, my.ini, , MySQL, --log-bin [mysgld] .

.

.

data MySQL -

< >-bin.xxxxxx,

.


5983044

:

1. ;

2. () ;

3. .

, ( ). , , .


  • Login