-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclass 18.sql
More file actions
43 lines (31 loc) · 968 Bytes
/
class 18.sql
File metadata and controls
43 lines (31 loc) · 968 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
-- dcl
-- data control languager
-- grant and revoke
create user 'ram' identified by 'ram';
-- ram%ipaddress
select * from mysql.user;
show grants for 'ram'; -- will show privileges
-- grant statment
grant all privileges on tushar.* to 'ram';
revoke all privileges on tushar.* from 'ram';
-- role
use sakila ;
select * from actor;
CREATE ROLE actor_role ;
GRANT SELECT ON sakila.customer TO actor_role;
GRANT SELECT ON sakila.rental TO actor_role;
GRANT UPDATE ON sakila.customer TO actor_role;
-- dql (group by , joints , left join , inner , and self )
-- subquary , single , multi-row >,< (in any all)
-- corrlated (cte)
-- windows
-- over(), particion by
-- running sum (order by )
-- partition by dept order by
-- rank() order by
-- row number
-- primary vs foriegn key
-- constraint
-- function , substr , instr , concat , trim
-- number round , pow , floor
-- data , adddate , dateediff, extract , month , year , data_format ,