SQL
SQL Short notes:- 1.get Today Records: TO_CHAR(CREATE_STP, 'MM-DD-YYYY')=TO_CHAR(SYSDATE, 'MM-DD-YYYY') 2.Get UUDID: select sys_guid() from dual; 3.UUID to string : UPPER(REPLACE('5379efd7-cc4b-6fda-e053-2c97f4a10fdb','-')); 1.Second highest salary emp records select * from emp where sal=(select max(sal) from emp where sal<(select max(sal) from emp)) 2.Nth highest salary? 3.HAVING clause :- https://www.techonthenet.com/oracle/having.php SELECT exp1, exp2, ... expression_n, aggregate_function (aggregate_expression) FROM tables [WHERE conditions] GROUP BY expr1, exp2, ... expression_n HAVING having_condition; Ex:- SELECT department, SUM(sales) AS "Total sales" FROM order_details GROUP BY department HAVING SUM(sales) > 25000; 4.Optimize queries based on the query optimization guidelines Follow the SQL best practices to ensure query optimization: 1. Index