CREATE TABLE in Teradata

Creating a qualified table in a database is everything.
Tables are the backbones and working platform for rendering any kind of commands or queries.

ForgetCode welcomes you to create tables in Teradata to start work upon everything!

Syntax:
CREATE TABLE tablename
(column1 datatype,
 column2 datatype,
 column3 datatype,
 .
 .
 columnN datatype
)


Note:
Teradata allows users to use CT instead of CREATE TABLE for simplicity.

Options in Teradata while table creation:

1. SET (Allow only unique values/records)
2. MULTISET (Duplicate values/records allowed)

Users can select any option.
However, Teradata applies SET option by default to show it's care for our tables.
So, if we insert duplicate rows with above code, error will be thrown.
Ultimately the code written above becomes equal to the code below.

Syntax:
CREATE SET TABLE tablename
(column1 datatype,
 column2 datatype,
 column3 datatype,
 .
 .
 columnN datatype
)


In some cases, users need duplicate entries for thier requirements.
So they can go with MULTISET option.

Syntax:
CREATE MULTISET TABLE tablename
(column1 datatype,
 column2 datatype,
 column3 datatype,
 .
 .
 columnN datatype
)


Few ForgetCode examples:

CREATE MULTISET TABLE tbl_employee
( EmpID INT,
 EmpName VARCHAR(20)
)

 Duplicate entries are allowed



CREATE SET TABLE tbl_employee
( EmpID INT,
 EmpName VARCHAR(20)
)

 Duplicate entries are not allowed



...