Delete Data & Drop Hive Tables
Watch more Videos at https://www.tutorialspoint.com/videotutorials/index.htm
Lecture By: Mr. Arnab Chakraborty, Tutorials Point India Private Limited
Show More Show Less View Video Transcript
0:00
In this video we are discussing delete data and drop tables
0:05
So, the basic difference between delete data and drop tables will be that, in case of delete
0:10
data, the data will get deleted, but the table structure will be there. But in case of drop table, along with the data, the table structure will be deleted here
0:19
So now let us go for some more in detailing about this topic
0:23
So how to delete data from Hype Table? To delete all of the stored data from the table, we need to
0:29
use the truncate table command. So, command is truncate table command. So, the truncate
0:37
command will not delete the whole table schema, and it will delete only the data. So
0:44
that means only the data will get deleted, not the table schema, not the table structure
0:48
So, command is truncate table. So, the syntax will be truncate table name. So data will get
0:55
deleted and the table schema and structure will survive. The drop command is used to delete the whole schema of the table so syntax will be dropped table
1:06
table name semicolon so there is a syntax with the help of which you can drop the table schema
1:11
there so for both cases the main data will also be removed from the sdfs so for the both
1:19
cases the main data file will also be removed from the sdfs so in the both cases the data
1:25
will be removed from the file so now let us go for one practical demonstration
1:29
to discuss and to issue such commands practically so that you can get the topic in a better way
1:37
In this demonstration we shall show you that how to delete data from the Hibb table So in this case what we are doing we are going for truncate table name So the command will be truncate table table name
1:51
So before going for any deletion, so let me show you that what is the current content
1:56
So select star from stood. So you can find that we're having six rows there
2:03
So truncate table stood. in case of truncate table stood the table structure will survive it will persist
2:14
but the content will get deleted so if you go on this select start from stood
2:20
here then you can find that there is no content but the table structure is
2:24
existing so how to delete the table itself then you shall go for drop table
2:30
you should go for drop table stood so that table has got deleted
2:36
ultimately the table has got deleted so now if you go for say select star from stood so
2:45
you see error is being shown so in this way I've shown you that how to delete all
2:51
the records from the table and how to drop the table itself then you can go for
2:56
drop a database so name of my database was my database so drop database so drop database
3:06
my database I think the my was M was capital so let me make it M capital you see the
3:14
database has also also been dropped so in this way in this particular demonstration
3:19
I've shown you that how to delete and the records from the table how to drop the
3:26
table and how to drop the database also thanks for watching this
#Enterprise Technology
#Data Management
#Programming
#Programming
#Educational Software

