Created
November 1, 2022 08:49
-
-
Save chandra-prakash-meghwal/8c14a2ad1a489340cf627213da701e22 to your computer and use it in GitHub Desktop.
an sql query example to create a table with column having data type bigserial, integer, bigint, boolean, varchar and specified primary key
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*create a sample table with table name user_credits and columns id primary key, username, credit_assigned, credit_expire_time, is_user_kyced*/ | |
CREATE TABLE user_credits (id BIGSERIAL PRIMARY KEY, username VARCHAR(25), credit_assigned integer, credit_expire_time bigint, is_user_kyced boolean); | |
/* | |
bigserial 8 bytes large autoincrementing integer 1 to 9223372036854775807 | |
integer 4 bytes typical choice for integer -2147483648 to +2147483647 | |
bigint 8 bytes large-range integer -9223372036854775808 to +9223372036854775807 | |
boolean 1 byte state of true or false | |
VARCHAR(size) A VARIABLE length string (can contain letters, numbers, and special characters). The size parameter specifies the maximum string length in characters - can be from 0 to 65535 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment