Drop or Remove Database

MySQL Database Development Mastery Manipulating Tables and Data - CRUD Operations
3 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$69.99
List Price:  $99.99
You save:  $30
€68.66
List Price:  €98.09
You save:  €29.43
£57.81
List Price:  £82.59
You save:  £24.77
CA$101.03
List Price:  CA$144.34
You save:  CA$43.30
A$114.03
List Price:  A$162.90
You save:  A$48.87
S$96.22
List Price:  S$137.46
You save:  S$41.24
HK$544.98
List Price:  HK$778.58
You save:  HK$233.59
CHF 64.18
List Price:  CHF 91.69
You save:  CHF 27.51
NOK kr805.82
List Price:  NOK kr1,151.22
You save:  NOK kr345.40
DKK kr512.28
List Price:  DKK kr731.86
You save:  DKK kr219.58
NZ$126.25
List Price:  NZ$180.36
You save:  NZ$54.11
د.إ257.07
List Price:  د.إ367.26
You save:  د.إ110.18
৳8,587.81
List Price:  ৳12,268.83
You save:  ৳3,681.01
₹6,059.80
List Price:  ₹8,657.23
You save:  ₹2,597.42
RM315.65
List Price:  RM450.95
You save:  RM135.30
₦108,905.13
List Price:  ₦155,585.43
You save:  ₦46,680.30
₨19,605.31
List Price:  ₨28,008.79
You save:  ₨8,403.47
฿2,437.08
List Price:  ฿3,481.70
You save:  ฿1,044.61
₺2,484.54
List Price:  ₺3,549.50
You save:  ₺1,064.95
B$433.67
List Price:  B$619.56
You save:  B$185.88
R1,343.87
List Price:  R1,919.90
You save:  R576.02
Лв134
List Price:  Лв191.43
You save:  Лв57.43
₩102,991.07
List Price:  ₩147,136.40
You save:  ₩44,145.33
₪257.06
List Price:  ₪367.25
You save:  ₪110.18
₱4,116.84
List Price:  ₱5,881.46
You save:  ₱1,764.61
¥10,996.14
List Price:  ¥15,709.45
You save:  ¥4,713.30
MX$1,458.14
List Price:  MX$2,083.16
You save:  MX$625.01
QR256.65
List Price:  QR366.66
You save:  QR110
P990.78
List Price:  P1,415.47
You save:  P424.68
KSh9,063.70
List Price:  KSh12,948.70
You save:  KSh3,885
E£3,535.13
List Price:  E£5,050.40
You save:  E£1,515.27
ብር8,833.56
List Price:  ብር12,619.92
You save:  ብር3,786.35
Kz63,889.20
List Price:  Kz91,274.20
You save:  Kz27,384.99
CLP$70,696.96
List Price:  CLP$100,999.99
You save:  CLP$30,303.03
CN¥513.16
List Price:  CN¥733.12
You save:  CN¥219.96
RD$4,321.50
List Price:  RD$6,173.83
You save:  RD$1,852.33
DA9,543.76
List Price:  DA13,634.53
You save:  DA4,090.77
FJ$163.72
List Price:  FJ$233.90
You save:  FJ$70.17
Q543.27
List Price:  Q776.14
You save:  Q232.86
GY$14,728.52
List Price:  GY$21,041.65
You save:  GY$6,313.12
ISK kr9,921.78
List Price:  ISK kr14,174.58
You save:  ISK kr4,252.80
DH707.53
List Price:  DH1,010.81
You save:  DH303.27
L1,313.88
List Price:  L1,877.05
You save:  L563.17
ден4,225.13
List Price:  ден6,036.17
You save:  ден1,811.03
MOP$564.53
List Price:  MOP$806.51
You save:  MOP$241.97
N$1,337.96
List Price:  N$1,911.45
You save:  N$573.49
C$2,590.57
List Price:  C$3,700.98
You save:  C$1,110.40
रु9,693.37
List Price:  रु13,848.27
You save:  रु4,154.89
S/264.90
List Price:  S/378.45
You save:  S/113.54
K282.22
List Price:  K403.19
You save:  K120.97
SAR262.73
List Price:  SAR375.35
You save:  SAR112.61
ZK1,944.69
List Price:  ZK2,778.25
You save:  ZK833.55
L341.48
List Price:  L487.85
You save:  L146.37
Kč1,727.43
List Price:  Kč2,467.86
You save:  Kč740.43
Ft28,439.49
List Price:  Ft40,629.58
You save:  Ft12,190.09
SEK kr790.58
List Price:  SEK kr1,129.45
You save:  SEK kr338.86
ARS$72,562.48
List Price:  ARS$103,665.14
You save:  ARS$31,102.65
Bs486.41
List Price:  Bs694.91
You save:  Bs208.49
COP$306,273.38
List Price:  COP$437,552.16
You save:  COP$131,278.77
₡35,534.18
List Price:  ₡50,765.30
You save:  ₡15,231.11
L1,790.30
List Price:  L2,557.69
You save:  L767.38
₲552,767.69
List Price:  ₲789,701.98
You save:  ₲236,934.28
$U3,058.06
List Price:  $U4,368.84
You save:  $U1,310.78
zł293.28
List Price:  zł418.99
You save:  zł125.71
Already have an account? Log In

Transcript

Hey guys. So in our last lesson, we looked at how you go about creating a database using database scripts or our SQL commands rather. And in this video, we will be looking at how we go about dropping or removing a database. So in the previous video, we would have looked at two ways to create databases using our command line interface, and our did SQL script. And so we ended up with two versions of school underscore dB, or school under the score DB and DB one. So in this video, we want to remove one of them.

So we look at the command used to remove our drop a database that we no longer want. So I'm just going to go ahead and create a new script file. I don't over this and to do that, once again, you just click that SQL file over to the left with the plus sign and that gives us a fresh script file which is capable of taking first scripts and we can see this as another file. So that is one of the key advantages to using workbench when we want to execute many queries. So with a new file, we can actually go ahead and start writing out our keywords. So I'm going to write in lower caps this time, once again SQL is not case sensitive.

So I can say drop database. So those are the key words drop meaning remove. And please note there is no undo with this step there is no Recycle Bin and recovered from doing this command is rather tedious. So I advise you please be very deliberate when you're about to execute this command drop database and then the database name. And as I start typing, you see that my SQL is suggesting the databases that I may be interested in so I want school DB one, so I can just select it, press enter and it will auto fill and you just end it With a semi colon, before I execute this, I'm going to say once again, be very, very, very, very deliberate when executing this, there is no Undo, it won't prompt you and ask you, if you're sure. Alright, so I type this and then I click Execute, and then you see that you will see that it was executed.

And if I refresh over in my schemas, then there is no school DB One, two, to be used again. All right. So once again, be very deliberate before you run this command. All right, and if I try to execute it again, then we get to our first arrow, and he will see can drop a database because it does not exist. All right. So of course, if you get that arrow and you're looking at the database, and you probably have a spilling arrow on either side, you can just double check that But once again, that is how you remove a database using an SU Come on.

So I can just add a comment and I'm going to use my multi line comments in this one and say this is how you remove it is be very permissive, very deliberate. Alright, so I'm going to include this sample script file. And I'll just save it quickly and call it drop school DB one. Alright, and that is going to be included with the resources for this video and this lesson.

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.