Delete All Rows In A Table Using TRUNCATE Query

1 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$99.99
List Price:  $139.99
You save:  $40
€86.14
List Price:  €120.61
You save:  €34.46
£74.70
List Price:  £104.58
You save:  £29.88
CA$139.23
List Price:  CA$194.92
You save:  CA$55.69
A$149.59
List Price:  A$209.44
You save:  A$59.84
S$128.84
List Price:  S$180.39
You save:  S$51.54
HK$779.65
List Price:  HK$1,091.55
You save:  HK$311.89
CHF 80.26
List Price:  CHF 112.37
You save:  CHF 32.11
NOK kr1,008.04
List Price:  NOK kr1,411.30
You save:  NOK kr403.25
DKK kr643.31
List Price:  DKK kr900.66
You save:  DKK kr257.35
NZ$173.57
List Price:  NZ$243
You save:  NZ$69.43
د.إ367.21
List Price:  د.إ514.11
You save:  د.إ146.90
৳12,244.69
List Price:  ৳17,143.06
You save:  ৳4,898.36
₹9,086.09
List Price:  ₹12,720.89
You save:  ₹3,634.80
RM405.70
List Price:  RM568
You save:  RM162.30
₦142,254.84
List Price:  ₦199,162.46
You save:  ₦56,907.62
₨28,017.86
List Price:  ₨39,226.13
You save:  ₨11,208.26
฿3,131.39
List Price:  ฿4,384.07
You save:  ฿1,252.68
₺4,327.38
List Price:  ₺6,058.51
You save:  ₺1,731.12
B$538.39
List Price:  B$753.77
You save:  B$215.38
R1,640.55
List Price:  R2,296.83
You save:  R656.28
Лв168.60
List Price:  Лв236.05
You save:  Лв67.44
₩147,342.26
List Price:  ₩206,285.06
You save:  ₩58,942.80
₪313.59
List Price:  ₪439.03
You save:  ₪125.44
₱5,937.30
List Price:  ₱8,312.46
You save:  ₱2,375.15
¥15,817.91
List Price:  ¥22,145.71
You save:  ¥6,327.80
MX$1,762.41
List Price:  MX$2,467.44
You save:  MX$705.03
QR364
List Price:  QR509.62
You save:  QR145.61
P1,337.07
List Price:  P1,871.96
You save:  P534.88
KSh12,914.13
List Price:  KSh18,080.31
You save:  KSh5,166.17
E£4,709.53
List Price:  E£6,593.54
You save:  E£1,884
ብር15,621.62
List Price:  ብር21,870.90
You save:  ብር6,249.27
Kz91,187.68
List Price:  Kz127,666.40
You save:  Kz36,478.72
CLP$88,341.16
List Price:  CLP$123,681.16
You save:  CLP$35,340
CN¥696.88
List Price:  CN¥975.66
You save:  CN¥278.78
RD$6,378.23
List Price:  RD$8,929.78
You save:  RD$2,551.54
DA12,997.98
List Price:  DA18,197.69
You save:  DA5,199.71
FJ$227.92
List Price:  FJ$319.10
You save:  FJ$91.18
Q767.57
List Price:  Q1,074.63
You save:  Q307.06
GY$20,941.41
List Price:  GY$29,318.82
You save:  GY$8,377.40
ISK kr12,596.21
List Price:  ISK kr17,635.20
You save:  ISK kr5,038.98
DH921.72
List Price:  DH1,290.44
You save:  DH368.72
L1,701.82
List Price:  L2,382.61
You save:  L680.79
ден5,303.42
List Price:  ден7,425
You save:  ден2,121.58
MOP$804.30
List Price:  MOP$1,126.05
You save:  MOP$321.75
N$1,639.23
List Price:  N$2,295
You save:  N$655.76
C$3,684.09
List Price:  C$5,157.87
You save:  C$1,473.78
रु14,532.17
List Price:  रु20,345.62
You save:  रु5,813.45
S/336.40
List Price:  S/470.97
You save:  S/134.57
K427.68
List Price:  K598.77
You save:  K171.09
SAR374.92
List Price:  SAR524.90
You save:  SAR149.98
ZK2,009.79
List Price:  ZK2,813.79
You save:  ZK803.99
L438.16
List Price:  L613.45
You save:  L175.28
Kč2,090.01
List Price:  Kč2,926.10
You save:  Kč836.09
Ft33,246.44
List Price:  Ft46,546.34
You save:  Ft13,299.90
SEK kr921.77
List Price:  SEK kr1,290.52
You save:  SEK kr368.74
ARS$142,935.70
List Price:  ARS$200,115.70
You save:  ARS$57,180
Bs691.75
List Price:  Bs968.48
You save:  Bs276.73
COP$368,986.40
List Price:  COP$516,595.73
You save:  COP$147,609.32
₡48,928.85
List Price:  ₡68,502.35
You save:  ₡19,573.49
L2,640.20
List Price:  L3,696.39
You save:  L1,056.18
₲684,267.94
List Price:  ₲958,002.49
You save:  ₲273,734.55
$U3,860.51
List Price:  $U5,404.87
You save:  $U1,544.36
zł364.01
List Price:  zł509.63
You save:  zł145.62
Already have an account? Log In

Transcript

Hello, in this video, I'm going to show you how to delete all the rows and a table using the truncate query. We've looked at using the Delete query, which will delete a row or multiple rows based on a particular condition or where a particular column value equals uncle milk. Boy, if you just want to flat out, not delete the entire table, but just delete its content. So maybe you want to sort of reset the table, maybe you're creating a website for testing. And you want to, you know, reset to know when you go live to do a second really simple. So I've got this table called cause.

And this is the latest version that you can see, and I want to delete all of these rows. And imagine if you have like a million rows or five rows, you want to do it manually, you don't do that. So to do it, it's really simple. First of all, as usual, you want to create a query, which equals action and and you just put on truncate, truncate basically means to, you know, get rid of, and you say table. And now we specify the actual table name. So, cause I believe.

And now we need to run this. So we re execute. And now, if I was to, obviously don't do anything yet, but if I reload this, and I'm looking at, as you can see, cause is now empty. Our other table is fine, but this basically deleted all the contents in the cause table. And that's really all there is that you need to know regarding the truncate query. If you have any questions, feel free to pop me a message.

And as usual, I look forward to seeing you in the next video.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.