SQL Query Basics: Insert, Select, Update, and Delete
HTML-код
- Опубликовано: 18 янв 2020
- Without question the most used statements in SQL are the Insert, Select, Update, and Delete statements. They make up the core foundation for any database work.
Hope you enjoyed the video!
Create Tables Video:
• How to Design and Crea...
Check out this code here:
github.com/engineer-man/youtu...
Join my Discord server to chat with me:
/ discord
Check out some code on my GitHub:
github.com/realtux
github.com/engineer-man/youtube
Come visit us on Reddit:
/ engineerman
Other Social:
/ _engineerman
/ engineermanyt Наука
This taught me more than a $2,000 university database basics class. Thanks man!
Great video! Everyone should know SQL basics, you're going to run into a database no matter what technical career path you choose.
Great video, as always - I'll check out your other SQL videos right away; you're great at explaining everything in just the right amount of detail AND in a perfect tempo. Thank you so much!
sql injection video incomming? :)
Dude you explain things so well and it is so much easier for me to understand,, ty. sincerely ty.
just found your channel and i’m learning so much from it MASSIVE THANK YOU BRO ❤️❤️
im having tommorow an exam on this, nice explanation!
Looking forward to more DB videos. Subscribed.
you are great man but please add the possibility to activate the subtitles, you speak fast and we are not all english native speakers, so they help. have a nice day and thank you ;)
Thanks broo!! I wish that I'll get the teachers like you...Keep it up buddie!!!
I knew the basics. But never used limit and transaction..thanks EM
Apologies if you already made one, but an ATOM tips and tricks vid would be much appreciated. Love the content, Thanks!!
I am outreaching you on behalf of NCache by Alachisoft. Ncache is a 100% .NET / .NET Core distributed cache.
We have been following your RUclips Channel since quite a while and we really can’t help appreciating the amazing work you are doing. We saw some Tutorials, How-To guides and Tips on your channel, so we would really want to have an alliance with you for some similar videos.
I hope you don’t mind if we talk further about this.
A shortcut for the insert of multiple rows, insert into people (name, age) values ('john', 21), ('fred, 22), ('albert', 23);
Very helpful, thank you!
Love your videos. Could you do a video on "ON DELETE" clause when using foreign keys or foreign keys in general?
Thank you so much ! u saved my exam
Wonderfull !! We want more..... !!
Thanks,
If you could explain about how internals work , would be great.
Thank you EM!
give this man a cookie :D great Video
That's help me in computer application thanks bro
I just started to learn python and a bunch of things related to data science 1 month ago. I really appreciate your video. I was wondering if you could tell me what IDE are you using for SQL and asking for doing a video for noSQL. Cheers
Hi Engineer Man, thank you for such a great informative video, have you build any courses on SQL or any other programming language.
Nice video :D
Hello Engineer man if you could help I would appreciate it.
How do you syntax sql to display output in a decimal field when using number like 2,244.90 and not having the database erroring the comma thinking it is an extra field.
that happened to me, I wrote a database update php page, obviously one of the functions was: delete from table_name, it took me a while to understand that, I forgot to write down the where part, and I kept deleting my table, goos thing I was in the development stage, and not in the production stage :)
Thanks Engineer Man for this Vidoe.
I have issue using the UPDATE statement. Its a simple student database, I used fetchdata to display student's name and age on thier dashboard.
Then I decide to create room for name editing, so they click edit to change thier name with UPDATE statement but immediately it updates, the variables for age and name will be showing error like Undefine variable..... please help me. Thanks
Hi can you help me how can i delet using this select
SELECT PRO.CDPRO,TRA.NHORAS,TRA.CDEMP
FROM PROYECTO PRO,TRABAJA TRA
WHERE TRA.CDPRO = PRO.CDPRO
group by PRO.CDPRO,TRA.NHORAS,TRA.CDEMP
HAVING SUM(NHORAS)=0;
this is the incial select and i need to transforme it into delete how can a i do it? thanks
Question. When rolling back. Does it rollback to the start of the transaction or only the most recent command you ran?
It rolls back to the start.
Nice video. Thanks. Is there a way to select a number of random records?
If performance doesn't matter to you, adding "order by rand()" at the end should be fine. If performance does matter, then the solution is based on the data (size, contiguous or non-contiguous surrogate keys, and others). Generally speaking, the solution is to get the max id of the table, multiply it by rand(), get the nearest whole number, then select the record that is either exactly that id or the nearest one.
can u make a video on git local and repository
8:52 impressive can you do this in sql server as well as it every query is transaction already? like can i delete stuff there, do a select and then commit/rollback based on my liking?
I believe sql server is "begin transaction", otherwise it's the same.
Who is watching this in 2020?? :D
Are you coding in python and just using a sql libray. Sorry, I do not know what SQL is. I know databases and fields and queries but is it a language all its own ?
SQL (Structured Query Language) is its own thing. The database understands SQL directly.
kalix from uruguay lol
Who in his sane mind would have an "age" column in a database instead of date of birth... I mean, am I the crazy one here? Thanks for the video though, I learned a few things I might remember the day I'm forced to use SQL.
It was just an example, but, one such table might be a table containing medical screenings where it's important to store the age at the time of the screening.
shubham pundir
You committed one of the biggest sins in my sql peeves, naming the id. Why the heck would you call your primary key for the people table person_id??? The primary key should either be simply id or include the name of the table, so the people table should have a pk of id, peopleID or people_id. Use of your naming standard should be LAW across all of your tables, so if you use camel case in table names you use camel case in the primary key, ditto for snake case. This way you know the name of the primary key of any table simply by knowing the name of the table if you include it in the pk name, but my tables simply use id as the primary key and any referencing keys to that table use the table name and ID, so join category on category.peopleID = people.id (or people.people_id/people.peopleID if that's your naming standard). Nothing is more frustrating when you're creating joins than everyone using their own standards for keys and referencing keys that tell you nothing. I have tables right now in a system I'm working on where modelID in one table actually points to the signtypeID in a table named signTypes, it's incredibly frustrating since there's no model table or signtype table and therefore doesn't tell me what table the join is for, plus even my own new tables have to point to signtypeID instead of signTypesID so I have to remember what the darned primary key was arbitrarily named or go look it up. The facilityAssets table has a pk named assetID, there is no asset table. DON'T DO IT PEOPLE!
I agree. I did mean to do people_id. I also like logical and consistent naming. I appreciate the comment.
@@EngineerMan -- I thought that was really odd for you to make a mistake like that. We all have our embarrassing moments, I can't count the times I looked at something a second time and said "how long you been doing this and still do that kind of stupid", and I've been doing sql for around 40 years.
Your use of transactions was great, I seldom see people do that and consider it an absolute must. Few things suck more than telling your boss you just screwed up his data by not triple checking your work. I not only use transactions before updates or deletes, I run select with my constraints first so I can see exactly what will be changed before I change it, and then I still use transactions just in case. If you delete the wrong records and there are cascading triggers recovering can be an incredible headache, especially on a live system that people are currently updating and inserting records into. I further advise to always have a second server with a copy of the live servers last backup you can run any such commands against so if you screw up you do it on data that can be fairly easily restored. Never perform any action that affects live data until you've tested it on non-live data. Bit beyond an introductory to sql, but anyone making a living manipulating someone else's data will be well served to do so since even rolling back transactions can be a problem on live data.
It's certainly not how I design tables. At first when I was reading your comment I was confused what you were taking exception to. In that moment though I genuinely believed I had done people_id.
@@EngineerMan -- As I said I've done goofy things accidentally and later had to chastise myself when I realized what I'd done, it does happen. And believe me, when is see code that makes me say "what the **** were you thinking???" I'm much harder on the offender if it's my code than if it's a workmates code. Thank goodness I don't have potentially 288K people looking over my shoulder correcting me.
You don't capitalize 😳 HEATHEN!
I'm so grateful for the SQL tutorial video. Thank you for sharing your knowledge. 😊📹💾