Performing Curd Operations by using another table in TeraData

Creating a table From Another table

  1. Create table<data base name><new table name>As<DB Nam><OLD Table name> with Data —With data
  2. Create table<data base name>.<New table name>As<DB Name>.<OLD table name> with no data —- With no data with only structure

 

Updating table from Another table

Update test2 set PNM=”dum2” where pid=

Update principle set principle. Phone= reception. Phone where principal picl=reception pid

 

Creating  table with  Statistics From other table

Create table new as old with data and statists Create table new as old with no data and statists; Create table new as(select*from old)with data and statists

 

Note

To load only data from one table to other table go to ”Insert select”

 

FAQ’S

 

Difference between drop and delete

Drop

Delete

1.Drops the objects(it removes the space no structure data available)1) Delete only data
  1. DDL Command
2.DML Command Delete are works like truncate
3.It’s drops any objects3.It’s only table and views
4.No roll back4.Roll back is there
  1. No transient journal overhead
5.Transcient journal over head
6.Does not support where condition6.Support where condition

 

 

 

What is difference between delete and delete all

Ans:- Delete all runs faster than normal delete, because below reason

  1. No Transient journal over head
  2. Works like a truncate command
  3.  No roll back
  4. It works directly on master and cylinder index.

 

Why insert select runs faster than normal insertion

Ans:-

Screenshot_70

 

 

With same amp the rows will be moved it’s runs faster.

Because same Amp operation

 

Revoke privilege

A          B

X,y,z

m1,m2

Grant Insert on X to B

Grant select on X to B

Revoke Insert on X to B

Revoke select on X to B

 

Give

If runs for one database access rights to other, that means if the data base having 50 users with different privileges à we can trans for all the 50 users and privileges and other database.

A(DB)                                              B(DB)

100 Tables 2100 Tables 2Give my DB to finance;

50 users——- 50 users

 

Screenshot_71

If transactor data base access Give A to B

2Working with select statement?

To retrieve the data from data base in the required format, in the required column, we use select statement

 

Syntax

Select Columns/* From<Table name>

Where<Condition>or<Sub query>à filters select stat

Group by<columns>or<Expression>or<Numeric’s>

Having<Condition>or<Sub query>à filter group data

Order by<columns>Ascending/descending

(or)

Numeric’s

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on Performing Curd Operations by using another table in TeraData"

    Leave a Message

    Your email address will not be published. Required fields are marked *

    Support


    Please leave a message and we'll get back to you soon.
    Three + 6