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
€84.78
List Price:  €118.70
You save:  €33.91
£74.03
List Price:  £103.65
You save:  £29.61
CA$137.03
List Price:  CA$191.85
You save:  CA$54.82
A$149.39
List Price:  A$209.16
You save:  A$59.76
S$128.48
List Price:  S$179.88
You save:  S$51.39
HK$777.68
List Price:  HK$1,088.79
You save:  HK$311.10
CHF 78.82
List Price:  CHF 110.36
You save:  CHF 31.53
NOK kr1,007.52
List Price:  NOK kr1,410.56
You save:  NOK kr403.04
DKK kr633.37
List Price:  DKK kr886.75
You save:  DKK kr253.37
NZ$171.26
List Price:  NZ$239.78
You save:  NZ$68.51
د.إ367.21
List Price:  د.إ514.11
You save:  د.إ146.90
৳12,215.82
List Price:  ৳17,102.63
You save:  ৳4,886.81
₹8,958.43
List Price:  ₹12,542.16
You save:  ₹3,583.73
RM406.25
List Price:  RM568.77
You save:  RM162.52
₦145,368.46
List Price:  ₦203,521.66
You save:  ₦58,153.20
₨27,909.78
List Price:  ₨39,074.82
You save:  ₨11,165.03
฿3,111.65
List Price:  ฿4,356.44
You save:  ฿1,244.78
₺4,282.40
List Price:  ₺5,995.53
You save:  ₺1,713.13
B$560.03
List Price:  B$784.07
You save:  B$224.03
R1,666.50
List Price:  R2,333.16
You save:  R666.66
Лв165.92
List Price:  Лв232.30
You save:  Лв66.37
₩148,128.05
List Price:  ₩207,385.19
You save:  ₩59,257.14
₪319.42
List Price:  ₪447.20
You save:  ₪127.78
₱5,881.01
List Price:  ₱8,233.65
You save:  ₱2,352.64
¥15,595.27
List Price:  ¥21,834
You save:  ¥6,238.73
MX$1,794.16
List Price:  MX$2,511.90
You save:  MX$717.73
QR364.22
List Price:  QR509.93
You save:  QR145.70
P1,314.12
List Price:  P1,839.82
You save:  P525.70
KSh12,888.71
List Price:  KSh18,044.71
You save:  KSh5,156
E£4,749.52
List Price:  E£6,649.52
You save:  E£1,900
ብር15,533.44
List Price:  ብር21,747.44
You save:  ብር6,214
Kz91,219.51
List Price:  Kz127,710.97
You save:  Kz36,491.45
CLP$90,899.99
List Price:  CLP$127,263.63
You save:  CLP$36,363.63
CN¥702.73
List Price:  CN¥983.86
You save:  CN¥281.12
RD$6,236.10
List Price:  RD$8,730.79
You save:  RD$2,494.69
DA12,962.06
List Price:  DA18,147.41
You save:  DA5,185.34
FJ$227.72
List Price:  FJ$318.82
You save:  FJ$91.09
Q765.98
List Price:  Q1,072.41
You save:  Q306.42
GY$20,914.21
List Price:  GY$29,280.73
You save:  GY$8,366.52
ISK kr12,531.74
List Price:  ISK kr17,544.94
You save:  ISK kr5,013.20
DH912.19
List Price:  DH1,277.11
You save:  DH364.91
L1,687.03
List Price:  L2,361.92
You save:  L674.88
ден5,221.26
List Price:  ден7,309.98
You save:  ден2,088.71
MOP$801.07
List Price:  MOP$1,121.53
You save:  MOP$320.46
N$1,664.38
List Price:  N$2,330.20
You save:  N$665.82
C$3,667.09
List Price:  C$5,134.08
You save:  C$1,466.98
रु14,293.80
List Price:  रु20,011.90
You save:  रु5,718.09
S/335.56
List Price:  S/469.80
You save:  S/134.23
K425.31
List Price:  K595.46
You save:  K170.14
SAR375.05
List Price:  SAR525.08
You save:  SAR150.03
ZK2,259.18
List Price:  ZK3,162.94
You save:  ZK903.76
L431.37
List Price:  L603.94
You save:  L172.56
Kč2,063.95
List Price:  Kč2,889.62
You save:  Kč825.66
Ft33,164.90
List Price:  Ft46,432.19
You save:  Ft13,267.28
SEK kr918.50
List Price:  SEK kr1,285.94
You save:  SEK kr367.43
ARS$145,160.38
List Price:  ARS$203,230.34
You save:  ARS$58,069.96
Bs690.01
List Price:  Bs966.05
You save:  Bs276.03
COP$378,582.46
List Price:  COP$530,030.59
You save:  COP$151,448.12
₡49,831.88
List Price:  ₡69,766.63
You save:  ₡19,934.74
L2,626.58
List Price:  L3,677.32
You save:  L1,050.73
₲673,196.30
List Price:  ₲942,501.76
You save:  ₲269,305.45
$U3,904.98
List Price:  $U5,467.13
You save:  $U1,562.14
zł358.48
List Price:  zł501.88
You save:  zł143.40
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.