SELECT emp_last_name "Last Name", emp_first_name "First Name"
FROM employee
WHERE emp_ssn IN
(SELECT work_emp_ssn
FROM assignment
WHERE work_hours > 10 AND work_pro_number IN(
SELECT pro_number
FROM project
WHERE pro_name = 'Order Entry') );
Select within a Select within a Select - wow
Check this out it's an awesome SQL query using the tables we made in class:
| CODE |
select * from assignment, bed, bed_type, contract_employee, department, dependent, dept_locations, employee, medical_specialty, medicine, patient, patient_note, prescription, project, room, service, service_cat, staff, staff_medspec, treatment, ward_dept; |
Hey!!! That was kind of funny! I encourage everyone... with these tables on thier SQL server... to run this query!
well... basically it is a huge query - it just keeps going, and going, and going, and going... lol
okay
does it help in any way
and in what way?
No, it was a joke in a class - it is quite funny, but you hvae to have those tables...
and you have to know sql
cos i have no idea what it means
lol
lol, anyways, its a very simple SQL statement... SQL is like logical engligh...
Here, I'll break it down for you:
-- basically means Show all data
| CODE |
from assignment, bed, bed_type, contract_employee, department, dependent, dept_locations, employee, medical_specialty, medicine, patient, patient_note, prescription, project, room, service, service_cat, staff, staff_medspec, treatment, ward_dept;
|
-- is just a list of table to show all data from.
So - this line of SQL code would select every piece of data in all of the tables listed in the database. Some were very large tables, which is why it kept going and going and going...
its similar to doing IFs in VB only in a different language
yeah i dont no visual basic
okay kinda makes sense now
thanx