Then, ofcourse, youknowwhathappensif a userleaves, orforwhateverreason, youwanttodelete a recordwithinyourmysequeltable, I willbeshowingyouhowtousethepolicestatementinordertodothat.
Andsothatiswhatwe'regoingtobelearningtoday.
Sonowthatwe'rereadytolearnhowtobeabletoupdaterecordsanddeleterecordswithinyourmysequeldatabasetables, let's goovertothecomputerso I canshowyouhowthisworks.
Sohereweare, backatmylabenvironmentagain, I'm running a Macbookprofessionalusingvirtualboxwithinvirtualbox.
I havespunupaninstanceof a bunchofdesktop 18.0 forcethat's goingtogiveus a graphicaluserenvironment, andthisiswhat I haveinstalledmysequelonto.
Uh, so I thought I talkedaboutthepreviousclassthatwheneveryou'redoingthestheselittlelabsthatyoushouldtrytorecreateyourdatabase, recreateyourtable's recreateyourroseoryourrecordsforeveryclasstogetyouusedtoactuallydoingthat.
I'm notgoingtodothattodayforthisclassbecause I don't wanttowastethetime.
I'm simplygoingtobeusingthedatabaseandthetablethatwealreadycreatedinthepreviousclasssowecouldgoheresoshowthatbaseis a semicolonandwecouldgotake a lookatourdatabases.
Theonethatwe'regonnabeusinghereisclassthe D B.
That's notbeourdatabasewe'regonnagouse, uh, Class B.
Nowwehavechangedintotheclass d beallowedtocontrol l toclearthescreen.
Andthenjusttomakesurethatweareintherightdatabase, will d'ohselectthat a base, thiscommandopenbrothers, he's closeparentheses, semicolonenter.
I d fourisactuallyuser i d sixandagainwhenyou'redoingthingslikecircuitiswhenyou'redoingthingslikeupdates, keepingthatinmindcouldbecouldbeimportantagain.
Justbecausethey'reinthefourthpositiondoesn't meanthat's what, liketheiruser i d orthepart I d orwhateverISS s.
We'regonnatake a lookatthisandwe'regonnalookatPat.
Oh, Patjustcan't makeuphermind.
Isshein?
Issheout?
Soshe's decidedtoleave.
Shedecidedtoleaveourlittleschoolorwhatwehave.
Sowe'regoingtodeletetherecordforpastinordertoleadtherecordforpaddlewehavetodoiswejustsimplydodeletefromandthentheuser's tableSodeletefromwhatevertablethatyou'redealingwith, Where, whereandthen, let's sayuseuserunderscore I d equalssix.
Thisisoneoftheissuesthatyouneedtoworryabout, becauseifyoudoanupdateorifyoudo a deletebasedoffofoneofthecolumns, andwithinthattherearemultiplevaluesthatareidentical.
Becauseobviouslywe'relearningmysequelandreally, you'relearning a database, butreallyright, that's aboutwhatitis.
SoSorightnowweunderstandhowtobe a bitinteractwith a singletableaswe d'oh, I'llshowyouthewholeconceptof a relation A lldatabasewherebasically, youhavemultipletablesandareabletointeractwithmultipletablesatonetime.
Butrightnow, ifyouifyoureallythinkaboutit, beingabletouse a singletablemightbeveryvaluableforyouagain.
Ifyouhave, likelittleiotitemperaturesensorson, they'rebasicallyjustpayingyourdatabaseinputtingwhateverthetemperatureisintothedatabasethatmightbesayingsomethingthatyouneed a singletableforagain, just a simplewayoftrackingstudentsfor a class.
Youmayonlybe a singletable.
There s o.
Youknow, youreallyshouldthinkaboutit.
Likewhatapplicationscouldyoucreate, whereallyouneedis a singletable?
Ah, nowyou'reableterrible.
Createthatagain.
Youknow, intherealworld, youwillbeusingbasically a scriptingorprogramminglanguagetobeabletointeractwithyourmysecretdatabaseagain, somethinglikePHPthatwillthencreateanHTMLthefrontend.
Soagainyouhave a form, andthatformwilltakeinformationfromthefrontendandputitintothedatabaseon.
Sowiththatasalways, I enjoydoingthisclass I lookfortoseeifthenextoneapparentlythetypeofcontentyoujustsawisnotwhatSusan W.
WantsforthefutureofYouTube.
ThismeansthatrecommendationsbyYouTubetothischannelhavedroppedmassively, andviewsarebecoming a comicallysmall I hatetoask.
I usedtosay I wouldneverask, butifyoucouldsubscribelikecommonandmostimportantly, sharethevideosthatyouappreciate, thatmayhelpslowthedeathofthischannel.