I'm getting into SQL after neglecting it for years (didn't really need it in my job as an academic researcher) and your tutorials got me up and running in no time. Cheers mate!
TIM, I used to think you weren't the greatest at explaining things and spoke a bit too generally. But I think I was absolutely wrong and just needed a slightly better base in computer science to follow along. Your videos are mastery (this series and the one on GIT I think in particular). Keep up the great work!
absolute great tutorial! so simple and easy to understand! Could you number your videos in the playlist? Might make it easier for people to follow along
Hey Tim! I’ve recently downloaded sublime text and was having issues installing the packages. I’ve checked your uploads and couldn’t find any video on your channel having to do with this subject. I’m certain that I’m not the only one who would be interested in seeing this kind of content. Nevertheless, keep up the great work and thank you for the educational content!
Video super helpful!!! I am using the pymysql library, and I could not figure out why my inserts weren't reflecting on my MySQL DB.... I forgot to commit the changes. I made use of the autocommit expression. Thanks!!!
Hello TIm! Your videos are very helpful in my daily work. Thanks. There is one topic that I am sure you can answer and will be very usefull for the community (and me as well :) ). it is about reading data from SQL in GO. Ex: I cannot find any answer about using the join method in sql for reading 2 tables, but in GOLANG. always based on 1 table.
Great video! Could you please explain the “VALUES (%s, %s)”, (“Joe”, 22)? If I try formatting a string in this way the string is not formatted. Is there any resource online that explains this method?
Make different video where you can just explain sql querries(in oracle or something like that) and then continue this series so that it will be easier for the people with no database knowlege that how querries actually works! Great video though!!!
Nice video, only thing I would not recommend is using string commands on the execute function. SQL offers own ways for that. Otherwise your software/application will get vulnerable for a sql injection attack because users can insert malicious commands.
What string commands would you not recommend? I believe I did it properly with the formatting and the variables inserted in a tuple passed as a second argument to the execute method.
@@TechWithTim Edit: Seems like I've been working with sqlite too long. I did some research and noted that the paramstyle for mysql is 'pyformat' which is %s in this case, whilst it is a '?' for sqlite for, %s should be legit here and sanitize the input. Sorry for the confusion. It also also good to mention that in this case the %s is not similar to the regular %s for string formation in a non sql string you would usually use for printing or for the generating a standard output string. The best method is to use parameterized querries, for example in Python sqlite you use the '?' sign: db.execute("INSERT INTO staff (person_id, lastname) VALUES (?, ?)", (51, "Mc'Donald")) You could use any predefined variables instead the number and string in the bracket as well. I think therefore the module got some build in protection other than using the regular string format option like %s, string templates or f-strings. In the worst case (with some user input in the programm) input like 'password' OR 1=1' could potentially break your querry. If you are more interested in that, you can look up the topic "SQL Injection" as well.
13:24 my print statement after cursor is not executing only output is a mysql command prompt, I put a print statement before mycursor is initialized, and that one prints
www.programiz.com/python-programming/json this seems to be a good article on it but i think he has a video on JSON already i think so i may be wrong so s0rry
hello, I've been following your channel for sometime now. thanks for the uploads and great explanations. Where did you learn how to code? I am starting out on my own and would like some recommendations if you dont mind! Thanks again!
what would be nice is you can make a video and connect your voice assistant with a database and when someone first run it it should ask for name,age ... and then use that info for e.x say hello + name
the string query in method execute() does not need the semi-colon ";". For me, the semi-colon is like a sign for user to know where the statement ends.
Hi Tim , This video is really good. I'm stuck in one spot. When I tried to create the table I got an error that I have a reference error: weakly referenced object no longer exists. Do you know how to fix this? I've looked everywhere but nothing seems to be working.
Hi Tim, I have been trying to replicate your tutorial, however whwnever i run mycursor.execute("DESCRIBE Person") or mycursor.execute("SELECT * FROM Person") it doesn´t seem to store anything in my cursor in fact if i try to fetch it it sends an error saying there is nothing to fetch... Any ideas what might be happening (I already checked and the data base with the table and the info are created).
As i get this, without those "%s" you can only write some hard numbers itself (just as he does in both ways, he right info itself, not a variable), while using them you can write any variable instead of "Tim" and "19". So %s is essential if you want to put there a variable.
@@Kig_Ama Yeah, he does, but I guess he just wanted to show us the best way to write it, so we could be able not only hard code. (Like if he couldn't mention this I would definitely think I can write a variable there without any %s)
Hello, I have a question regarding inserting. Is it possible to do this? "INSERT INTO %s (%s) VALUES (%s)" I tried it, but it gives me error. MySQL does not tell the exact error, it just says check the mysql version regarding the syntax. My theory is that the tuple automatically assigns a quotations in the values that are being passed in the %s. Since the table name must not contain quotations, it returns an error. My question is... Is there a way to do what i want to do? Which is to dynamically assign table name and column name.
Hey Tim I know sql is very useful/important for getting job but it's kinda boring for people who wants to make interesting projects to show their friends who do not know programming. Maybe you could do some python projects like you have done chat bot and voice assistant alternatively.
how do I show tables from a database that I can only read from?It is not my database but was given for practice? Please help am stuck.I tried "show tables" but it failed
I'm trying to follow along and writing the exact code on Sublime and run it and I get an authentication plugin not supported The exact line I get is mysql.connector.errors.NotSupportedError: Authentication plugin 'caching_sha2_password" is not supported What am I missing?
I had the same problem and passing auth_plugin='mysql_native_password' did not work, because I accidentally installed mysql-connector instead of mysql-connector-python (via pip3). Just leaving this here in case it helps someone.
i dont understand how the fuck does the database connect to python for him . i use pycharm and have been facing trouble for weeks. please help me out if u can.!!!!
Excellent video! I am having trouble with this code. I am getting an error 1064 message (MySQLInterfaceError: You have an error in your SQL syntax;). I cannot find where the error is. Any help will be appreciated. here is the code: create_employees = """CREATE TABLE Employees ( EmployeeID INT AUTO_INCREMENT PRIMARY KEY, Name VARCHAR, Role VARCHAR, Address VARCHAR, Contact_Number INT, Email VARCHAR, Annual_Salary VARCHAR );""" cursor.execute(create_employees) print("Employees table was successfully created. ")
I've been watching your videos for a while now, and I've learnt a ton from them. I can't thank you enough! 🙏🏻
I'm getting into SQL after neglecting it for years (didn't really need it in my job as an academic researcher) and your tutorials got me up and running in no time. Cheers mate!
nah id win
tim you have no idea how much you've saved me with your videos, THANK YOU SO SO SO MUCH
TIM, I used to think you weren't the greatest at explaining things and spoke a bit too generally. But I think I was absolutely wrong and just needed a slightly better base in computer science to follow along. Your videos are mastery (this series and the one on GIT I think in particular). Keep up the great work!
absolute great tutorial! so simple and easy to understand! Could you number your videos in the playlist? Might make it easier for people to follow along
Hey Tim! I’ve recently downloaded sublime text and was having issues installing the packages. I’ve checked your uploads and couldn’t find any video on your channel having to do with this subject. I’m certain that I’m not the only one who would be interested in seeing this kind of content.
Nevertheless, keep up the great work and thank you for the educational content!
I thought it would be very complicated but thanks to you sir feel like I can master this.
Thanks a lot 👍.
Thanks for the videos on this. It helped me out quite a bit with linking up mySQL and Python for a project I am working on.
Video super helpful!!! I am using the pymysql library, and I could not figure out why my inserts weren't reflecting on my MySQL DB.... I forgot to commit the changes. I made use of the autocommit expression. Thanks!!!
you’re choosing the best things to work on m8 thank you
Only 1m subs??? you deserve more
this is very helpful,.. just one thing: at 13:23, i get three such rows
I really love you brother. I feel comfortable when I heard you. Best explanation...
Really appreciate that! Thanks :)
the way you explain... amazing...
Thanks a lot 😊
Excellent as always, Tim!
Very basic. LOVE IT!
Thanks for your great explanation 🙂
Great tutorial! Helped me with a project!
Hello TIm! Your videos are very helpful in my daily work. Thanks.
There is one topic that I am sure you can answer and will be very usefull for the community (and me as well :) ). it is about reading data from SQL in GO. Ex: I cannot find any answer about using the join method in sql for reading 2 tables, but in GOLANG. always based on 1 table.
Can you do a series like this but for sql server? Keep up the good work. Love all of your videos!
its very similar
just google one or two things for the setup, rest everything is the same
Great video! Could you please explain the “VALUES (%s, %s)”, (“Joe”, 22)? If I try formatting a string in this way the string is not formatted. Is there any resource online that explains this method?
Great python courses 😍😍😍
countinue
Excellent. Thank you
Thank you !! ur help has been helpful
nice work bro...thank u sooo much...👌👌👌👌👍👍👍
Make different video where you can just explain sql querries(in oracle or something like that) and then continue this series so that it will be easier for the people with no database knowlege that how querries actually works! Great video though!!!
try from mosh sql tutorial . perfect
Great Video ! The code works but how is it possible to highlight the code and activate autofill like in the video ?
thanks buddy it helped a lot...
Fantastic tutorial, thanks! 👍
Thank you so much bro
Hi Tim, what if I want to pass in a list with 2 elements with a name and age instead. How would that change the code? BTW I love your videos!
Nice video, only thing I would not recommend is using string commands on the execute function. SQL offers own ways for that. Otherwise your software/application will get vulnerable for a sql injection attack because users can insert malicious commands.
What string commands would you not recommend? I believe I did it properly with the formatting and the variables inserted in a tuple passed as a second argument to the execute method.
@@TechWithTim
Edit: Seems like I've been working with sqlite too long. I did some research and noted that the paramstyle for mysql is 'pyformat' which is %s in this case, whilst it is a '?' for sqlite for, %s should be legit here and sanitize the input. Sorry for the confusion. It also also good to mention that in this case the %s is not similar to the regular %s for string formation in a non sql string you would usually use for printing or for the generating a standard output string.
The best method is to use parameterized querries, for example in Python sqlite you use the '?' sign: db.execute("INSERT INTO staff (person_id, lastname) VALUES (?, ?)", (51, "Mc'Donald")) You could use any predefined variables instead the number and string in the bracket as well.
I think therefore the module got some build in protection other than using the regular string format option like %s, string templates or f-strings. In the worst case (with some user input in the programm) input like 'password' OR 1=1' could potentially break your querry. If you are more interested in that, you can look up the topic "SQL Injection" as well.
you are a genius.
You saved my hassssssssssssssss 🤕🤕❤❤❤❤
is there a difference between using %s, .format() and f-strings?
Which version of mysql-connector should one use?Because on september 23 it doesn't work. thanks
If I am doing multiprocessing and workers are writing rows to the same table concurrently, d I need to initiate cursor for each worker?
Thanks for this video
very helpful video
nice guidance by you. Hey I am also learning python for fun!
Great tutorial!!! Please let me know how to change my text to change color dynamically. Can't seem to figure it out x_x
Thankyou tim
How do wet get all those different colors in the the query string?
Thank you..Hope you can do it video for Telegram Bot with mySql run on pc.
13:24 my print statement after cursor is not executing only output is a mysql command prompt, I put a print statement before mycursor is initialized, and that one prints
how do you get that CLEAN syntax highlighting for mysql?
For your information a pizza has 2,269 calories, idk what pizzas you eating, but like hand em over
Is there any way you could make a quick video explaining how to do this with a Django project? Thank you!
make video about opencv pls
Pls do a video on Json files and how to use them with python!!!
www.programiz.com/python-programming/json this seems to be a good article on it but i think he has a video on JSON already i think so i may be wrong so s0rry
@@andrewn211 thx but I already figured it out myself. It was 9 months ago...
why are we using %s for integer value as well?
%d is used for the integer value.
hello, I've been following your channel for sometime now. thanks for the uploads and great explanations.
Where did you learn how to code? I am starting out on my own and would like some recommendations if you dont mind! Thanks again!
what would be nice is you can make a video and connect your voice assistant with a database and when someone first run it it should ask for name,age ... and then use that info for e.x say hello + name
Simple and helpful :-)
can you provide tutorial for Sqlite3?
Sir awesome
How about dfs to dba and vice versa
SELECT * FROM Person is only returning the first tuple for me. Not sure why. If I were to use MySQL directly, that'd work as intended
is it possible to do this in pycharm community edition?
the string query in method execute() does not need the semi-colon ";". For me, the semi-colon is like a sign for user to know where the statement ends.
But there is no semicolon.
thanks you!!!
How can I make SQL scripts colored like yours please (I'm using PyCharme) !!
Hi Tim , This video is really good. I'm stuck in one spot. When I tried to create the table I got an error that I have a reference error: weakly referenced object no longer exists. Do you know how to fix this? I've looked everywhere but nothing seems to be working.
Hi Tim, I have been trying to replicate your tutorial, however whwnever i run mycursor.execute("DESCRIBE Person") or mycursor.execute("SELECT * FROM Person") it doesn´t seem to store anything in my cursor in fact if i try to fetch it it sends an error saying there is nothing to fetch... Any ideas what might be happening (I already checked and the data base with the table and the info are created).
Hey what code font do you use? I really want to try it out.
11:08 I don't get it. Why not just type Tim, why use %s and type Tim afterwards anyway? What's the advantage?
As i get this, without those "%s" you can only write some hard numbers itself (just as he does in both ways, he right info itself, not a variable), while using them you can write any variable instead of "Tim" and "19". So %s is essential if you want to put there a variable.
@@Dalt0nik_ Ty, I understand but at the end doesn't he hard code in this tutorial anyway?
@@Kig_Ama Yeah, he does, but I guess he just wanted to show us the best way to write it, so we could be able not only hard code. (Like if he couldn't mention this I would definitely think I can write a variable there without any %s)
@@Dalt0nik_ Uhm ok I guess I understand. Great, ty for your help!
Three words
Let him cook ❤
For some reason the commit isn't working for me, I'm not getting errors, but my db is not being updated.
Where are you writing these commands????
How can I insert "curdate()"? It says Incorrect date value...
Thank you for your video Tim. What is the purpose of "%s" at 11:20?
Neil Zietsman %s is like a variable whose value is defined after the string
@@abhiencoded But what's the advantage of it in this case? At the end he still types his name Tim again. I didn't get the point.
@@Kig_Ama 11:10🙃
Hello,
I have a question regarding inserting.
Is it possible to do this?
"INSERT INTO %s (%s) VALUES (%s)"
I tried it, but it gives me error. MySQL does not tell the exact error, it just says check the mysql version regarding the syntax.
My theory is that the tuple automatically assigns a quotations in the values that are being passed in the %s.
Since the table name must not contain quotations, it returns an error.
My question is... Is there a way to do what i want to do? Which is to dynamically assign table name and column name.
Hey Tim I know sql is very useful/important for getting job but it's kinda boring for people who wants to make interesting projects to show their friends who do not know programming. Maybe you could do some python projects like you have done chat bot and voice assistant alternatively.
Agreed, that being said because if it’s importance I will continue to teach it!
maybe there's other people doing want you like
@@maarcoo97 well yeah i know but i love how Tim explains in an interesting manner
thanks.
how do I show tables from a database that I can only read from?It is not my database but was given for practice? Please help am stuck.I tried "show tables" but it failed
Bro I can't create 2 table in a single prog.
Can u give a small example on how to do it.
I'm not getting any errors, but the data isn't going to the database (ClearDB)
What software is this please?
Why do some people use ; after the commit?
Or any compiler
I'm trying to follow along and writing the exact code on Sublime and run it and I get an authentication plugin not supported
The exact line I get is mysql.connector.errors.NotSupportedError: Authentication plugin 'caching_sha2_password" is not supported
What am I missing?
I had the same problem and passing auth_plugin='mysql_native_password' did not work, because I accidentally installed mysql-connector instead of mysql-connector-python (via pip3). Just leaving this here in case it helps someone.
String formatting in MySQL requires a minimum of (%s,%s) otherwise this throws an error. A single (%s) will not work.
Ur using mysql appa
Can someone help me in my topic that how i can generate invoice using my sql plz if someone know help me
Screw this. I want a pizza now.
Why is there one dislike?
2.35
how many calories is a pizza? like 400 or something lol
oops xD
Ah, youth. 😂
i dont understand how the fuck does the database connect to python for him . i use pycharm and have been facing trouble for weeks. please help me out if u can.!!!!
@@q_c9411
This video didn't make any sense. The lines of code written for some reason do not work. Why is this so difficult!?
Excellent video!
I am having trouble with this code. I am getting an error 1064 message (MySQLInterfaceError: You have an error in your SQL syntax;). I cannot find where the error is. Any help will be appreciated. here is the code:
create_employees = """CREATE TABLE Employees (
EmployeeID INT AUTO_INCREMENT PRIMARY KEY,
Name VARCHAR,
Role VARCHAR,
Address VARCHAR,
Contact_Number INT,
Email VARCHAR,
Annual_Salary VARCHAR
);"""
cursor.execute(create_employees)
print("Employees table was successfully created.
")
I had a problem but it was completely different. Is it because you didn't define the length of each VARCHAR?
@@thebigmightybattleship Thanks for your comment. Yes that was one of the problems.