{"id":76594,"date":"2025-01-19T15:56:51","date_gmt":"2025-01-19T15:56:51","guid":{"rendered":"http:\/\/bangla.sitestree.com\/?p=76594"},"modified":"2025-01-19T15:56:53","modified_gmt":"2025-01-19T15:56:53","slug":"case-statement-in-oracle-pl-sql","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=76594","title":{"rendered":"Case Statement in Oracle PL\/SQL"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>Write a SQL block that will categorize Employee Salaries. If the Salary is higher than average, it will show &#8216;Above Average&#8217; to the output. If the Salary is lower than the average it will show &#8216;Below average&#8217; to the output. Use HR.Employees Table. Also, utilize CASE statement.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT employee_id,\n       CASE \n           WHEN salary > (SELECT AVG(salary) FROM hr.employees) \n                THEN 'Above Average'\n           WHEN salary &lt; (SELECT AVG(salary) FROM hr.employees) \n                THEN 'Below Average'\n           ELSE 'Average'\n       END AS salary_comparison\nFROM hr.employees\norder by salary_comparison;\n\n-- Ref: with a bit of information from the Internet<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Write a SQL block that will categorize Employee Salaries. If the Salary is higher than average, it will show &#8216;Above Average&#8217; to the output. If the Salary is lower than the average it will show &#8216;Below average&#8217; to the output. Use HR.Employees Table. Also, utilize CASE statement.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-76594","post","type-post","status-publish","format-standard","hentry","category-root","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":76602,"url":"http:\/\/bangla.sitestree.com\/?p=76602","url_meta":{"origin":76594,"position":0},"title":"Dynamic SQL","author":"Sayed","date":"January 30, 2025","format":false,"excerpt":"\"Dynamic SQL is the SQL statement that is constructed and executed at runtime based on input parameters passed\" https:\/\/www.sqlshack.com\/dynamic-sql-in-sql-server\/ Example: ChatGPT DECLARE @sql AS NVARCHAR(MAX) SET @sql = 'SELECT * FROM Employees WHERE Department = ''' + @department + '''' EXEC sp_executesql @sql Another Example: Oracle table_name := 'HR.Employees'; dyn_sql\u2026","rel":"","context":"In &quot;Root&quot;","block_context":{"text":"Root","link":"http:\/\/bangla.sitestree.com\/?cat=1"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5969,"url":"http:\/\/bangla.sitestree.com\/?p=5969","url_meta":{"origin":76594,"position":1},"title":"SQL (\u098f\u09b8\u0995\u09bf\u0989\u098f\u09b2) NULL Values(\u09ae\u09be\u09a8): SQL Null Values","author":"Author-Check- Article-or-Video","date":"January 30, 2015","format":false,"excerpt":"SQL (\u098f\u09b8\u0995\u09bf\u0989\u098f\u09b2) NULL Values(\u09ae\u09be\u09a8): Null value \u09ac\u09b2\u09a4\u09c7 \u0985\u09a8\u09c1\u09aa\u09b8\u09cd\u09a5\u09bf\u09a4 \u09ac\u09be \u09ae\u09be\u09a8\u09b9\u09c0\u09a8 data \u09ac\u09c1\u099d\u09be\u09df \u0964 \u098f\u09b0 \u09ae\u09be\u09a8 \u0995\u0996\u09a8 \u09b6\u09c1\u09a8\u09cd\u09af \u09ac\u09be \u0996\u09be\u09b2\u09bf \u09b8\u09cd\u099f\u09cd\u09b0\u09bf\u0982 (String) \u09b9\u09df \u09a8\u09be \u098f\u09ac\u0982 \u098f\u0987 \u09b6\u09c1\u09a8\u09cd\u09af \u09ac\u09be \u0996\u09be\u09b2\u09bf \u09b8\u09cd\u099f\u09cd\u09b0\u09bf\u0982(String) \u098f\u0995\u099f\u09bf \u09ae\u09be\u09a8 \u09aa\u09cd\u09b0\u0995\u09be\u09b6 \u0995\u09b0\u09c7 \u0995\u09bf\u09a8\u09cd\u09a4\u09c1 \u0986\u09ae\u09b0\u09be \u099c\u09be\u09a8\u09bf NULL \u098f\u09b0 \u0995\u09cb\u09a8 \u09ae\u09be\u09a8 \u09a8\u09c7\u0987 \u0964 NULL \u098f\u09b0 \u09ae\u09be\u09a8 NULL \u098f \u0997\u09a0\u09bf\u09a4 \u0997\u09be\u09a3\u09bf\u09a4\u09bf\u0995 \u09ab\u09b2\u09be\u09ab\u09b2\u2026","rel":"","context":"In &quot;\u098f\u09b8 \u0995\u09bf\u0989 \u098f\u09b2 - \u09e6\u09e6\u09e7 \u0964 SQL - 001&quot;","block_context":{"text":"\u098f\u09b8 \u0995\u09bf\u0989 \u098f\u09b2 - \u09e6\u09e6\u09e7 \u0964 SQL - 001","link":"http:\/\/bangla.sitestree.com\/?cat=155"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5965,"url":"http:\/\/bangla.sitestree.com\/?p=5965","url_meta":{"origin":76594,"position":2},"title":": SQL Views","author":"Author-Check- Article-or-Video","date":"January 30, 2015","format":false,"excerpt":"Title: SQL Views \u0985\u09a8\u09c1\u09ac\u09be\u09a6\u0995: \u09ab\u09df\u09b8\u09be\u09b2 \u09b0\u0995\u09bf (\u098f\u09ae.\u098f) Total words in the article: 478 SQL \u098f view \u09ac\u09b2\u09a4\u09c7 virtual table \u098f\u09b0 view \u0995\u09c7 \u09ac\u09cb\u099d\u09be\u09df, \u0985\u09b0\u09cd\u09a5\u09be\u09ce real table \u0995\u09c7 virtually \u09a6\u09c7\u0996\u09be\u09a8\u09cb \u09b9\u09df\u0964 \u0995\u09bf\u09ad\u09be\u09ac\u09c7 view create, update \u09ac\u09be delete \u0995\u09b0\u09be \u09b9\u09df \u09a4\u09be \u098f\u0987 \u0985\u09a7\u09cd\u09af\u09be\u09df\u09c7 \u0986\u09b2\u09cb\u099a\u09a8\u09be \u0995\u09b0\u09be \u09b9\u09ac\u09c7\u0964 SQL CREATE VIEW Statement SQL statement\u2026","rel":"","context":"In &quot;\u098f\u09b8 \u0995\u09bf\u0989 \u098f\u09b2 - \u09e6\u09e6\u09e7 \u0964 SQL - 001&quot;","block_context":{"text":"\u098f\u09b8 \u0995\u09bf\u0989 \u098f\u09b2 - \u09e6\u09e6\u09e7 \u0964 SQL - 001","link":"http:\/\/bangla.sitestree.com\/?cat=155"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4815,"url":"http:\/\/bangla.sitestree.com\/?p=4815","url_meta":{"origin":76594,"position":3},"title":"13. Odesk Bangla Tutorial Lesson 13, How to Transfer Outsourcing job Salary to Bank,","author":"Author-Check- Article-or-Video","date":"April 5, 2014","format":false,"excerpt":"13. Odesk Bangla Tutorial Lesson 13, How to Transfer Outsourcing job Salary to Bank,","rel":"","context":"In &quot;Complete Courses&quot;","block_context":{"text":"Complete Courses","link":"http:\/\/bangla.sitestree.com\/?cat=29"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":69314,"url":"http:\/\/bangla.sitestree.com\/?p=69314","url_meta":{"origin":76594,"position":4},"title":"Salary\/Wage Canada Government Jobs #34","author":"Author-Check- Article-or-Video","date":"August 17, 2021","format":false,"excerpt":"I think that the following web-pages may give you an understanding of salaries for Government Jobs in Canada. The information provided may not be the most recent information, still you will have an idea. Computer Systems Information Services Home Page MPs' Salaries Public Sector Salaries, B.C Canadian Salary Range Canadian\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":76606,"url":"http:\/\/bangla.sitestree.com\/?p=76606","url_meta":{"origin":76594,"position":5},"title":"Python: MatPlotLib: Plot Data","author":"Sayed","date":"February 6, 2025","format":false,"excerpt":"import pandas as pd import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D columns = [\"J_ID\", \"P_ID\", \"D_ID\", \"Year\", \"JOB_TITLE\", \"Department_Name\", \"Total Salary\", \"Commission\"] df = pd.read_csv(\"datamart.csv\", usecols=columns) # Create a 3D plot fig = plt.figure(figsize=(20, 15)) ax = fig.add_subplot(111, projection='3d') # Scatter plot ax.scatter(df['Year'], df['J_ID'], df['D_ID'], c=df['Total Salary'], cmap='viridis', marker='X')\u2026","rel":"","context":"In &quot;Root&quot;","block_context":{"text":"Root","link":"http:\/\/bangla.sitestree.com\/?cat=1"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2025\/02\/image-1.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2025\/02\/image-1.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/bangla.sitestree.com\/wp-content\/uploads\/2025\/02\/image-1.png?resize=525%2C300 1.5x"},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76594","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=76594"}],"version-history":[{"count":1,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76594\/revisions"}],"predecessor-version":[{"id":76595,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76594\/revisions\/76595"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=76594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=76594"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=76594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}