Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> newbie question

newbie question

From: Nick Carter <ap874_at_torfree.net>
Date: Mon, 2 Nov 1998 21:01:53 GMT
Message-ID: <F1tBr5.HwM.0.bloor@torfree.net>


Hello netters,

I have a newbie question to ask, hopefully someone can help me.

I have the following relations and entity tables:

employees(ename,ssn,address)		key: (ssn)
departments(dname,did,mgr_ssn)		key: (did)
works_on(ssn,pno,hours)			key: (ssn,pno)
projects(pname,pno,did)			key: (pno)
dependencies(ssn,depname,age,relationship)	key:(ssn,depname)

I need to create SQL statements for the following queries:

  1. Find all employees who have two dependents of the same age.
  2. List all employees who work in a department managed by Anna Perks.
  3. List all projects which are worked on by all employees.
  4. List all employees who do not work on any project.
  5. For every employee who works on a project, list his/her name and the total hours s/he spends on all projects.
  6. Find all projects that have the largest number of employees working on them.

I am very new to SQL and have problems creating queries for the above. Hopefully some smart folks out there can help me.

Thanks in advance,
Nick Received on Mon Nov 02 1998 - 15:01:53 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US