SQL- :
1) convert;
2) inttohex;
3) hextoint.
convert:
convert (< >, <> [, <>])
:
select title, convert(char(5), total_sales) from titles
:
1) character money, date/time, numeric approx_numeric , ;
2) character ;
3) convert money, date/time, numeric, integer, binary image.
inttohex hextoint .
Join ( ).
SELECT :
1) , .
2) from , , , .
3) where , , , : =, >, >=, <, <=,!=,!>,!<.
join , . , . Outer join, :
1) *= - ;
2) =* - .
, *=, , , , , , null . , =*, , , , , , null .
:
select au_fname, au_lname, pub_name from authors, publishers
where authors.city *= publishers.city
- select - , select-, insert-, update- delete- .
, , :
1) where <> [not] in (<>)
2) where <> < > [any|all] (<>)
3) where [not] exists (<>)
- () , , . , .
|
|
:
1) ;
2) ( , );
3) -;
4) ;
5) .
grant revoke, . :
1) ;
2) ;
3) ;
4) , ;
5) ;
6) .
select. :
create view [[< >.] <>.] < >
[(< > [, < >])]
as <select->
[with check option]
:
create view pub_view (publisher, city, state)
as select pub_name, city, state from publishers
select- :
1) order by compute;
2) into;
3) .
with check option , insert update. select- .
(update, insert delete ) :
1) , ;
2) , group by;
3) , distinct;
4) insert , not null, null ;
5) delete , ;
6) insert , with check option;
7) insert update , distinct;
8) update identity.
drop view:
drop view [[< >.] <>.] < >
[, [[< >.] <>.] < >]
:
drop view pub_view
- , . , , . .
|
|
:
1) (insert, update delete);
2) .
, insert, update delete .
, SQL, begin transaction ( ), commit transaction ( ), rollback transaction ( ).
- ( ), SQL - . . "g". SQL- (Transact-SQL). , .
INSERT .
:
insert poss values
(534305, ' ', '000073', 'M', '0', '001001', '05', 0129000, '08', '90', '03','95')
DELETE .
delete [from][[< >.]<>.]{< >|< >}
[from][[< >.]<>.]{< >|< >}
[,[[< >.<>.]< >|< >]]...]
[where < >]
:
delete poss where nomer = 534305
poss (. ).
TRUNCATE .
truncate table [[< >.] <>.] < >
: truncate table poss
UPDATE .
update [[< >.]<>.] {< >|< >}
set [[[< >.]<>.]{< >.|< >.}]
< .1>={<.1> | null | (< select>)}
[,< .2>={<.2> | null | (< select>)}]...
[from [[< >.] <>.]{< >|< >}
[,[[< >.]<>.]{< >|< >}]]...
[where < >]
: :
update poss set vuz_k=2066426
where fio=' ' and vuz_k=2066414
2066414 - ,
2066426 - .
14