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 Job = ‘Waiter’;
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 IN (’01-Aug-2018′,’04-Aug-2018′,’29-OCt-2018′) ORDER BY HireDate DESC;
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 BETWEEN (’01-Jan-2018′) AND (’31-Dec-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 * FROM emp WHERE Sal*12 BETWEEN 600000 AND 1000000;
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 EName LIKE ‘N____’; Or SELECT * FROM emp WHERE EName LIKE ‘N%’ AND len(EName) = 5;


Description