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 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 |
| 2.DML Command Delete are works like truncate |
3.It’s drops any objects | 3.It’s only table and views |
4.No roll back | 4.Roll back is there |
| 5.Transcient journal over head |
6.Does not support where condition | 6.Support where condition |
What is difference between delete and delete all
Ans:- Delete all runs faster than normal delete, because below reason
- No Transient journal over head
- Works like a truncate command
- No roll back
- It works directly on master and cylinder index.
Why insert select runs faster than normal insertion
Ans:-
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 100 Tables
Give my DB to finance;
50 users——- 50 users
If transactor data base access Give A to B
Working 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
0 Responses on Performing Curd Operations by using another table in TeraData"