Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5947431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:57:47+00:00 2026-05-22T16:57:47+00:00

An example from my Oracle SQL Certified Expert Exam study guide has me puzzled.

  • 0

An example from my Oracle SQL Certified Expert Exam study guide has me puzzled.

The SQL statement:

INSERT
  WHEN (BOSS_SALARY-EMPLOYEE_SALARY < 10000) THEN
    INTO SALARY_CHART (EMP_TITLE, SUPERIOR, EMP_INCOME, SUP_INCOME)
    VALUES (EMPLOYEE, BOSS, EMPLOYEE_SALARY, BOSS_SALARY)
SELECT A.POSITION EMPLOYEE
  , B.POSITION BOSS
  , A.MAX_SALARY EMPLOYEE_SALARY
  , B.MAX_SALARY BOSS_SALARY
FROM POSITIONS A
  JOIN POSITIONS B ON A.REPORTS_TO_POSITION_ID = B.POSITION_ID

The explanation from the book:

Note that this version has done more
than is required, and applies column
aliases to each column in the
subquery, then references those column
aliases from the WHEN and VALUES
clauses. We only needed column
aliases on A.POSITION and B.POSITION
in lines 5 and 6, so we can reference the column aliases in line 4.

My source of confusion:

Don’t we also need the aliases on the two MAX_SALARY columns selected in lines 7 and 8, in order to distinguish them in line 4? The explanation seems to suggest the EMPLOYEE_SALARY and BOSS_SALARY aliases are extraneous…

Can someone please clarify this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T16:57:48+00:00Added an answer on May 22, 2026 at 4:57 pm

    I’m guessing they meant they only need it on two columns (eg A.POSITION and A.MAX_SALARY) to disambiguate for the parser. For example, this would work:

    INSERT
      WHEN (MAX_SALARY-EMPLOYEE_SALARY < 10000) THEN
        INTO SALARY_CHART (EMP_TITLE, SUPERIOR, EMP_INCOME, SUP_INCOME)
        VALUES (EMPLOYEE, POSITION, EMPLOYEE_SALARY, MAX_SALARY)
    SELECT A.POSITION EMPLOYEE
      , B.POSITION 
      , A.MAX_SALARY EMPLOYEE_SALARY
      , B.MAX_SALARY 
    FROM POSITIONS A
      JOIN POSITIONS B ON A.REPORTS_TO_POSITION_ID = B.POSITION_ID
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an oracle sql query select distinct tab1.col1, tab2.col1 from table1 tab1 join
I am migrating data from a Oracle on VMS that accesses data on SQL
Dear SQL Gurus from Stack Overflow: Environment: Oracle I'm trying to understand why I
I am moving a vb.net application from Oracle Lite to Sybase SQL anywhere. I
Database : SQL Server 2008 Is there a way to have an insert statement
I have successfully simulated an Oracle CONNECT BY statement in SQL Server 2008 by
For example: from datetime import <c-x><c-o>{list of modules inside datetime package}
I've downloaded Kigg example from codeplex, but it's seems to be outdated. Is there
I am using the example from TheElements sample code provided with the iPhone SDK
In the BubbleLevel example from apple they implement an +initialize method. They say: +initialize

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.