Performing Curd Operations by using another table in TeraData

Ratings:
(4)
Views: 660
Banner-Img
Share this blog:

 

Creating a Table From Another table

  • Create table<data base name><new table name>As<DB Nam><OLD Table name> with Data ---With data
  • 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 a table with  Statistics From another 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 another table go to ”Insert select”  

Inclined to build a profession as Teradata Developer? Then here is the blog post on, explore Teradata Training

FAQ’S  

Q1) Difference between the drop and delete

Ans:

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 worked like truncate
3.It’s drops any objects 3.It’s only table and views
4.No rollback 4.Roll back is there
  1. No transient journal overhead
5.Transcient journal overhead

6.Doesn't support where the condition

6.Support where condition

Q2) What is the difference between delete and delete all

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

  • No Transient journal overhead
  • Works like a truncate command
  •  No rollback
  • It works directly on the master and cylinder index.

Q3) Why insert select runs faster than normal insertion

Ans:-

Insert    

  • With the same amp, the rows will be moved it 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 others, that means if the database having 50 users with different privileges à we can trans for all the 50 users and privileges and other databases. A(DB)                                              B(DB)

100 Tables 2100 Tables 2Give my DB to finance;

50 users------- 50 users

  Give

If transactor database access Give A to B

2Working with the select statement?

To retrieve the data from the database 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                                    

For an in-depth knowledge, click on below

You liked the article?

Like: 0

Vote for difficulty

Current difficulty (Avg): Medium

EasyMediumHardDifficultExpert
IMPROVE ARTICLEReport Issue

About Author

Authorlogo
Name
TekSlate
Author Bio

TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.