🐈
zeeSQL
  • zeeSQL, SQL and search by value for Redis. Fast, Simple and Reliable.
  • How to
    • How to choose between QUERY and EXEC
    • know-what-secondary-indexes-are defined
    • How to load zeeSQL in Redis
    • How to check if an index is used in zeeSQL and SQLite
    • know-what-secondary-indexes-are defined
    • create-an-index
    • create-a-view
    • create-a-secondary-index
    • How to create a trigger
    • quickly-ingest-data
    • How to copy a database
    • get-help
    • work-with-dates
    • using-full-text-search
    • work-with-json
    • How to create a new database in zeeSQL
    • How to create a new table in zeeSQL
    • know-what-tables-are-defined
    • know-what-databases-are-defined
    • works-with-boolean
    • How to get zeeSQL
    • How to get JSON output
    • add-multiple-rows
  • blog
    • node
      • Using RediSQL with Node.js
    • JSON on Redis via RediSQL, SQL steroids for Redis
    • golang
      • Using RediSQL with Go(lang)
    • Doubling the performances of RediSQL, SQL steroids for Redis.
    • zeeSQL now runs on SQLite 3.35
    • Query Redis on two attributes
    • RediSQL for analytics
    • Copying RediSQL databases
    • Release 0.9.0 of RediSQL, SQL steroids for Redis
    • Release 0.8.0 of RediSQL, SQL steroids for Redis
    • Release 0.7.0 of RediSQL, SQL steroids for Redis
    • JSON on Redis via RediSQL, SQL steroids for Redis
    • Release 0.6.0 of RediSQL, SQL steroids for Redis
    • python
      • using-redisql-with-python
    • Release 0.5.0 of RediSQL, SQL steroids for Redis
  • References
  • zeeSQL commits to backward compatibility
  • zeeSQL, a solid product for busy developer
  • zeeSQL and secondary indexes, how to search Redis key by value
  • Tutorial
  • Pricing for zeeSQL
  • Why you should migrate from RediSQL to zeeSQL
  • FAQs
  • Motivation
Powered by GitBook
On this page

Was this helpful?

  1. How to

How to create a new table in zeeSQL

PreviousHow to create a new database in zeeSQLNextknow-what-tables-are-defined

Last updated 4 years ago

Was this helpful?

After you have created a new database, the next likely action, will be to create a set of tables to store information.

zeeSQL uses SQLite under the hood, hence it can work with all the SQL queries that can be managed by SQLite.

Suppose you have created a new database with:

127.0.0.1:6379> ZEESQL.CREATE_DB DB
1) 1) "OK"

You can now create a new table executing a command against that database:

127.0.0.1:6379> ZEESQL.EXEC DB COMMAND "CREATE TABLE foo(col1 STRING, col2 INT, col3 STRING);"
1) 1) "DONE"
2) 1) (integer) 0

This command will create a table called foo with 3 columns. The first column is called col1 and has type STRING, the second column is called col2 and has type INT and the last column is called col3 again of type STRING.

We know that everything went well because the result was "DONE". Moreover, zeeSQL is telling us that 0 rows were modified, this is correct since we only created a new table.

You can create an unlimited number of tables.

The documentation page of SQLite describes all the options and the syntax available to create a new table. All of them are available in zeeSQL.

About zeeSQL

zeeSQL is a Redis Module that provides SQL capabilities to Redis. It allows the creation and management of several SQL databases, each one independent from the other. Moreover, zeeSQL provides out-of-the-box capabilities, allowing fast and easy search by value in Redis.

CREATE TABLE
secondary indexes