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 Upper(EName) LIKE ‘__K%’;
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 to_char(HireDate,’mon’)=’Aug’
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 to_char(HireDate, ‘yy’) LIKE ‘9_’;
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 to_char(HireDate,’MON’) NOT IN ‘(‘Oct’);
SELECT *
FROM emp e
INNER JOIN dept d ON (e.DeptNo = d.DeptNo)
WHERE d.DName = ‘Account’


Description