Complete the code to create a Hive table named 'employees'.
CREATE TABLE employees (id INT, name STRING, department STRING, salary INT) [1];The STORED AS TEXTFILE clause specifies the file format for the Hive table.
Complete the code to load data from HDFS path '/data/employees.txt' into the Hive table 'employees'.
LOAD DATA INPATH '[1]' INTO TABLE employees;
The LOAD DATA INPATH command loads data from the specified HDFS path into the Hive table.
Fix the error in the Hive query to select all employees with id greater than 100.
SELECT * FROM employees WHERE id [1] 100;
The condition id > 100 selects employees with id greater than 100.
Fill both blanks to create a Hive query that counts employees grouped by department.
SELECT [1], COUNT(*) [2] employees GROUP BY [1];
The query selects the department column and counts employees, using FROM to specify the table.
Fill all three blanks to create a Hive query that selects employee names and salaries where salary is greater than 50000.
SELECT [1], [2] FROM employees WHERE [3] > 50000;
The query selects name and salary columns and filters rows where salary is greater than 50000.