Database Reference
In-Depth Information
Here is the definition for the first iteration:
CREATE TABLE my_schema.users (
username varchar primary key,
firstname varchar,
lastname varchar,
email varchar,
password varchar,
created_date timestamp
);
Try to run this with the following script:
create_table_users.sh
Now, enter the Phoenix shell, as follows:
./sqlline.sh localhost
Then, run the following command:
0: jdbc:phoenix:localhost> !columns my_schema.users
On running the command, you will get the description of the table you just created,
like this:
Now, let's discuss each element in CREATE TABLE my_schema.users and why
we made it the way we did. First, the field describing the key:
username varchar primary key
You might be surprised to find that the primary key is an element of the actual
data and not an artificially generated entity. However, generated keys are bad.
 
Search WWH ::




Custom Search