- Apache Tajo - Custom Functions
- Apache Tajo - JDBC Interface
- OpenStack Swift Integration
- Apache Tajo - Integration with Hive
- Integration with HBase
- Apache Tajo - Storage Plugins
- Apache Tajo - SQL Queries
- Aggregate & Window Functions
- Apache Tajo - SQL Statements
- Apache Tajo - Table Management
- Apache Tajo - Database Creation
- Apache Tajo - JSON Functions
- Apache Tajo - DateTime Functions
- Apache Tajo - String Functions
- Apache Tajo - Math Functions
- Apache Tajo - SQL Functions
- Apache Tajo - Operators
- Apache Tajo - Data Types
- Apache Tajo - Shell Commands
- Apache Tajo - Configuration Settings
- Apache Tajo - Installation
- Apache Tajo - Architecture
- Apache Tajo - Introduction
- Apache Tajo - Home
Apache Tajo Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Apache Tajo - Database Creation
This section explains the Tajo DDL commands. Tajo has a built-in database named default.
Create Database Statement
Create Database is a statement used to create a database in Tajo. The syntax for this statement is as follows −
CREATE DATABASE [IF NOT EXISTS] <database_name>
Query
default> default> create database if not exists test;
Result
The above query will generate the following result.
OK
Database is the namespace in Tajo. A database can contain multiple tables with a unique name.
Show Current Database
To check the current database name, issue the following command −
Query
default> c
Result
The above query will generate the following result.
You are now connected to database "default" as user “user1". default>
Connect to Database
As of now, you have created a database named “test”. The following syntax is used to connect the “test” database.
c <database name>
Query
default> c test
Result
The above query will generate the following result.
You are now connected to database "test" as user “user1”. test>
You can now see the prompt changes from default database to test database.
Drop Database
To drop a database, use the following syntax −
DROP DATABASE <database-name>
Query
test> c default You are now connected to database "default" as user “user1". default> drop database test;
Result
The above query will generate the following result.
OKAdvertisements