i have been asked to:
A project of your choice required two programmers and a database designer for 12th of November (or for a date of your choice). Using your data list the name of programmers and database designers who are available for 12th November 2012(or the date you have chosen).
this is the code i have used to try and do the above:
SELECT employee.employee_name, projects.project_name, assignments.date_assigned
FROM employee, projects, assignments
where projects.project_name = employee.employee_name
WHERE EMP_JOB_TITLE= 'Programmer'
OR EMP_JOB_TITLE= 'Database designer'
and assignments.date_assigned = '12-NOV-12';
But it is giving me this error:
ORA-00933: SQL command not properly ended
00933. 00000 - "SQL command not properly ended"
*Cause:
*Action:
Error at Line: 4 Column: 1
Any solutions would be greatful :)
i have now edited the code:
SELECT DISTINCT employee.employee_name, projects.project_name, assignments.date_assigned
FROM employee, projects, assignments
WHERE EMP_JOB_TITLE= 'Programmer'
and EMP_JOB_TITLE= 'Database designer'
or assignments.date_assigned = '12-NOV-12';
but the result is showing all duplicates even though i have added the "distinct" query at the start ...
EMPLOYEE_NAME PROJECT_NAME DATE_ASSIGNED
------------------------------ -------------------- -------------
JOHN EDWARDS FOURTHPROJECT 12-NOV-12
PAUL GREEN THIRDPROJECT 12-NOV-12
CARLY EVANS FOURTHPROJECT 12-NOV-12
JOHN EDWARDS FIRSTPROJECT 12-NOV-12
PAUL GREEN SECONDPROJECT 12-NOV-12
JOHN EDWARDS SECONDPROJECT 12-NOV-12
EDWARD MARUBBI THIRDPROJECT 12-NOV-12
EDWARD MARUBBI SIXTHPROJECT 12-NOV-12
PHIL GREEN FIRSTPROJECT 12-NOV-12
PHIL GREEN SECONDPROJECT 12-NOV-12
PHIL GREEN THIRDPROJECT 12-NOV-12
CARLY EVANS SIXTHPROJECT 12-NOV-12
JOHN EDWARDS FIFTHPROJECT 12-NOV-12
EDWARD MARUBBI FIRSTPROJECT 12-NOV-12
PAUL GREEN FIRSTPROJECT 12-NOV-12
PAUL GREEN FOURTHPROJECT 12-NOV-12
CARLY EVANS SECONDPROJECT 12-NOV-12
CARLY EVANS FIFTHPROJECT 12-NOV-12
PHIL GREEN FIFTHPROJECT 12-NOV-12
EDWARD MARUBBI SECONDPROJECT 12-NOV-12
CARLY EVANS FIRSTPROJECT 12-NOV-12
JOHN EDWARDS THIRDPROJECT 12-NOV-12
EDWARD MARUBBI FIFTHPROJECT 12-NOV-12
PAUL GREEN SIXTHPROJECT 12-NOV-12
CARLY EVANS THIRDPROJECT 12-NOV-12
JOHN EDWARDS SIXTHPROJECT 12-NOV-12
PHIL GREEN FOURTHPROJECT 12-NOV-12
PHIL GREEN SIXTHPROJECT 12-NOV-12
EDWARD MARUBBI FOURTHPROJECT 12-NOV-12
PAUL GREEN FIFTHPROJECT 12-NOV-12
i also have been asked to:
Assign the available employees to the project you have selected to answer Q5 (the above question). (Insert the related values into the Assignment table and leave the assigned hours NULL).
A project of your choice required two programmers and a database designer for 12th of November (or for a date of your choice). Using your data list the name of programmers and database designers who are available for 12th November 2012(or the date you have chosen).
this is the code i have used to try and do the above:
SELECT employee.employee_name, projects.project_name, assignments.date_assigned
FROM employee, projects, assignments
where projects.project_name = employee.employee_name
WHERE EMP_JOB_TITLE= 'Programmer'
OR EMP_JOB_TITLE= 'Database designer'
and assignments.date_assigned = '12-NOV-12';
But it is giving me this error:
ORA-00933: SQL command not properly ended
00933. 00000 - "SQL command not properly ended"
*Cause:
*Action:
Error at Line: 4 Column: 1
Any solutions would be greatful :)
i have now edited the code:
SELECT DISTINCT employee.employee_name, projects.project_name, assignments.date_assigned
FROM employee, projects, assignments
WHERE EMP_JOB_TITLE= 'Programmer'
and EMP_JOB_TITLE= 'Database designer'
or assignments.date_assigned = '12-NOV-12';
but the result is showing all duplicates even though i have added the "distinct" query at the start ...
EMPLOYEE_NAME PROJECT_NAME DATE_ASSIGNED
------------------------------ -------------------- -------------
JOHN EDWARDS FOURTHPROJECT 12-NOV-12
PAUL GREEN THIRDPROJECT 12-NOV-12
CARLY EVANS FOURTHPROJECT 12-NOV-12
JOHN EDWARDS FIRSTPROJECT 12-NOV-12
PAUL GREEN SECONDPROJECT 12-NOV-12
JOHN EDWARDS SECONDPROJECT 12-NOV-12
EDWARD MARUBBI THIRDPROJECT 12-NOV-12
EDWARD MARUBBI SIXTHPROJECT 12-NOV-12
PHIL GREEN FIRSTPROJECT 12-NOV-12
PHIL GREEN SECONDPROJECT 12-NOV-12
PHIL GREEN THIRDPROJECT 12-NOV-12
CARLY EVANS SIXTHPROJECT 12-NOV-12
JOHN EDWARDS FIFTHPROJECT 12-NOV-12
EDWARD MARUBBI FIRSTPROJECT 12-NOV-12
PAUL GREEN FIRSTPROJECT 12-NOV-12
PAUL GREEN FOURTHPROJECT 12-NOV-12
CARLY EVANS SECONDPROJECT 12-NOV-12
CARLY EVANS FIFTHPROJECT 12-NOV-12
PHIL GREEN FIFTHPROJECT 12-NOV-12
EDWARD MARUBBI SECONDPROJECT 12-NOV-12
CARLY EVANS FIRSTPROJECT 12-NOV-12
JOHN EDWARDS THIRDPROJECT 12-NOV-12
EDWARD MARUBBI FIFTHPROJECT 12-NOV-12
PAUL GREEN SIXTHPROJECT 12-NOV-12
CARLY EVANS THIRDPROJECT 12-NOV-12
JOHN EDWARDS SIXTHPROJECT 12-NOV-12
PHIL GREEN FOURTHPROJECT 12-NOV-12
PHIL GREEN SIXTHPROJECT 12-NOV-12
EDWARD MARUBBI FOURTHPROJECT 12-NOV-12
PAUL GREEN FIFTHPROJECT 12-NOV-12
i also have been asked to:
Assign the available employees to the project you have selected to answer Q5 (the above question). (Insert the related values into the Assignment table and leave the assigned hours NULL).