Question : Which of the following WHERE clauses contains an error? The SELECT and FROM clauses are SELECT * FROM HADOOPEXAM: 1. WHERE JOIN_DATE IN ('02-JUN-2004'); 2. WHERE USER_ID IN ('1000','4000','2000'); 3. Access Mostly Uused Products by 50000+ Subscribers 4. WHERE RANK BETWEEN 0.1 AND 0.5;
Explanation: Character literal should be in single quote e.g. 'MISS'
Question : Choose the WHERE clause that extracts the USER_NAME values containing the character literal "ab" from the DEPARTMENTS table. The SELECT and FROM clauses are SELECT USER_NAME FROM DEPARTMENTS: 1. WHERE USER_NAME IN ('%a%b'); 2. WHERE USER_NAME LIKE '%ab%'; 3. Access Mostly Uused Products by 50000+ Subscribers 4. WHERE USER_NAME CONTAINS 'a%b';
1. DELETE FROM TableA WHERE NOT EXIST ( SELECT * FROM TableB WHERE TableA.field1 = TableB.fieldx AND TableA.field2 = TableB.fieldz ); 2. DELETE FROM TableA WHERE IN ( SELECT * FROM TableB WHERE TableA.field1 = TableB.fieldx AND TableA.field2 = TableB.fieldz ); 3. Access Mostly Uused Products by 50000+ Subscribers WHERE NOT IN ( SELECT * FROM TableB WHERE TableA.field1 = TableB.fieldx AND TableA.field2 = TableB.fieldz ); 4. DELETE FROM TableA WHERE NOT EXISTS ( SELECT * FROM TableB WHERE TableA.field1 = TableB.fieldx AND TableA.field2 = TableB.fieldz );
Question : Select the statement which is not correct ? 1. SELECT department, SUM(sales) AS "Total sales" FROM order_details GROUP BY department HAVING SUM(sales) > 25000; 2. SELECT department, COUNT(*) AS "Number of employees" FROM employees WHERE salary & lt; 49500 GROUP BY department HAVING COUNT(*) > 10; 3. Access Mostly Uused Products by 50000+ Subscribers FROM employees GROUP BY department HAVING MIN(salary) & lt; 42000; 4. 1 and 3