How to Create, Insert, Update, and Delete in MsAccess using SQL

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
I'm here to create a tutorial about creating a database specifically with Access Microsoft Access so let me open my Microsoft Access here so our goal is to create tables from SQL using SQL which is structured structured query language so to create a database Alex first name this and of course you can save this on any path that you want you may change that by clicking this one but in my case I'll be saving it in my document so I'll just type in trial BB ok which means trial database basically now yeah it's loading here to start up with this I'll be creating everything from scratch so as you can see I'll just close to that one and let me create create design and you'll see this one popping out just close this and click this one SQL view in which you'll type queries so our goal is to create a table inside the trial BD which is our database so to do that so we'll type in create table let me magnify so that you will see magnify ok so there we go create table let's name it users users table so users tbo you can basically need this or whatever name you want opening and closing parenthesis and in between you can answer to provide space so I'll just type in you on this variety okay let this be auto increment and let this be a primary yeah I think yeah primary key and then let's type in first underscore name and let's say address and let's say I call this age let us be a meet so we have user's ID first name last name address and int now let me close this one the magnifier so there we go to run this we'll click on the run on your left okay on your left upper left corner let's run that one and as you can see it provides us okay let me magnify again on our left side the user table users table that basically had so let's first save this one save okay you'll name this query [Music] okay then press ok and yeah so it's basically on our left side now okay let me close this magnifier again okay we have several more queries so I can click on the user table as you can see we do not have anything yet okay in this one we can just simply type for example Brian is my name okay tie age 20 okay so you can see all the numbers so it's it provides numbers for you physically automatically so to do that again let's say we'll click on the create and then query design again close this one and SQL view you can also find this SQL view on your see this one on your most right corner bottom right so as you can see if this one sq all with the icon here so I can click that one okay and it will provide me the same thing okay so let me close this magnifier again now our goal is to insert value so insert insert into its users will be affected so these are the first name last name address and [Music] [Music] [Music] [Music] okay never forget that each and every time you'll type here in the values make sure these the values that must be inserted are enclosed in single quotation marks okay so birth duel I salon Kavita and 30 then if we'll be running this one so create design design and click run okay let me close my magnifier bit click run oh good I found out users CB okay because the name of our table is users TBL there we go let me close this again okay and then run yes and then what happened yeah and then once we check our users tip it out be closed and open this one more time as you can see the bird dual Isilon Kavita and 30 is now being inserted because of this specific line or query insert into users to be our first name last name address and age values birth deal I see luckily there so that's basically how to insert now let's save this one and I'll be naming this insert values [Music] I'll save this magnifier again okay now I can actually close these open tabs including the table I know I want this to remain open so I'll click on my table again let's say create and yeah query design okay our goal now is to update okay and I'll close this one more time so that the values are refreshed so birth do lysine imma be the for example so let's focus on this one so for example I want to change the first name of birth okay there are several ways of how we can change this name birth by simply you know clicking here but in terms of query we can actually reference any of these data in this table through user ID so that's basically it okay so that's basically it so bird is being inserted in a row in a table okay and make sure and and sorry not make sure and take a look at this it's number two okay which once we call number two it automatically pertains to that bird do like silica Pete and sake okay so okay to update values for example I want to change the bird do like and I'll change this to Albert okay I'll click on query design again close this one okay and I'll be typing my query okay I'll be typing my creamy SQL view so to do that we'll type in CBI which is basically the name of our table step what's the field that you want to add it so if you'll go back okay bird we want to edit the bird so it's on the first name column so we'll type in first-name equals okay and then let's say the value that you want to to update okay so it's purcha basically you will change this to Albert where reference it you want this for ID once - okay why - sir because we're referencing again the user ID which pertains to bird dude I see like a PETA entropy okay so once you wanna run this one Albert will overwrite the bird here so let us see but let me close this one oh no no need to close let me let's say run [Music] of course it will ask you yes just click yes ok I'll close this one for a while reopen my table see the bird now becomes Albert so that's basically how to update data okay so let me save this one mm-hmm let me save this one and I don't name this update query ok so insert create update there's one more thing that I want to teach you and that is how to delete data from the table so create again click on really design let's magnify this one let me close this table here and ask you our view of course so basically here will delete something for example ok once you delete something it will automatically believe I wrote for example if I want to delete this one it's automatically deletes the first name last name and address and the same row so to do that for example I want to delete Brian okay I want to delete Brian ok so it's basically okay so basically just like what I said once you delete it automatically deletes the row now so why one because it is the use user ID which will which is pertaining to the first name last name and address so if I'll be running this one design run of course it will ask something and then yes of course okay and I can now close this one close okay and reopen the users table as you can see the entire row okay it's being deleted the first new IDs being deleted together where the first-name lastname address and age so that's basically it about SQL I hope you guys enjoyed this small mini tutorial and see you next week and God bless
Info
Channel: brian jayson umandap
Views: 20,540
Rating: 4.7777777 out of 5
Keywords: ms access, sql in ms access, sql in access, crud in access, insert data in access using sql, insert data in access, update data in access, delete data in access
Id: _fehhVVGyiY
Channel Id: undefined
Length: 13min 40sec (820 seconds)
Published: Sat Oct 07 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.