Friday, June 10, 2011

SQL Solution 2009 & 2010 Q

Solution 2009

--6.a.

SELECT Employee_name as NAME,
TO_CHAR(hire_date,
’fmDdspth "of" Month YYYY fmHH:MI:SS AM’)
Joining Date
FROM employees;

Solution 2010
--3.a.

SELECT Employee_name as NAME,
TO_CHAR(hire_date,
’ddth "of" Month YYYY fmHH:MI:SS AM’)
Joining Date
FROM employees;

---3.b.

select emp.employee_name,d.Department_name,j.Job_title,emp.hire_date
from Employees emp,Departments d,Jobs j
where emp.department_id=d.department_id AND
emp.job_id=j.job_id AND
and (emp.hire_date='June 2008' );

---3.c.

SELECT
emp.employee_name,
jobs.job_title,
dept.location_id
FROM Employees emp,Departments dept,Jobs
where emp.department_id=d.department_id AND
emp.job_id=j.job_id AND


department.department_name =  'ICT';
(incomplate)

--4.c.

insert into jobs (job_id,job_title,min_salary,max_salary)
values (M_ENGR, 'Maintenance Engineer', 35000, 55000);

--5.c.

CREATE VIEW DEPT_MKT
AS SELECT emp.employee_id, emp.employee_name, emp.hire_date, emp.Job_id, emp.salary, emp.Manager_id, dept.Department_id, dept.department_name
FROM employees emp, departments dept
WHERE emp.department_id=d.department_id AND
department.department_name =  'Marketing';

No comments:

Post a Comment