DEV Community

Talha Munir 🇵🇸
Talha Munir 🇵🇸

Posted on • Updated on

Creating a table in database in BigAnimal

In the last article we saw on how do we connect to the BigAnimal and how we create a database. In this article we will be populating the table with sample data and querying it.

You can access the last article over here

Create a table:

Create a table named associates for storing the status of the employees either active or non active.

CREATE TABLE employees(
  status STRING,
Enter fullscreen mode Exit fullscreen mode

Populate the database with some employees status and their ids

INSERT INTO employees (id, status) VALUES
  (1, 'active'),
  (2, 'inactive'),
  (3, 'active'),
  (4, 'terminated');
Enter fullscreen mode Exit fullscreen mode

Querying on the table:

The below query will display the active employees

SELECT id, status
FROM employees
WHERE status = 'active';
Enter fullscreen mode Exit fullscreen mode

Similarly you can make more tables in the database, populate the data and then query over the data.



Top comments (0)