Please note, this is a STATIC archive of website www.javatpoint.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
Javatpoint Logo
Javatpoint Logo

Teradata Data Manipulation

The SQL commands used to manipulate the data stored in the Teradata tables.

Insert Records

INSERT INTO statement is used to insert records into the table.

Syntax

Following is the generic syntax for INSERT INTO, such as:

Example

Consider the following student table in which we try to insert records into the table.

Once the above query is inserted, we can use the SELECT statement to view the records from the table.

RollNo FirstName LastName BirthDate
10001 Jack Nicholson 5/6/1990

Insert from another Table

INSERT SELECT statement is used to insert records from another table.

Syntax

Following is the generic syntax for INSERT INTO.

Example

In the following example we insert records into the student table. Create a table called Student_Bkup with the same column definition as student table before running the following insert query.

When the above query is executed, it will insert all records from the student table into the student_bkup table.

Rules

Here are some specific rules to insert records from another table, such as:

  • The number of columns specified in the VALUES list should match with the columns specified in the INSERT INTO clause.
  • Values are mandatory for NOT NULL columns.
  • If no values are specified, then NULL is inserted for nullable fields.
  • The data types of columns specified in the VALUES clause should be compatible with the data types of columns in the INSERT clause.

Update Records

The UPDATE statement is used to update records from the table.

Syntax

Following is the generic syntax for UPDATE.

Example

In the following example we update the student BirthDate to 5/6/1997 for student 10001.

The following output shows that the BirthDate is updated from 5/6/1990 to 5/6/1997 for RollNo 10001.

Rules

Here are some specific rules to update the records from the table, such as:

  • We can update one or more values of the table.
  • If the WHERE condition is not specified, then all rows of the table are impacted.
  • We can update a table with the values from another table.

Delete Records

DELETE FROM statement is used to update records from the table.

Syntax

Following is the generic syntax for DELETE FROM.

Example

In the following example we delete the student 10001 from the table student.

In the following output, we can see that student 10001 is deleted from the table.

Rules

Here are some specific rules to delete records from the tables, such as:

  • We can update one or more records of the table.
  • If the WHERE condition is not specified, then all rows of the table are deleted.
  • We can update a table with the values from another table.






Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA