---
# System prepended metadata

title: L3BD - Groupe 3 - TD7 - 13-04-21

---

# L3BD - Groupe 3 - TD7 - 13-04-21
# 
```sql=



/*1*/
/*a*/
/*Donner acces a un autre utilisateur*/
GRANT INSERT on village TO c##NOM_a;

/*A linverse*/
REVOKE INSERT on village from c##NOM_a;

/*b*/
GRANT EXECUTE on traitement2 TO c##NOM_a;




/*2*/ 
/*action 1*/
GRANT select on village to employes;
GRANT insert on village to employes;

/*action 2*/
GRANT select on village to employes;

/*action 3*/
GRANT update on village to employes;

grant update(activite,capacite) village e1...en

/*action 4*/
GRANT select on sejour to employes;


/*action 5*/
GRANT select , delete on sejour to employes;


/*action 6*/
GRANT insert on client to utilisateur_client;

/*action 7*/
GRANT select on village to utilisateur_client;
GRANT update on client to utilisateur_client;
GRANT insert on sejour to utilisateur_client;

grant update (avoir) on client to c

/*action 8*/
GRANT select on village to utilisateur_client;
GRANT select on sejour to utilisateur_client;

/*action 9*/
GRANT select on client to utilisateur_client;
GRANT select on sejour to utilisateur_client;
GRANT select on village to utilisateur_client;

/*action 10*/
GRANT select on client to programmeur;

GRANT insert on archive to programmeur;

-- action 8 avec respect du cc

create view village_sans_sejour as
    select idv,ville activite,prix from village 
    where idv not in (select idv from sejour)

grant select on village_sans_sejour to c


-- action 5 avec restect du cc

traitement 3 (j) =
     select count(*) from sejour where jour<j
     delete sejour where jour<j

grant execute traitement3 e1...en

























```