Pretty much as the title states: What is the difference between CREATE TABLE and CREATE COLUMN TABLE?
Both seemingly create a table, so what is the difference?
SAP HANA supports tables that store data in a column store or a row store.
These refer to different ways of how the database (HANA) manages the data stored in the tables.
They do not affect how the data can be used in a SQL statement whatsoever.
Technically, the syntax for CREATE TABLE in HANA has been extended to include a way to choose which of the two table types should be created:
CREATE [COLUMN|ROW] TABLE <table_name> ...
This means one can (and probably should) include the table type desired in any CREATE TABLE command, but can also choose to not do that (i.e. to keep compatibility which standard SQL).
Now, which table type you get when not specifying the table type depends on a HANA parameter in the indexserver.ini configuration file.
If the parameter [sql] - [default_table_type] is set to row then not specifying the table type will get a table stored in the row store. This is also the default value for the parameter up until HANA 2 SPS 03 if I'm not mistaken.
With HANA 2 SPS 04 the default for the parameter was finally changed to column.
This is important: with SAP HANA you want the table type to be COLUMN in nearly all cases.
Row store tables have very different performance and memory requirement characteristics and really only serve very specific data access and modification patterns. Those patterns are for example:
UPDATEs on records (think updating the same record thousands of times a second).For the vast majority of all use cases and data types CREATE COLUMN TABLE is the right choice in SAP HANA.
Column store tables support compression, partitioning, memory displacement, and many other techniques that are not available for row store tables.
And yet, both table types "look and feel" the same to any SQL command.
To give an analogy, other DBMS support different table types like "cluster" or "heap" that affect how data gets stored internally while the tables can be used regardless of the chosen type.
The HANA setting for column or row store is a similar choice about internal storage.
All that (and a lot more) is of course documented (e.g. here) and explained in many different places (e.g. my book SAP HANA Administration).
Note that the choice between column or row store has nothing to do with whether the table is a temporary or permanent table. Both table types permanently persist the data as one would expect.
Of course, one can always use CREATE TEMPORARY TABLE which also comes with a whole range of option... CREATE TEMPORARY { ROW | COLUMN } TABLE | LOCAL TEMPORARY { ROW | COLUMN } TABLE but for this answer let's pretend we didn't see that to save our sanity.
It's quite important to understand that HANA has those two fundamentally different implementations of in-memory tables.
Make sure you don't accidentally (by using the default) create row store tables for your mass data analytics or really for most use cases.
Whenever you're unsure about the table type, start off with a column store table and see if that works for your use case. Should you actually have a use case for which row store is the better option, you can (nearly) always convert a table from one storage type to the other via an ALTER TABLE command.
COLUMN TABLEin Hana which creates a TableCREATE COLUMN TABLE? At least that's what documented in the link you provided.CREATE TABLEcan mean both row based and column based, depends on whether the table is temp or non-temp.CREATE <table_type> TABLEgives you the option to manually chooseCOLUMN(orROW).