0
0
Hadoopdata~10 mins

Creating databases and tables in Hadoop - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a new database named 'sales_db'.

Hadoop
CREATE DATABASE [1];
Drag options to blanks, or click blank then click option'
ADATABASE
BCREATE
CTABLE
Dsales_db
Attempts:
3 left
💡 Hint
Common Mistakes
Using keywords like CREATE or TABLE instead of the database name.
Forgetting to specify the database name.
2fill in blank
medium

Complete the code to create a table named 'customers' with columns 'id' (int) and 'name' (string).

Hadoop
CREATE TABLE [1] (id INT, name STRING);
Drag options to blanks, or click blank then click option'
Acustomers
Bsales_db
Corders
Dproducts
Attempts:
3 left
💡 Hint
Common Mistakes
Using the database name instead of the table name.
Using unrelated table names.
3fill in blank
hard

Fix the error in the code to create a database named 'analytics'.

Hadoop
CREATE [1] analytics;
Drag options to blanks, or click blank then click option'
ATABLE
BDATABASE
CSCHEMA
DINDEX
Attempts:
3 left
💡 Hint
Common Mistakes
Using TABLE or INDEX instead of DATABASE.
Confusing SCHEMA with DATABASE in Hadoop.
4fill in blank
hard

Fill both blanks to create a table named 'employees' with columns 'emp_id' (int) and 'emp_name' (string) in the database 'company_db'.

Hadoop
USE [1];
CREATE TABLE [2] (emp_id INT, emp_name STRING);
Drag options to blanks, or click blank then click option'
Acompany_db
Bemployees
Csales_db
Dcustomers
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong database name in USE statement.
Mixing up table names.
5fill in blank
hard

Fill all three blanks to create a partitioned table named 'logs' with columns 'log_id' (int), 'log_message' (string), partitioned by 'log_date' (string).

Hadoop
CREATE TABLE [1] (log_id INT, log_message STRING) PARTITIONED BY ([2] STRING) STORED AS [3];
Drag options to blanks, or click blank then click option'
Alogs
Blog_date
CTEXTFILE
Dlog_message
Attempts:
3 left
💡 Hint
Common Mistakes
Using a non-partition column in the PARTITIONED BY clause.
Forgetting to specify storage format.
Mixing up column names.