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
€87.82
List Price:  €122.96
You save:  €35.13
£75.16
List Price:  £105.22
You save:  £30.06
CA$138.43
List Price:  CA$193.81
You save:  CA$55.37
A$156.59
List Price:  A$219.24
You save:  A$62.64
S$131.16
List Price:  S$183.63
You save:  S$52.46
HK$775.77
List Price:  HK$1,086.11
You save:  HK$310.34
CHF 82.51
List Price:  CHF 115.51
You save:  CHF 33
NOK kr1,042.39
List Price:  NOK kr1,459.39
You save:  NOK kr417
DKK kr655.69
List Price:  DKK kr918
You save:  DKK kr262.30
NZ$167.31
List Price:  NZ$234.24
You save:  NZ$66.93
د.إ367.26
List Price:  د.إ514.18
You save:  د.إ146.92
৳12,147.63
List Price:  ৳17,007.17
You save:  ৳4,859.53
₹8,526.15
List Price:  ₹11,936.95
You save:  ₹3,410.80
RM437.25
List Price:  RM612.17
You save:  RM174.92
₦161,582.84
List Price:  ₦226,222.44
You save:  ₦64,639.60
₨28,083.99
List Price:  ₨39,318.71
You save:  ₨11,234.71
฿3,343.46
List Price:  ฿4,680.98
You save:  ฿1,337.52
₺3,831.60
List Price:  ₺5,364.40
You save:  ₺1,532.79
B$572.90
List Price:  B$802.08
You save:  B$229.18
R1,870.82
List Price:  R2,619.22
You save:  R748.40
Лв171.98
List Price:  Лв240.78
You save:  Лв68.80
₩143,528.93
List Price:  ₩200,946.25
You save:  ₩57,417.31
₪364.89
List Price:  ₪510.86
You save:  ₪145.97
₱5,649.88
List Price:  ₱7,910.06
You save:  ₱2,260.18
¥14,243.72
List Price:  ¥19,941.78
You save:  ¥5,698.06
MX$1,958.93
List Price:  MX$2,742.58
You save:  MX$783.65
QR364.07
List Price:  QR509.71
You save:  QR145.64
P1,365.84
List Price:  P1,912.23
You save:  P546.39
KSh12,938.70
List Price:  KSh18,114.70
You save:  KSh5,176
E£5,095.17
List Price:  E£7,133.44
You save:  E£2,038.27
ብር13,416.63
List Price:  ብር18,783.83
You save:  ብር5,367.19
Kz91,190.88
List Price:  Kz127,670.88
You save:  Kz36,480
CLP$94,266.88
List Price:  CLP$131,977.40
You save:  CLP$37,710.52
CN¥728.62
List Price:  CN¥1,020.10
You save:  CN¥291.48
RD$5,931.15
List Price:  RD$8,303.85
You save:  RD$2,372.70
DA13,230.85
List Price:  DA18,523.73
You save:  DA5,292.87
FJ$226.02
List Price:  FJ$316.44
You save:  FJ$90.41
Q770.12
List Price:  Q1,078.20
You save:  Q308.07
GY$20,916.83
List Price:  GY$29,284.40
You save:  GY$8,367.57
ISK kr12,726.72
List Price:  ISK kr17,817.92
You save:  ISK kr5,091.20
DH925.43
List Price:  DH1,295.64
You save:  DH370.21
L1,727.39
List Price:  L2,418.42
You save:  L691.02
ден5,403.80
List Price:  ден7,565.54
You save:  ден2,161.73
MOP$799.06
List Price:  MOP$1,118.72
You save:  MOP$319.65
N$1,856.77
List Price:  N$2,599.55
You save:  N$742.78
C$3,679.18
List Price:  C$5,151.01
You save:  C$1,471.82
रु13,655.87
List Price:  रु19,118.77
You save:  रु5,462.89
S/369.72
List Price:  S/517.62
You save:  S/147.90
K407.72
List Price:  K570.82
You save:  K163.10
SAR375.06
List Price:  SAR525.10
You save:  SAR150.04
ZK2,836.90
List Price:  ZK3,971.77
You save:  ZK1,134.87
L437.14
List Price:  L612.02
You save:  L174.87
Kč2,196.89
List Price:  Kč3,075.74
You save:  Kč878.84
Ft35,797.65
List Price:  Ft50,118.14
You save:  Ft14,320.49
SEK kr961.88
List Price:  SEK kr1,346.67
You save:  SEK kr384.79
ARS$116,335.31
List Price:  ARS$162,874.09
You save:  ARS$46,538.78
Bs690.85
List Price:  Bs967.22
You save:  Bs276.37
COP$430,007.65
List Price:  COP$602,027.91
You save:  COP$172,020.26
₡50,277.57
List Price:  ₡70,390.61
You save:  ₡20,113.04
L2,591.91
List Price:  L3,628.78
You save:  L1,036.87
₲799,756.92
List Price:  ₲1,119,691.68
You save:  ₲319,934.76
$U4,193.03
List Price:  $U5,870.41
You save:  $U1,677.38
zł375.98
List Price:  zł526.39
You save:  zł150.40
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.