This is homework.
Here is the problem: Produce a list of employee last name, first name and department name. Use appropriate, user friendly column aliases.
This is from the tables
DEMO.DEPARTMENT . The relevant column names are
LAST_NAME, FIRST_NAME, DEPARTMENT_ID (from
DEMO.EMPLOYEE ) and
DEPARTMENT_ID, NAME from
As you can see, I need to have the last and first name columns from
DEMO.EMPLOYEE and use the department id column to look up the department name in
DEMO.DEPARTMENT . I will use the
SELECT x AS y command to give the columns good aliases but I can't figure out how to reference the columns to each other. I tried the
REPLACE command, but I couldn't get that to work and I couldn't find anything else. Any help would be appreciated.
Jump to Post
1. If you are logging in as Demo, there is no need to specify "Demo.".
If you are logging into a different schema, then keep the "Demo.".
2. You can use Aliases.
From Department D, Employee E
3. Select your columns...
Select E.Last_Name …
All 6 Replies
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.