![]() Now let’s see how Primary Key works in Redshift as follows.īasically, Uniqueness, primary key, and foreign key requirements are instructive just they are not implemented by Amazon Redshift. Above mentioned syntax is depending on the user requirement that means as per user requirement we can use any one of the syntaxes. In the above syntax, we use alter table command to add the primary key into the existing table, in this syntax we need to pass the constraint name that is the primary key as well as the specified column name that we need to assign the primary key. ![]() In a second way, we can use the alter command to add the primary key constraint into the existing table as follows.Īlter table specified table name add specified constraint name primary key (specified colm name) At the end of syntax, we need to add the constraint name that is the primary key as per user requirements. Here we specify the different column names with different data types and their sizes as shown. ![]() In the above syntax, we use create table statement to create the table with primary key constraint as shown in the above syntax. Create table table_name (colm name 1 data type(size), colm name 2 data type(size), colm name N data type(size) specified constraint name(Primary Key) (specified colm name)) ![]()
0 Comments
Leave a Reply. |