HomeХобби и стильRelated VideosMore From: Clever Techie

Create MySQL Database - MySQL Workbench Tutorial

1613 ratings | 227137 views
We model a MySQL database using a diagram in MySQL workbench. We then forward engineer the diagram to create MySQL database on the server. MySQL workbench is a powerful tool for modeling and creating databases and we take advantage of it's relationship tool to create many to many relationship between our main movie table, and stars, directors and genres tables. I don't go into too much detail on how the relationships work in this video on purpose, I wanted to make a general overview of how MySQL workbench can be used to quickly created the model of a database with relationships between tables. ````````````````````````````````````````````````````````````````````````````````````````````` Hey guys, I'm now using Patreon to share improved and updated video lesson material. For a small fee you can access all the downloadable files from this lesson (source code, icons & graphics, cheat sheets) and everything else included in the video from the Patreon page. Additionally, you will get access to ALL Clever Techie videos in HD format with no ads. Thank you so much for supporting Clever Techie :) Download this video's files here: https://www.patreon.com/posts/create-mysql-20819048 This download (Patreon unlock) includes: (Scrape IMDB function php source code, workbench movies relational tables sql source code) + ( You also get access to ALL source code and any downloadable content of ALL Clever Techie videos, as well as access to ALL videos in HD 1080p quality format with all video ads removed! ) ````````````````````````````````````````````````````````````````````````````````````````````` From the video: Let's go ahead and create the database model which will hold all the data now using MySQL Workbench (a free program that you can download here). When you first open the Workbench, create a new connection by clicking on the + icon. I'm going to name my connection localhost and and put "root" for the username. Then press press the storage vault button and enter your password. You can then click on "test the connection" and you should get the message: "successfully made the MySQL connection." At this point, click OK, and then double click on this newly created connection to connect to your MySQL database server. Now go to File---New Model and double click on Add Diagram. This is the part of the program where we're going to be designing our database model. You will see a toolbar on the left side along with all the tools available which we can use to model the database. Go ahead and double-click on the New Table icon which will place a new table in the diagram. When the table shows up on the diagram, double-click on it, the new box will show up at the bottom of the screen where we can rename our table as well as specify all the column names and their appropriate data types. Name this table that we have just created "movies", and then for the very first column, enter "id" which will be the unique identifier for this table. This id will also act as primary key which is going to auto increment so make sure the primary key and auto-increment check boxes are both checked as well as not null (NN). Now let's go ahead and enter the rest of the column names. `````````````````````````````````````````````````````````````````````````````````````````````` ( Website ) https://clevertechie.com - PHP, JavaScript, Wordpress, CSS, and HTML tutorials in video and text format with cool looking graphics and diagrams. ( YouTube Channel ) https://www.youtube.com/c/CleverTechieTube ( Google Plus ) https://goo.gl/J71p6f - clever techie video tutorials. ( Facebook ) https://www.facebook.com/CleverTechie/ ( Twitter ) https://twitter.com/theclevertechie
Html code for embedding videos on your blog
Text Comments (71)
Mr. Code (20 hours ago)
how to call it those tables on the JOIN query?
Ms U (7 days ago)
You're better than my professor; mind you I pay tuition and he doesn't teach me what you are teaching me. I question Education in 2018, because Youtube is doing it for FREE.
Wisconsin Woodsman (1 month ago)
This was super helpful. Is there a way to make changes to tables in MySQL Workbench and sync them back to the database easily?
Siwon Lee (1 month ago)
Man! Too many ads in the video.
Bret Taylor (2 months ago)
Thank you for the movie. I'm a beginning user and couldn't figure out how to export a sql file. After viewing this I learned I needed to forward engineer the model before I could export it. Thank you.
nihat nihat (3 months ago)
hi there, great work btw. When I'm trying to connect localhost/phpmyadmin, it says browser can't connect to the server. I've checked MySQL status(up and running) and also I am able to connect in my terminal and create db etc... How can't I connect to my phpmyadmin page?
FacePalmProductions (3 months ago)
That is so awesome! I love that someone created the GUI interface and forward engineer option!
JohnnyBeGood I WoT (3 months ago)
Thanks, Bro! It was really usefull tutorial
Briap Deum (3 months ago)
60th comment...
Ian Rosner (4 months ago)
I don't know the first about SQL or databasing or anything but I am able to follow your video and I appreciate the time you've put in to these videos to make SQL accessible for lay people like myself.
Almog klinger (4 months ago)
great video very helpful and sufficient ! thx !
saad awais (4 months ago)
Helped a lot thanks.
Emiliano acuña (4 months ago)
Can you use mutually exclusive relationships? cant finde them anywhere
varun mj (5 months ago)
when i try to scrape the data, i get the error in $all_data = array_merge($data,$all_data); that Undefined variable: data
HoneyChai (5 months ago)
Thanks for the tutorial. Excuse my total noobness but I guess the only reason why you're using phpAdmin to view all of the data is because this tutorial is for the IMDB php script. Why didn't you just confirm the database existed in MySQLWorkbench? It's all there under schemas.
Tapas Kumar Kalita (5 months ago)
great explanation sir!
Damon Wolf (5 months ago)
http://localhost/phpmyadmin/ site cant be reached
Fritz Schreiber (5 months ago)
Best Video
Xaz Morado (6 months ago)
Do you have the example of the insert¿
Dayvison Felipe (6 months ago)
niyongabo Edouard (6 months ago)
Thank you for your presentation, really I have solved many problems using it.
Pier P (6 months ago)
Hi .Correct me if I am wrong :Movie has one or more genre period.Genre can't have many movies.So this should be a 1 to 1 or 1 to n relationship utmost. Director can direct many movies but movies can't have multiple directors ! I believe the n:m relationship here is only with actors and movies and actors and directors.
Baalerion (1 month ago)
your right in case of directors. Usually movies have only 1 director. But in case of genres you are wrong. There are many movies of genre comedy, and many movies of genre fantasy
DunkusB3ndro (7 months ago)
I'm confused on the phpmyadmin part. Can I download that if I have a Mac? Huge SQL newbie over here so I was following pretty well with the workbench stuff but then got confused once you went to the phpmyadmin part
Ptmp727 (7 months ago)
Shit iM NOT using phpmyadmim, im only using workbench, I have finished forward engineering but I cant see the tables showing in the schema
Hugo Ramirez (7 months ago)
Great tutorial, thank you so much!
Mono Penguin (8 months ago)
Thank you..very helpful:D
Iliyan Iliev (8 months ago)
Sir, you are incredible and you are shining beam of humanity's essence - sharing with others and caring for them! Amazing, amazing video!
Magaly Perez (8 months ago)
Thank you . Excellent video.
Clever Techie (8 months ago)
viciouz25 (9 months ago)
Thank you for this tutorial. I have two questions and want your thought to be clear. 1. When populating the tables with data which table should be consider first since there exist relationships and some constraints. 2. Do we also populate the intermediate tables that were created as a result of the many to many relationships (.i.e. movies_directors, movies_genres and movies_stars)? Or these are just used for relationships
SqualoWave (9 months ago)
This guy has no idea what he's on about. He's creating many to many relationships when it should be one to many . Superfluous link tables etc. One of the worst videos I've seen.
Clyde (10 months ago)
Really good tutorial, the sound of you swallowing so hard made it almost unbearable, please change that somehow (mic position, sound editing, etc).
Sergiy Rudenko (10 months ago)
Thanks , great video! give me pls the link for the next video
Aditya Tekumalla (10 months ago)
wonderful ... Thanks a ton :)
best for me
JimiTip (10 months ago)
Cool tutorial man really helpful
Defender ofOasis (11 months ago)
http://localhost/PhpProject1/index.php Can’t reach this page
AJ Singh (11 months ago)
A very nice tutorial.
Luis Pereira (11 months ago)
Hy Clever Techie! Great tut!! Im trying to build a Real Estate Website Database Schema, but i don´t have much experience. But i can use this tutorial for that?...its kind of the same thing? Can u give me some general hints??
Great Adib (1 year ago)
extremly usefull saved my day tomorrow is my final lab mysql exam on database management
sira sidibe (1 year ago)
Hi I love your video thank you so much for your advices. But there's a point that i didn't understand. In fact in the stars & directors tables you select Unique box for "name" attribute. But I learnt that attritbute like name,lastname,firstname cant be unique cause it's possible to have several people with the same first and last name. So can you explain me the reason why you did that ?
ysp- Code (1 year ago)
I don't actually understand why the relation of movies to genres is many to many, because 1 movie has only 1 genre ,and 1 genre can be assigned to many movies so its a 1:n relationship. Please correct me if I'm wrong!
Odilbek Saporov (10 months ago)
"Some movie" Genre : Drama, Fantasy ... that's why
Brayan Malek (1 year ago)
great tutorial but please keep the mic a little away from you ,your swallowing got on my nerves . other than that great work keep up
Roy Donaire (1 year ago)
I learn fast on your way in tutoring us on "HOW TO" on stuffs, very easy and concise.
Michael Chambers (1 year ago)
Thank you!
Krund (1 year ago)
It would be better with foreign key explanation
Dario Jerkovic (1 year ago)
https://www.youtube.com/watch?v=aKcEfkLxg80&feature=youtu.be mybe this helps
Aladdin MS (1 year ago)
Thanks for Tutorial
Good guy!
Mohsin Tech (1 year ago)
your excellent work
Edwin Sepulveda (1 year ago)
You really explained this course super excellent, thanks.
Very good stuff. Thank you.
Richard B (1 year ago)
it won't let me setup the localhost connection
Ciarán Lane (24 days ago)
+Richard B How did you reinstall the server?
Daniel Diner (1 month ago)
https://dev.mysql.com/downloads/shell/ Are you sure you installed my SQL after this tool?
Richard B (1 year ago)
I reinstalled the server and it works!
It is incledible! Great tutorial and great presentation. I have a project with about 50 tables and many relationships. I bumped into your video and solved all my complexity problems with that! Many, many thanks to you. :)
Clever Techie (1 year ago)
You're welcome :)
Cathy Bourner (1 year ago)
Eek! I'm a complete MySQL newbie, and not ready to start into PHP yet. What platform do I run the code you provide to parse the IMDB file? Sorry for being such an ignoramus.
Constructive Bytes (1 year ago)
Cathy Bourner You need to run it on a server. Either local server like Apache or your website server. Lookup Xamp or Mamp.
Aigbe Kenneth (1 year ago)
Great presentation style! Very helpful, thanks.
ibrahima cobar (1 year ago)
so usefull....thanks a lot
misterkoko-code (1 year ago)
How to increase a font size of user interface? Because my display has too big resolution and I cannot see UI items names. I've tried all options but I only made editor font bigger.
Clever Techie (1 year ago)
Not sure, haven't played with font sizes yet, I'll let you know if I figure it out.
Finn Neraz (1 year ago)
Which workbench theme are you using? and is there any way that I can create new model (drawing relations) with existing database?
Finn Neraz (1 year ago)
+Clever Techie Thank you so much! Sorry for my bad English.
Clever Techie (1 year ago)
I'm using Windows 7 theme, and yes if you want to new relations with existing database model, you first have to "reverse engineer it". So to do that go to Database -> Reverse Engineer and then pick the one you want generated as a diagram.
Finn Neraz (1 year ago)
I didn't know that I can make relational database without fields that store the values of foreign table id. Nice video.
Clever Techie (1 year ago)
Thanks :)

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.