Avatto>>DATA SCIENTIST>>SHORT QUESTIONS>>SQL For Machine Learning
EmpNo EName Job MGR HireDa Sal Comm DeptNo
1234 Amit Waiter 8382 19-Oct -18 50000 500 50
5678 Ashish Analyst 8635 2-Nov-18 60000 200 51
SELECT * FROM emp WHERE HireDate < ’01-Jan-2018′;
EmpNo EName Job MGR HireDa Sal Comm DeptNo
1234 Amit Waiter 8382 19-Oct -18 50000 500 50
5678 Ashish Analyst 8635 2-Nov-18 60000 200 51
SELECT *, sal*12 as Annual_Income, FROM emp ORDER BY Annual_Income;
EmpNo EName Job MGR HireDa Sal Comm DeptNo
1234 Amit Waiter 8382 19-Oct -18 50000 500 50
5678 Ashish Analyst 8635 2-Nov-18 60000 200 51
SELECT *, months_between(sysdate,HireDate) as Exp FROM emp WHERE EmpNo IN (SELECT MGR FROM emp);
EmpNo EName Job MGR HireDa Sal Comm DeptNo
1234 Amit Waiter 8382 19-Oct -18 50000 500 50
5678 Ashish Analyst 8635 2-Nov-18 60000 200 51
SELECT EName FROM emp WHERE Comm < Sal;
EmpNo EName Job MGR HireDa Sal Comm DeptNo
1234 Amit Waiter 8382 19-Oct -18 50000 500 50
5678 Ashish Analyst 8635 2-Nov-18 60000 200 51
SELECT EName FROM emp WHERE (sal/30)>200;


Description