4.17
经理本身拥有权限,可以在grant命令后附加with grant option命令允许其进行权限授予;而用户本身不拥有权限,故不能进行权限授予
6.2
-
a
Π e m p l o y e e . p e r s o n _ n a m e ( σ e m p l o y e e . m a n a g e r _ n a m e = w . p e r s o n _ n a m e ∧ e m p l o y e e . s t r e e t = w . s t r e e t ∧ e m p l o y e e . c i t y = w . c i t y ( ( e m p l o y e e ⋈ m a n a g e s ) × ρ w ( \Pi_{employee.person\_name}(\sigma_{employee.manager\_name=w.person\_name \wedge\ employee.street=w.street \wedge\ employee.city=w.city }((employee\bowtie manages) \times \rho_w( Πemployee.person_name(σemployee.manager_name=w.person_name∧ employee.street=w.street∧ employee.city=w.city((employee⋈manages)×ρw(
e m p l o y e e ) ) ) employee))) employee)))
-
b
Π p e r s o n _ n a m e ( σ c o m p a n y _ n a m e ≠ " F i r s t B a n k C o r p o r a t i o n " ( w o r k s ) ) \Pi_{person\_name}(\sigma_{company\_name \neq "First\ Bank\ Corporation"}(works)) Πperson_name(σcompany_name="First Bank Corporation"(works))
-
c
Π p e r s o n _ n a m e ( e m p l o y e e ) − Π w o r k s . n a m e ( σ w . c o m p a n y _ n a m e = " S m a l l B a n k C o r p o r a t i o n " ∧ w o r k s . s a l a r y < w . s a l a r y ( w o r k s × ρ w ( w o r k s ) ) ) \Pi_{person\_name}(employee)-\Pi_{works.name}(\sigma_{w.company\_name="Small\ Bank\ Corporation"\ \wedge\ works.salary<w.salary}(works\times \rho_w(works))) Πperson_name(employee)−Πworks.name(σw.company_name="Small Bank Corporation" ∧ works.salary<w.salary(works×ρw(works)))
6.4
-
a
Π I D , c o u s e _ i d ( t a k e s ) ÷ Π c o u r s e _ i d ( σ d e p t _ n a m e = " C o m p . S c i . " ( c o u r s e ) ) \Pi_{ID,couse\_id}(takes)\div \Pi_{course\_id}(\sigma_{dept\_name="Comp.Sci."}(course)) ΠID,couse_id(takes)÷Πcourse_id(σdept_name="Comp.Sci."(course))
-
b
Π I D ( σ d e p t _ n a m e = " C o m p . S c i " ( t a k e s ⋈ c o u r s e ) ) \Pi_{ID}(\sigma_{dept\_name="Comp.Sci"}(takes\bowtie course)) ΠID(σdept_name="Comp.Sci"(takes⋈course))
6.5
-
a
{t| ∃ \exists ∃ x ∈ \in ∈ r(x[A]=t[A])}
-
b
{t|t ∈ \in ∈ r ∧ \wedge ∧ t[B]=17}
-
c
{t| ∃ \exists ∃ x ∈ \in ∈ r, y ∈ \in ∈ s (x[A]=t[A] ∧ \wedge ∧ x[B]=t[B] ∧ \wedge ∧ x[C]=t[C] ∧ \wedge ∧ y[D]=t[D] ∧ \wedge ∧ y[E]=t[E] ∧ \wedge ∧ y[F]=t[F])}
-
d
{t| ∃ \exists ∃ x ∈ \in ∈ r, y ∈ \in ∈ s,(x[A]=t[A] ∧ \wedge ∧ y[F]=t[F] ∧ \wedge ∧ x[C]=y[D])}
6.6
-
a
{<a>| ∃ \exists ∃ b,c(<a,b,c> ∈ \in ∈ r 1 r_1 r1)}
-
b
{<a,b,c>|<a,b,c> ∈ \in ∈ r 1 r_1 r1 ∧ \wedge ∧ b=17}
-
c
{<a,b,c>|<a,b,c> ∈ \in ∈ r 1 r_1 r1 ∨ \vee ∨ <a,b,c> ∈ \in ∈ r 2 r_2 r2}
-
d
{<a,b,c>|<a,b,c> ∈ \in ∈ r 1 r_1 r1 ∧ \wedge ∧ <a,b,c> ∈ \in ∈ r 2 r_2 r2}
-
e
{<a,b,c>|<a,b,c> ∈ \in ∈ r 1 r_1 r1 ∧ \wedge ∧ <a,b,c> ∉ \notin ∈/ r 2 r_2 r2}
-
f
{<a,b,c>| ∃ \exists ∃ x,y(<a,b,x> ∈ \in ∈ r 1 r_1 r1 ∧ \wedge ∧ <y,b,c> ∈ \in ∈ r 2 r_2 r2) }
6.7
-
a
Π A ( σ B = 7 ( r ) ) \Pi_{A}(\sigma_{B=7}(r)) ΠA(σB=7(r))
-
b
r ⋈ \bowtie ⋈ s
-
c
Π A ( σ s . C = q . A ∧ r . b > q . b ( ( s ⋈ r ) × ρ q ( r ) ) ) \Pi_{A}(\sigma_{s.C=q.A \wedge r.b>q.b}((s\bowtie r)\times \rho_q(r))) ΠA(σs.C=q.A∧r.b>q.b((s⋈r)×ρq(r)))
6.11
-
a
Π p e r s o n _ n a m e ( σ c o m p a n y _ n a m e = " F i r s t B a n k C o r p o r a t i o n " ( w o r k s ) ) \Pi_{person\_name}(\sigma_{company\_name = "First\ Bank\ Corporation"}(works)) Πperson_name(σcompany_name="First Bank Corporation"(works))
-
b
Π p e r s o n _ n a m e , c i t y ( σ c o m p a n y _ n a m e = " F i r s t B a n k C o r p o r a t i o n " ( w o r k s ⋈ e m p l o y e e ) ) \Pi_{person\_name,city}(\sigma_{company\_name = "First\ Bank\ Corporation"}(works\bowtie employee)) Πperson_name,city(σcompany_name="First Bank Corporation"(works⋈employee))
-
c
Π p e r s o n _ n a m e , s t r e e t , c i t y ( σ c o m p a n y _ n a m e = " F i r s t B a n k C o r p o r a t i o n " ∧ s a l a r y > 10000 ( w o r k s ⋈ e m p l o y e e ) ) \Pi_{person\_name,street,city}(\sigma_{company\_name = "First\ Bank\ Corporation" \wedge salary>10000}(works\bowtie employee)) Πperson_name,street,city(σcompany_name="First Bank Corporation"∧salary>10000(works⋈employee))
-
d
Π p e r s o n _ n a m e ( σ w o r k s . c o m p a n y _ n a m e = c o m p a n y . c o m p a n y _ n a m e ∧ e m p l o y e e . c i t y = c o m p a n y . c i t y ( ( w o r k s ⋈ e m p l o y e e ) × c o m p a n y ) ) \Pi_{person\_name}(\sigma_{works.company\_name=company.company\_name \wedge employee.city=company.city}((works\bowtie employee)\times company)) Πperson_name(σworks.company_name=company.company_name∧employee.city=company.city((works⋈employee)×company))
-
e
Π c o m p a n y _ n a m e ( σ d . c o m p a n y _ n a m e = " F i r s t B a n k C o r p o r a t i o n " ∧ c o m p a n y . c i t y = d . c i t y ( c o m p a n y × ρ d ( c o m p a n y ) ) ) \Pi_{company\_name}(\sigma_{d.company\_name = "First\ Bank\ Corporation"\wedge company.city=d.city}(company \times \rho_d(company))) Πcompany_name(σd.company_name="First Bank Corporation"∧company.city=d.city(company×ρd(company)))
6.15
-
a
{t| ∃ \exist ∃ s ∈ \in ∈ works(t[person_name]=s[person_name] ∧ \wedge ∧ s[company_name]=“First Bank Corporation”)}
{<p>| ∃ \exist ∃ c,s(<p,c,s> ∈ \in ∈ works ∧ \wedge ∧ c=“First Bank Corporation” )}
-
b
{t| ∃ \exist ∃ p ∈ \in ∈ employee, s ∈ \in ∈ works(t[city]=p[city] ∧ \wedge ∧ t[person_name]=p[person_name] ∧ \wedge ∧ t[person_name]=s[person_name] ∧ \wedge ∧ s[company_name]=“First Bank Corporation”)}
{<p,ci>| ∃ \exist ∃ st,c,s(<p,st,ci> ∈ \in ∈ employee ∧ \wedge ∧ <p,c,s> ∈ \in ∈ works ∧ \wedge ∧ c=“First Bank Corporation” )}
-
c
{t|t ∈ \in ∈ employee, ∃ \exist ∃ s ∈ \in ∈ works(t[person_name]=s[person_name] ∧ \wedge ∧ s[company_name]=“First Bank Corporation” ∧ \wedge ∧ s[salary]>10000)}
{<p,st,ci>| ∃ \exist ∃ c,s(<p,st,ci> ∈ \in ∈ employee ∧ \wedge ∧ <p,c,s> ∈ \in ∈ works ∧ \wedge ∧ c=“First Bank Corporation” ∧ \wedge ∧ s>10000)}
-
d
{t| ∃ \exist ∃ x ∈ \in ∈ employee, y ∈ \in ∈ works, z ∈ \in ∈ company (t[person_name]=x[person_name] ∧ \wedge ∧ x[person_name]=y[person_name] ∧ \wedge ∧ y[company_name]=z[company_name] ∧ \wedge ∧ x[city]>z[city])}
{<p>| ∃ \exist ∃ st, ci1, c, s, ci2 ( <p,st,ci1> ∈ \in ∈ employee ∧ \wedge ∧ <p,c,s> ∈ \in ∈ works ∧ \wedge ∧ <c,ci2> ∈ \in ∈ company ∧ \wedge ∧ ci1=ci2)}
-
e
{t| ∃ \exist ∃ x ∈ \in ∈ employee, y ∈ \in ∈ managers, z ∈ \in ∈ employee (t[person_name]=x[person_name] ∧ \wedge ∧ x[person_name]=y[person_name] ∧ \wedge ∧ y[manager_name]=z[person_name] ∧ \wedge ∧ x[street]>z[street] ∧ \wedge ∧ x[city]>z[city])}
{<p>| ∃ \exist ∃ st1, ci1, m, st2,ci2 ( <p,st1,ci1> ∈ \in ∈ employee ∧ \wedge ∧ <p,m> ∈ \in ∈ manager ∧ \wedge ∧ <m,st2,ci2> ∈ \in ∈ employee ∧ \wedge ∧ ci1=ci2 ∧ \wedge ∧ st1=st2)}
-
f
{t| ∃ \exist ∃ s ∈ \in ∈ works(t[person_name]=s[person_name] ∧ \wedge ∧ s[company_name] ≠ \neq = “First Bank Corporation”)}
{<p>| ∃ \exist ∃ c,s(<p,c,s> ∈ \in ∈ works ∧ \wedge ∧ c ≠ \neq = “First Bank Corporation” )}
-
g
¬ \neg ¬{t| ∃ \exist ∃ s, w ∈ \in ∈ works(s[person_name]=t[person_name] ∧ \wedge ∧ w[company_name]=“Small Bank Corporation” ∧ \wedge ∧ s.salary<w.salary)} ∧ \wedge ∧ {t| ∃ \exist ∃ s ∈ \in ∈ employee(s[person_name]=t[person_name])}
¬ \neg ¬{<p1>| ∃ \exist ∃ s1, c1, p2, s2, c2 (<p1,c1,s1> ∈ \in ∈ works ∧ \wedge ∧ <p2,c2,s2> ∈ \in ∈ works ∧ \wedge ∧ s1<s2)} ∧ \wedge ∧ {<p>| ∃ \exist ∃ s,c (<p,s,c> ∈ \in ∈ employee)}
-
h
{t| ∃ \exist ∃ x ∈ \in ∈ company, y ∈ \in ∈ company(t[company_name]=x[company_name] ∧ \wedge ∧ x[city]=y[city] ∧ \wedge ∧ y[company_name]=“Small Bank Corporation”)}
{<ci1>| ∃ \exist ∃ c1,c2,ci2(<c1,ci1> ∈ \in ∈ company ∧ \wedge ∧ <c2,ci2> ∈ \in ∈ company ∧ \wedge ∧ c2=“Small Bank Corporation” ∧ \wedge ∧ ci1=ci2)}
7.1
7.2