Assignment 3
Assignment 3
Assignment 3
Consider the two relations EMP and ASG given in the the image. Insert 100 records in each by
assumed values. Also Apply several predicates to execute the queries, given four different sites.
2. The second query is for Those projects that have a budget of less than or equal to $200,000 are
managed at one site, budget between $240000 and $ 320000 are managed at second site whereas
those between $350000 and $ 450000 budgets are managed at a third site, whereas those with
larger budgets are managed at a fourth site.
SELECT
PNO,
BUDGET,
CASE
WHEN BUDGET <= 200000 THEN 'Site 1'
WHEN BUDGET BETWEEN 240000 AND 320000 THEN 'Site 2'
WHEN BUDGET BETWEEN 350000 AND 450000 THEN 'Site 3'
ELSE 'Site 4'
END AS SITE
FROM ASG;