1. Display the name of each employee, the name and department to which the perso
ID: 3624588 • Letter: 1
Question
1. Display the name of each employee, the name and department to which the person is assigned, and the location of each department. Join the EMP and DEPT tables through the WHERE clause.
2. Display the name of each employee, the name of the department to which the person is assigned, and the location of each department. Join the EMP and DEPT tables using the NATURAL JOIN keywords.
3. Display the name of each employee, the name of the department to which the perso is assigned, and the location of each department. Join the EMP and DEPT tables using the JOIN...ON keywords.
4. Display the names of each employee, the name of the department to which the person is assigned, and the location of each department. Join the EMP and DEPT tables using the JOIN...USING keywords.
5. Display the name and job title of each employee and the name of the department they work in. Use the WHERE clause to create the join.
6. Display the name and job title of each employeeand the name of the department they work in. Use the JOIN...ON keywords.
7. Display the name and job title of each employee and the name of the department they work in. Use the JOIN...USING keywords to create the join.
8. Display the name and job title of each employee and the name of the employee's department. Include any employee that does not have a department in the results.
9. Display the name of any department that does not have any employees currently assigned to it.
10. Display any department that deos not have a salesman assigned to it.
Explanation / Answer
Need to know the tables of your database in order to get started on the select statements.
Format for the select statements are:
SELECT
FROM
WHERE
ORDER BY
for the SELECT you would put the attribute of the table
EX: Table Employee (EID, Lname, Fname, SSN, DOB) EID = Employee ID and is the Primary Key
So for me to view last name of an employee I would make the following statement
SELECT EID, Lname, Fname
FROM Employee
Order By Lname, Fname
This statement will display the EID, Lastname, and firstname from the employee table.
Order By sort's them by Lastname, then by first name, hope this gets you in the right direction.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.