Delete Data Using DELETE Query

2 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.96
List Price:  €118.95
You save:  €33.99
£72.96
List Price:  £102.15
You save:  £29.18
CA$136.44
List Price:  CA$191.02
You save:  CA$54.58
A$152.31
List Price:  A$213.25
You save:  A$60.93
S$127.35
List Price:  S$178.29
You save:  S$50.94
HK$784.90
List Price:  HK$1,098.89
You save:  HK$313.99
CHF 79.24
List Price:  CHF 110.93
You save:  CHF 31.69
NOK kr1,008.97
List Price:  NOK kr1,412.61
You save:  NOK kr403.63
DKK kr633.97
List Price:  DKK kr887.58
You save:  DKK kr253.61
NZ$164.65
List Price:  NZ$230.51
You save:  NZ$65.86
د.إ367.26
List Price:  د.إ514.18
You save:  د.إ146.91
৳12,275.24
List Price:  ৳17,185.83
You save:  ৳4,910.59
₹8,566.19
List Price:  ₹11,993.01
You save:  ₹3,426.81
RM422.85
List Price:  RM592.01
You save:  RM169.16
₦153,435.65
List Price:  ₦214,816.05
You save:  ₦61,380.40
₨28,380.62
List Price:  ₨39,734
You save:  ₨11,353.38
฿3,241.97
List Price:  ฿4,538.89
You save:  ฿1,296.92
₺3,979.26
List Price:  ₺5,571.12
You save:  ₺1,591.86
B$548.17
List Price:  B$767.46
You save:  B$219.29
R1,765.99
List Price:  R2,472.46
You save:  R706.46
Лв166.12
List Price:  Лв232.58
You save:  Лв66.45
₩135,896.76
List Price:  ₩190,260.91
You save:  ₩54,364.14
₪337.10
List Price:  ₪471.96
You save:  ₪134.85
₱5,636.93
List Price:  ₱7,891.93
You save:  ₱2,255
¥14,390.85
List Price:  ¥20,147.76
You save:  ¥5,756.91
MX$1,873.20
List Price:  MX$2,622.56
You save:  MX$749.35
QR363.67
List Price:  QR509.15
You save:  QR145.48
P1,323.02
List Price:  P1,852.29
You save:  P529.26
KSh12,918.70
List Price:  KSh18,086.70
You save:  KSh5,168
E£4,930.31
List Price:  E£6,902.64
You save:  E£1,972.32
ብር13,781.55
List Price:  ብር19,294.72
You save:  ብር5,513.17
Kz91,522.68
List Price:  Kz128,135.41
You save:  Kz36,612.73
CLP$92,853.71
List Price:  CLP$129,998.91
You save:  CLP$37,145.20
CN¥716.79
List Price:  CN¥1,003.54
You save:  CN¥286.74
RD$5,947.04
List Price:  RD$8,326.09
You save:  RD$2,379.05
DA12,977.24
List Price:  DA18,168.65
You save:  DA5,191.41
FJ$223.59
List Price:  FJ$313.04
You save:  FJ$89.44
Q769.15
List Price:  Q1,076.85
You save:  Q307.69
GY$20,917.70
List Price:  GY$29,285.62
You save:  GY$8,367.91
ISK kr12,150.78
List Price:  ISK kr17,011.58
You save:  ISK kr4,860.80
DH897.69
List Price:  DH1,256.80
You save:  DH359.11
L1,680.37
List Price:  L2,352.58
You save:  L672.21
ден5,224.55
List Price:  ден7,314.58
You save:  ден2,090.03
MOP$808.74
List Price:  MOP$1,132.27
You save:  MOP$323.53
N$1,758.42
List Price:  N$2,461.86
You save:  N$703.44
C$3,681.01
List Price:  C$5,153.57
You save:  C$1,472.55
रु13,679.29
List Price:  रु19,151.56
You save:  रु5,472.26
S/354.32
List Price:  S/496.07
You save:  S/141.74
K412.47
List Price:  K577.48
You save:  K165
SAR374.98
List Price:  SAR524.98
You save:  SAR150
ZK2,387.95
List Price:  ZK3,343.22
You save:  ZK955.27
L430.46
List Price:  L602.67
You save:  L172.20
Kč2,093.79
List Price:  Kč2,931.39
You save:  Kč837.60
Ft33,882.61
List Price:  Ft47,437.01
You save:  Ft13,554.40
SEK kr951.44
List Price:  SEK kr1,332.05
You save:  SEK kr380.61
ARS$120,587.94
List Price:  ARS$168,827.94
You save:  ARS$48,240
Bs691.16
List Price:  Bs967.65
You save:  Bs276.49
COP$411,525.38
List Price:  COP$576,152
You save:  COP$164,626.61
₡50,485.92
List Price:  ₡70,682.31
You save:  ₡20,196.38
L2,613.88
List Price:  L3,659.54
You save:  L1,045.65
₲797,842.75
List Price:  ₲1,117,011.76
You save:  ₲319,169.01
$U3,996.09
List Price:  $U5,594.69
You save:  $U1,598.59
zł361.30
List Price:  zł505.84
You save:  zł144.53
Already have an account? Log In

Transcript

Hello, in this video, I'm going to show you how to delete data using a delete query. So deleting data would essentially delete even one row or multiple rows. So it's really simple, you first of all need to create a query is going to be equal to the connection and we're going to prepare a statement. And the query is literally DELETE FROM so the actual table, which would be this table here for users, users, and then you specify the actual, you know, sort of where condition type, let's say ID equals one. This will delete the one that has an ID of one. Because the column ID is unique and a primary key you will only ever delete one row in this instance.

So if I save that, and let me show you this is the latest database for reload now, arrows I know what I need to actually execute it. We read a few. So now if I was to reload this There you go, that one has now been deleted. But you can delete multiple roles as well. So imagine if you wanted to do it where the user name he called Anakin Skywalker. Then we could delete all of the animal Skywalker, all these duplicates, for example, so where it equals anything, go.

Okay. Now if I reload that, I think See, all of those have been deleted. So that's how you delete a row or multiple rows from your database using the Delete query. Really simple stuff. Obviously, always be careful when you're deleting stuff because you can't get it back unless you've got yourself server, your, you know your server provider set to actually backup on regular intervals. And that's usually an extra fabulous you have to pay for.

I recommend having something like that. But always be careful when you're deleting stuff. So that's it. 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.