Specify in OQL the queries in the exercises of Chapter 7 and 8 that apply to the COMPANY database.
What will be an ideal response?
(a) Retrieve the names of employees in department 5 who work more than 10 hours per
week on the 'ProductX' project.
select e.name.fname
from e in employee
where e.works_for .dnumber = 5 and
( 'Product X' in
(select h.work_on.pname
from h in e.work
where h.hours > 10));
(b) List the name of employees who have a dependent with the same first name as themselves.
select k.suporter.fname
from k in dependents
where k.name = k.suporter.fname
(c) List the name of employees who are all directly supervised by 'Franklin Wong'.
select e.fname
from e in employee
where e.supervisor.name.fname = 'Franklin' and e.supervisor.name.lname = 'Wong';
(d) For each project, list the project name and the total hours per week (by all employees)
spent on that project.
select projname, tot_hours : sum (select p.h.hours from p in partition)
from h in hours_worked
group by projname: w.work_on.pname;
(e) Retrieve the names of all employees who work on every project.
select e.name.fname
from e in employee
where for all g in (select p.pnumber
from p in projects)
: g.pnumber in (select e.work.work_on.pnumber);
(f) Retrieve the names of all employees who do not work on any project.
select e.name.fname
from e in employee
where for all g in (select p.pnumber
from p in projects)
: g.pnumber not in (select e.work.work_on.pnumber);
(g) For each department, retrieve the department name, and the average salary of employees
working in that department.
select deptname, avgsal : avg (select p.e.salary from p in partition)
from e in employee
group by deptname: e.works_for.dname;
(h) Retrieve the average salary of all female employees.
avg (select e.salarey
from e in employee
where e.sex = 'M');
You might also like to view...
In both Alice and Java, every variable has an associated type that is specified when the variable is declared.
Answer the following statement true (T) or false (F)
Match the word with its correct description.
A. informational report about a topic of interest to members of a professional organization B. your online presence C. professional who guides someone along a career path D. an employee who writes an online log about products and services offered by a company E. harassing an individual online F. the main descriptor of a member on a professional networking site like LinkedIn G. an online seminar H. an online organization whose focus it is to "clean up" a person's online persona I. a personal home page with links to an individual's online information J. a measure of how easy or difficult it is to find you online; for example, on Facebook K. a level of the Web that includes databases and public records that traditional search engines don't search L. an individual in charge of the contents of a Web site
Why is an Independent Audit Committee important to a company?
What will be an ideal response?
A company has a BYOD policy that includes tablets and smart phones. In the case of a legal investigation, which of the following poses the greatest security issues?
A. Recovering sensitive documents from a device if the owner is unable or unwilling to cooperate B. Making a copy of all of the files on the device and hashing them after the owner has provided the PIN C. Using GPS services to locate the device owner suspected in the investigation D. Wiping the device from a remote location should it be identified as a risk in the investigation