Placeholder Image

Subtitles section Play video

  • creating these classes requires equipment and service.

  • Is that cost money?

  • If you appreciate this education, please think about going to Eli the computer guy dot com and offering a one time or monthly recurring donation.

  • Welcome back.

  • As you know, I am Eli the computer guy, and today we're going to be doing an introduction in it to the Maya sequel structure.

  • When you're going be building out a system using my sequel as the database back in, I want to give you an idea of basically like, logically, what does this look like?

  • So what I'm talking about here is that they were going to be talking about the servers were going to be talking about the database software.

  • So my sequel we're gonna be talking about the databases themselves were going to be talking about the tables we're gonna be talking about.

  • The columns were going to be talking about the records that a types basically giving you an eagle eye view of when we were talking about a database structure.

  • What does this actually look like so that you can then go and try to figure out each individual component and build out what you need So this class today is basically just going to be giving you that eagle eye view of what my sequel structure looks like s O that you have a better idea of what's going on when we start going into the more indepth classes.

  • So for this class today, we're primarily going to be on the white board again.

  • I know I have world class drawing skills.

  • Those drawing skills really help you folks understand how all of these things work and how they all go together.

  • So let's go over the white board so I can start drawing things out to try to explain to you how the my sequel structure looks when you're dealing with it in the real world.

  • So the first thing that we need to go over when we're talking about my sequel structure or really any kind of database structure we first need to talk about what is the front end and what is the back end?

  • So you will hear about the front end for applications and you will hear about the back end for applications.

  • So basically, what we're talking about with the back end for applications is this is going to be your database system.

  • So this is the overall system.

  • So with us, but we're gonna be talking about is, of course, my sequel.

  • But for your back end, you could have Oracle.

  • You could have Maria d.

  • B.

  • You could have some kind of no sequel solution or whatever.

  • Basically, what the back end does is the back and actually stores all of the data so that it can be easily accessed by the front end.

  • Now, what are we talking about?

  • What we're talking about the front end.

  • So from the front end is the actual application your users are going to be using in order to access the data in the data base in the back end that you've created.

  • So this may be some kind of Web applications, So think about something like salesforce dot com.

  • Basically, you go to that Web site, you have a Web page in front of you you're able to put in from in information, you're able to pull out reports.

  • So basically, that's what's called a Web front, and or you might have a mobile front and right, So if you have your little iPhone or you have your smartphone somebody creates a native application for that phone.

  • And again, maybe this is a customer relationship management software.

  • Maybe this is a work order software again, sometime Type of data intensive software basically what'll happen is that mobile app will go back and communicate with your back end in order to be a bit pushy.

  • Data basically store that in the database and then pull it for when you're looking for records or whatever.

  • So when we start talking about things like front end and back ends, this is what we're talking about.

  • The front end, the front end for any of these service's or applications is basically the user interface that people are going to be interacting with.

  • Whether this is a Web interface, whether this is a mobile interface, whether it's the desktop interface, something like that, that is what the front end is.

  • And then the back end is the overall system that contains all of the data that the front end will require to actually give any kind of functionalities.

  • That's what we're talking about.

  • We're talking up front ends and back ends so past this.

  • Now let's talk about kind of the physical structure of the my sequel structure that we're gonna be dealing with here.

  • And so, basically, if you're going to be using my sequel database, generally you're going to actually be spinning up or turning on some kind of physical server on.

  • So, basically, you have the physical server.

  • So it's a physical server from a company like Dell or Lenovo or something that you just build on your own.

  • So again, you get your CPU RAM your hard drive.

  • You build it out however you want, then on this physical machine, then you're going to install an operating system so that operating system is most likely gonna be Lennox.

  • But it could be Windows, or it could even be Mac OS.

  • Or if you're really cool.

  • I guess some people are still running Solaris out there, right?

  • So basically, you're going to install the operating system onto that physical hardware and then on to this.

  • Then we're going to install installed the database software so it is important.

  • Understand?

  • We're talking about my sequel or Maria de B or any of these other database solutions.

  • This is software, just like exchanges.

  • A piece of software, just like SharePoint is a piece of software.

  • You actually have to install this software onto onto a machine, whether it's a physical machine or a virtual machine s.

  • So then you will be installing my sequel onto your physical or virtual machine, and now you have something to work with.

  • So this is now a database server, and so this database server may be part of your back in for whatever solution that you're providing Now.

  • It is important.

  • Understand when you start dealing with databases that you can create things called clusters.

  • So what clusters are clusters are awesome clusters or what you should be using If you have databases eyes.

  • Basically, you can light up multiple different servers, install my sequel onto his multiple different servers and then basically have the databases replicate data amongst all of these different servers so that have won the physical or virtual machine fails.

  • The cluster stays up and running, so basically in this instance, then right if we have a front end here.

  • So if we have a little smart smartphone and that's trying to communicate back with a server, that's one of things you ought to be thinking about when it's communicating with a back end.

  • It may be communicating with just one physical or virtual server, or it might be communicating with a whole cluster of these database servers.

  • And basically, how how the data is routed is determined by what you have coded that type of thing.

  • So the first thing that you need to be thinking about when you're thinking about the my sequel structure is that you actually have to have my sequel running on something, right?

  • If you take a database file and just dump it on a server and it doesn't have the software to actually run it, then nothing is going to happen.

  • So you're actually going to need to install my sequel onto a physical machine and depending on how complicated your infrastructure is, you then may actually create a cluster of these.

  • My sequel databases servers for things like fail over reliability, load balancing and that type of thing.

  • Now, once we get past the physical structure of your database system again with your server with your cluster, whatever you have going off your back end, then we need to actually go into my sequel and see how the databases are actually laid out, right so you have your server, it has my sequel on it.

  • And then within my sequel, you won't have databases.

  • You won't have tables.

  • You're going tohave records.

  • So on and so forth.

  • Now, the important thing to understand with how you design your database within my sequel is it really is up to you.

  • It's It's how you look at things logically.

  • So basically, when you have databases, when you have tables, you are grouping things together a logically now when the problems you run into the room in the real world is what you can serological and what your buddy considers logical may be completely in different things.

  • And so that's one of the issues that you can run into with.

  • Basically, these database structures is that people can designed.

  • The database is really insane ways, because for them, it made a hell of a lot of sense, even though it doesn't make a lot of sense to anybody else.

  • The big thing is, when you're grouping things, what's supposed to be, is it supposed to be a logical So when people go in to do maintenance on the database, when people go and they try to write new code in order to interact with the database.

  • Basically, when they're trying to do the normal, you know, I t related task of the database.

  • It should be rather easy to understand what's going on.

  • Okay, this is the user table.

  • This is the accounts table.

  • This is the parts table.

  • This is the vendor's table.

  • You should be able to go in and very quickly be able to understand what's going on with the database.

  • The problem is, though, that's not a technical thing.

  • You can have software work, you can have a database, works that's ugly as hell.

  • It could be incredibly ugly, and it can be incredibly complicated, and nobody can understand what's going on.

  • But the computer can still make it work because it's still functionally works.

  • So that's one of the issues that you can run into s so the first thing when you're dealing with the my sequel infrastructure is that the highest level?

  • So the highest level we're gonna be dealing with is what is called that database, right?

  • So with n my sequel, So you have my sequel, install it on your server, and then you can create a database and the important thing to understand here is you can create one database or to databases or 20 databases if you want.

  • Basically, again these air.

  • Just logical high level groupings for all the data that you're gonna have now, a lot of times, if you have a company, you will just have one.

  • The single database, right?

  • So you're gonna have one single database that's gonna have your inventory that's gonna have your users that's gonna have her invoicing system and the whole nine yards, right?

  • So that may be what you want to do because one of the cool things with these databases is you can actually have, like, user accounts for the databases.

  • So what permissions people have these particular databases, you can have that type of thing.

  • And so one of the things you may think about, right.

  • So you have a small companies, small company.

  • You have five people in your company and you say, you know, I don't want to make a really complicated database structure, so I will have a single database that will contain all of our tables that will contain all of her data because I feel pretty secure with that.

  • Right.

  • But The question becomes, What happens if you have a larger company?

  • Let's say you have a company of like 1000 people and that company with 1000 people has sales.

  • It also has some kind of kind of like technicians that go out and do things, you know, out in the real world, maybe has some kind of logistics system, you know, inventory, all that kind of thing.

  • And so something you need to be thinking about again from a security standpoint is Do you want everything in one database?

  • Do you want your salespeople and our technicians and your life, your six people and everybody else being able to hammer one The single database or doesn't make more sense to have separate databases so you could have a C R M basically build a C.

  • R M database, and then you could build a work order database and then you could build like an inventory and basically logistics, you know, tracking or whatever database.

  • And then maybe actually, like a sales and invoice database, right?

  • So basically the salespeople, they will go to a one front end, and that front end will point back to the C.

  • R.

  • M database and then the technicians, they're going to go to their front and right.

  • So let's say the salespeople, they're sitting down, they're in the office, they go to a Web interface.

  • And so that Web interface connects back to the C R M database that you've created, right?

  • And so that's all it connects to.

  • And then the technicians, you develop a native app for some for their mobile devices, android or IOS, and the technicians.

  • They point back to the work order database.

  • And so the thing is, the sales people only are able to connect to the C.

  • R M database, and the technicians are on Leah broke connect to the work order database.

  • Then you have the logistics folks on there again.

  • You create some kind of other front and for them, and they're only able to connect to the inventory and logistics database.

  • Why this is important is because then that spreads the load.

  • So the actual resource load to these different databases.

  • So one database isn't getting hammered by every single user in the company.

  • And also, from a security standpoint, right, you know, sales are probably your most vulnerable people, right?

  • If somebody can try toe hack into the sale system.

  • That's probably going to be easiest.

  • So if they hack in the sale system and all they're able to get to is a C.

  • R M database, I mean, it is horrible.

  • It's horrible.

  • But the worst thing that'll happen is your crn data base will go down, right?

  • So if you have a corruption, if something stupid happens, if bad data goes in and starts screwing everything up, the worst case scenario here is then that one database that will get corrupted and then you'll have a nightmare trying to get that back up online.

  • But your technicians will still be able to work.

  • Your logistics will still be able to work, and maybe you know your sales and enforcing that that will still be able to work.

  • And so that's one of things.

  • Be thinking about again.

  • You want everything in one single database.

  • So for security, for corruption, for any kind of problems, you know, load balancing or whatever else you all you want in one database or do you want to spread it out?

  • And the important thing to understand here is Remember when I was talking about those front end's.

  • So we talked about the front end's that.

  • Then communicate back with the databases.

  • Remember, you can have a front end that can actually communicate to multiple databases.

  • So let's say you have some technicians and let's say you have Let's say you have like a lead technician.

  • So you have this system here.

  • And so sales go to C.

  • R.

  • M.

  • And normal technicians go to the work order Well, even though these air separate databases, right, you're creating a front end and a front end can connect to one database or multiple different databases.

  • So let's say you have lied technicians.

  • So let's say the lead technicians are the ones that can go in.

  • They can do work orders.

  • They can do work.

  • But let's say they can also sell to.

  • So you could create a front end for these leap technicians, and the front end could connect to the work ordered out of aces.

  • And it couldn't connect to the C R M database, and it could connect to the sales and invoice database.

  • And so that's an important thing to be thinking about when you think about created.

  • Creating a database is How many of these do you want?

  • Is it logical toe?

  • Have everything in one single database all your data for your company or organization in one single database?

  • Or doesn't make more sense to spread out the information to these different databases again from a security and from a liability standpoint, a reliability standpoint.

  • And then, if you need to be a bit, pull information from the different databases, literally, you could just simply write code.

  • It is easy to write code to connect to to databases as it is to write code to connect to one database may be able to fill out the information whenever application or front end that you have.

  • And so the first thing you need to be thinking about is this thing, this highest level, and that is the database on the database server.

  • So then, once you create your database, then within the database you create tables and so tables, more or less when you visually look at them, they basically look like spreadsheets, right?

  • So if you've ever opened up again PHP my admin or access or something like that, you will seem tables and basically again they more or less look like a spreadsheet on DSO with with tables, you have columns, so columns these air.

  • Basically what data that you're going to be accepting into the database, Right?

  • So let's say this is a user's table, so you're going to create a table for user's right.

  • And so if you're gonna create a table for user's, the first thing that you want is a user I d.

  • So whenever you're going to be creating a table, you want some i D for the records within the table, and this will generally be something called the primary key.

  • So the primary KIIS is again.

  • Remember, in the database world in the computer world, computers can.

  • Computers can't think on their feet.

  • They can't.

  • They can't assume what you mean, right?

  • They can only do whatever they're coded to Dio.

  • And so one of the big problems you could get into a database is is what happens if you have two records that are literally identical, literally identical.

  • So when you go to do a search that's gonna run into problems, because and then you're gonna get two identical records that is gone, it's just gonna become a mess.

  • And so what the primary KIIS is.

  • The primary key is the weight is to make sure every single record is unique within the table.

  • So, basically, generally with a primary key, you do something called auto increments.

  • And and basically, as new records Air created, it counts up.

  • So record one record to record three record four record.

  • Five That type of thing, right?

  • So the first, the first column you're going to have in a table is generally going to be your primary key.

  • It's going to be something such as a user i d a part i d an invoice i d an account i de la la la la In the beginning to make it easiest, you will make that an auto increment thing.

  • So basically, as new records air created, it simply goes up.

  • So this will be a user i d.

  • One.

  • He's your idea to user i d.

  • Three user i d four user i d five.

  • And so what this means is that within the table, even if the other columns have identical information in them, at least this one column in front will be different.

  • Then past that.

  • Then you can have Let's say like the the first name.

  • So if this is a user, you can either first name, so that's that's a field.

  • So if you're gonna be putting that that type of data into your table, then again, maybe it could have something like an email address, if that's what you want, and then maybe you can have something, possibly such as, you know, the person's age.

  • So depending on what you're going to be doing, And so these this is the type of data that you're going to be pulling in to this database.

  • Now, once you have the columns, then you can all.

  • Then you can also say what the data type is.

  • So this is an important thing in the database world.

  • How do you add Bob plus Sue?

  • Riddle me this Riddle me that Bob plus one divided by Twinkie equals what a mess.

  • A garbage.

  • It's absolutely horrible.

  • And so you have what are called data types.

  • And so what data types are is you say what kind of data you want these columns to be able to accept.

  • So if you're asking for a first name or last name or that type of thing, you will then say just simply text.

  • So the data type for that is text.

  • If you have email, probably that you'd either use text or something called Bar Char.

  • We'll talk about the data types later.

  • We'll go and more in depth with that later.

  • But basically it will be a text or of our shark.

  • And then age, though right age that you wanted to be a number so that you would have an integer do it have what's called an ent.

  • So that's just basically just a number, right?

  • And so the important thing here is if if you're doing calculations based off of age.

  • So let's say you want the average age of all the users in this particular table, you know what you don't want is somehow Bob to be a record, right?

  • You don't want aged to be Bob, because you were saying, you know 12 was 13 plus 15 plus Bob plus 17 plus 12 divided by six whenever to get there to get the average right.

  • Bob Bob is not a number.

  • So what you're going to get is you're going to get a mess when with databases orthe programming, it's called garbage in garbage out.

  • And so if you do something such as Put Bob into the into a field where they're expecting a number and that actually goes into a database that can cause all kinds of hell, so what you can do is you can assign a data type for that column for that field and say it will only accept integers.

  • So basically, if you try to insert Bob into a column that has an ad, a type of energy, it will simply fail out.

  • And so that's a very important thing to have happen.

  • And so when you're dealing with with tables and you're dealing with these different columns, amazing.

  • What we're gonna do is you're going to go in.

  • You're gonna sign what type of data data type is supposed to be.

  • There is.

  • It is a text is it ends.

  • It's important thing to be thinking about, like with numbers.

  • So end is different than float.

  • So right end.

  • An integer is 1 to 1000 right, but you'll notice there's no decimal points there.

  • A float is a decimal point, so 10 dot to 10 55 s so on and so forth, so That's one of things you're going to be thinking about when you create the columns.

  • When you create the data that's gonna be put into your database again, is little things such as Is it going to be an integer?

  • Is it going to be afloat?

  • Is it going to be a long So even with numbers, there's different data types to put in there.

  • And if you screw up the data type, you could run into some different problems.

  • So this is basically what the tables look like when you're going to be dealing with with with my sequel.

  • Now pass the tables, then you're gonna get to the individual records.

  • And so, basically, again, we go back that table.

  • So we go again.

  • We create users, we create the columns like we did before.

  • As we have user, I d.

  • We have name, we have email, we have a JJ.

  • We have whatever else and so basically then passed that what we're going to be talking about is the records.

  • And so the records or the rose the rose are the actual information that you're putting into the database.

  • So, user, i d one name is Bob.

  • Bob you know at a well dot com and Bob is 12.

  • User I D two is Sue ESU at hotmail dot com, and she's 15.

  • User three is Tim.

  • You know Tim at outlook com and you know 17 so on so forth.

  • So this is where we're talking about Rose or records.

  • So this is important thing.

  • Sometimes people get confused about this when they're new.

  • Basically, we're talking about cost, So columns is the up and down, and so that is the data you're bringing a user I d and the data type across those are the rose or those of the records.

  • And that's the individual.

  • Like I say, user account Where the part i d or the envoys, I d that type of thing.

  • And so that's what we're talking about when we're talking about columns and then we're talking about Rose.

  • So with all this talk about databases and tables and rose and records, basically what we have been talking about here is what is called the schema.

  • So this schema is this is the design of your database, right?

  • So you have your database, so I don't know e t c G database in that database.

  • You have a user's table in that users table.

  • There's the columns, you know, user, I d.

  • A name A then maybe have a parts table and that has a part I d name description, whole nine yards, right?

  • And so basically, when we're talking about the schema we're talking about, what does this whole database look like?

  • So you have the databases E T C g.

  • You have a table called users.

  • You have a table called parts within the user's table.

  • You have used your I d of nan.

  • You have aged within the parts table.

  • You've part idea of name your description, you have price or whatever else.

  • And so this is the schema.

  • So why the schema is important?

  • It could become a real pain in the butt.

  • Is do remember many times the front end developers, right?

  • Remember, we talked about the front end and the back and developers, uh, can be two different people.

  • Could be two different teams.

  • They could be teams that aren't even on the same darn continent, right, by The important thing to understand is when you have the front end developers, they can on Lee send data or retrieve data from whatever has been created in the database.

  • So the schema in the database, right?

  • So they need to connect to the E T.

  • C G database.

  • They need to go to the user's table.

  • They they need to pull out information from the user's table or if a new user account is created, they need to connect to the E T C jet D E T C D database, and then send data to the particular table.

  • Right.

  • Well, here's one of the problems.

  • What have you had?

  • The front and developers, right?

  • And so we've been getting user I d and we get a name, we get an age, and then the front of developers go Oh, you know, you know what we really need here?

  • We need t shirt size, right?

  • We need to start giving out T shirts Thio to the people that sign up for our service.

  • So we need to know what size they are, you know?

  • Are they small, medium or large?

  • Well, one of the problems you can get into is the front, and developers can actually code all this end to their front end.

  • But here's the thing you have a schema.

  • So this schema is basically hard coded in here.

  • So until your database administrators create a T shirt column for you, there's no place to be able to actually put the data that the front and developers want to get from from the users.

  • And so this is where you'll hear of some databases where they called scheme on lists.

  • So some types of databases such is no sequel databases don't have a schema.

  • You can literally the coders.

  • The coders can literally grab data, and they can.

  • They can associate it with whatever they want.

  • They just dump it in, and they just pull it out willy nilly.

  • But you don't have to get the database administrators involved.

  • But when you're dealing with something like my sequel, basically when you're pushing and pulling the data, there needs to be a place for that data.

  • If you do not have a T shirt column, then there is no place to put the T shirt data.

  • So not only do you need to put the T shirt code into that front end, but you also need to make sure you go back into the user's table and actually create a T shirt column there and then make sure that you have the appropriate data type.

  • So again, what kind of data type do you want?

  • You wanted to be an integer.

  • So an imager.

  • So maybe small is one medium is too and largest three.

  • So that would be an ent data type.

  • And so, basically, you would have the code send one of those numbers or do you want it to be text?

  • So text is where it actually small, you know, medium large.

  • So do you want that to be sent to the database?

  • That some of the things you have to think about with the schema, and so how the database and how the front end will actually be working together And make sure both your database people and your front end people are on the same page.

  • And now the final thing to go over is something called the storage engine.

  • Um, so basically, if you're new to the my sequel world, even if you're not knew that my secret world, if there's no reason to mess with your storage engine, don't mess with the story changes, right?

  • So basically what?

  • The storage engine is is this is the code that actually manages the database itself.

  • So when you do a search on the database when you're inputting data into the tables, the storage engine is what is actually going to be doing this, eh?

  • So when you think about a storage engine, kind of think about it like the VoIP world.

  • So if you're dealing with voice over I p you install a Cisco call manager system, you installed some kind of voice over I p system.

  • You install your phones and then you can choose a Kodak.

  • Right.

  • So So you have Polly Polly calm phones.

  • You've gotta Cisco call Manager.

  • You've got all that kind of thing.

  • But then the actual software, the actual encoding for the voice communication is done by the Kodak kind of think of the storage engine is like the Kodak for your my sequel database.

  • This is this is the saw, the actual component of the software that's allowing you do the circuits as allowing you to write records into the database and actually pulled out of out of the database.

  • There are different storage engines out there, the one that is currently, uh, the default for my sequel and has been for a while with something called You know, D B.

  • Um, and this works.

  • This works.

  • Uh, one problem again you run into in the real world with new people is they go Look, we have options.

  • Let's play with options.

  • Let me be clear.

  • There are reasons to use other storage engines once.

  • Once you really know what a storage engine is, Once you know why you might want it.

  • A storage engine other than I know d B then by all means came to the storage engine.

  • But different storage engines, basically, with what they dio is they actually do the process of putting the data into the database, being able to do the searches.

  • And so different storage engines work better in different capacities.

  • Um, again, I know D.

  • B is the default for my sequel right now.

  • Just leave it like, literally, This isn't something again.

  • It's like a Kodak.

  • It's like a Kodak when you're dealing with scale.

  • If you have a voice over I p system and that was in people on your voice over I P system, then changing the Kodak will make a lot of difference before your enterprise.

  • But if you think if you're simply playing around you have one voice over I p phone on your desk and connecting to a server, you're most likely not going to notice a lot of difference with the Kodak.

  • It's not really gonna matter.

  • It's kind of the same thing with the storage engines, right?

  • If you're not in a production environment, ifyou're not hammering the hell out of your server, you're not is only going to turn into a mess if you try to do different story taken.

  • So it's just stay with Dino de Be.

  • You'll be happy for it again once.

  • Once you learn a lot more than mess around with a story changes, I just want to tell you the exact This is one of those things.

  • Where is like look, storage engines exist and don't don't play with it.

  • Don't don't don't touch, don't don't touch.

  • So that's a basic overview of what my sequel of structure will look like for you, right?

  • So you're going to have a certain and so that's either going to be a physical server or that's going to be a virtual machine.

  • You're going to have an operating system installed onto that physical or virtual machine again, that could be Lennox.

  • That could be Windows that could be Mac OS.

  • Then, on top of that, you will install my sequel, and that will then give you a my sequel database server.

  • Now for the back end component, you may have one single server.

  • You may have a cluster of servers.

  • You may have a very sophisticated environment there, but the key thing is, basically, you've got you've got a server.

  • It's got an operating system.

  • It's got the database software installed on that, and then you build everything out past that again.

  • When you're dealing with the actual finished product that your users are going to be interacting with, you're going to have a front end and a bank.

  • And it's your mat, my sequel of data base infrastructure, Whether it's one single server or a cluster, that is going to be what's called your back end, the front end is the interface that your users are going to be using again, whether that is a mobile and native mobile app on IOS or Android.

  • Whether that is a Web application, whether that some other kind of wacky thing that you created.

  • Do you remember again all the database?

  • Does people get really confused with us?

  • Sometimes all the database does is store.

  • The data right is just is just a place to store names and ages and skews and that type of stuff, right, actually interacting when that data, that is what you're going to use a front end for.

  • And that is something that that you or somebody else will be coding on your own.

  • So again, this is an important thing.

  • A lot of times people install a database server again.

  • They had this idea of access.

  • So access is a piece of software from Microsoft.

  • This It's a database software that comes with the database, and it comes with the front end, and it comes with intelligence, and it comes with everything.

  • So basically, you could just build it something right out of the box.

  • Do understand with my sequel, the other databases.

  • That's not the case.

  • You install the database, you better have data in it or not, and then you have to build a front end out of something.

  • Maybe it's built out of PHP.

  • Maybe it's built out of Ruby.

  • Maybe it's built native application, right, But you have to build something text be able, connect back to the database.

  • Then when you're actually looking at the database server and you're looking at the structure you create within the database server, the highest level and a database is a database itself.

  • So again, if you have a small company or you don't need thio input a lot of different kinds of information you may have a single database for your company.

  • Again.

  • You may have won the C R M database, or you may have won invoicing database, and that's what contains all the data for your company.

  • But again, if you have a larger company, you may think about having a CRN data base and the work order database for your fuel technicians and some kind of inventory database.

  • The reason that that's important is because you can have different permissions for those databases again.

  • From a security standpoint, if one of the databases gets compromised that you only have to worry about, that one database can compromise, so you're Croom database got corrupted or got compromised, but at least your inventory in your sales databases are continuing to work, and it's important to understand.

  • Again, we talk about the front and in the back end.

  • When you go to the front end, you can actually code the front end to communicate with multiple different databases.

  • So again, if you had a senior level technician in the field, maybe you want your senior level technicians not only to be able to work orders, but also to be able to do sales.

  • Right?

  • Upset.

  • Get up, cellar.

  • Die if you're If you're in the real world with business up, sell Upsell Upsell so you can have your senior technician come out.

  • And the application that they're using the front end that they're using not only connects to the work order system, but it may also connect to the sale system so they could say, OK, we've done all the work for you today.

  • Have you thought about buying some more clients or upgrading your server or doing something else?

  • Since I'm here?

  • You know, I can actually input that and put that into my system, and I can sell that to you today.

  • And so that's important thing to realize is it's not like when you create these different databases.

  • They are selling their self contained toe one degree, but you can create code that then marries the data amongst these different databases into that one front end that your users were going to be used.

  • Once you get past that, once you get into the database itself, then you get into the tables.

  • So again the tables should be a logical containers were data your users table your parts table your accounts table your invoices table.

  • That's everything again.

  • Remember, when you're designing database, it can be ugly as hell and function kissed.

  • Realize this in the real world.

  • It could be ugly, messy, nasty.

  • No one can understand what the hell they're looking at, and it can still function all at the same time.

  • So one of things when you're designing your database system is you want to basically lump lump like things together, right?

  • So users go.

  • One of the user's table vendors going to the vendor's table parts go into the parts table, and then from that you'll create the code, actually connect those different tables together to be a push or pull information out within the tables.

  • That's where you have the column names.

  • And so again you have, like a user I d or apart i d.

  • The first column is generally what is called the primary key on the table.

  • So again, every record in a table needs to be unique.

  • If you have two records that are identical, that can cause all kinds of problems, you create what's called the primary key the primary key.

  • You have that be absolutely unique.

  • So even if the other information in two records is identical, at least the primary key will be different.

  • So therefore, there will be unique records.

  • Generally again, in the beginning, when you're wearing the code, you simply auto what's called auto increment the primary key.

  • So the first record is one and then automatically means the next record is 2345678 As you get more complicated as you learn more there, there are different ways to create those those unique primary keys.

  • But generally you do auto increment.

  • Ask that again.

  • If you're dealing with the user's table, then you would have the name, then you have the age and you have the email address so on so forth.

  • The important thing to understand there is that you can then state what data type you want that field toe actually be able to accept.

  • So if you're trying to get names from people, you want that to be text, right, So you're right.

  • On the other hand, if you're looking for a JJ or prices or social Security numbers, anything that might be a number, you don't want people to put Bob in there right again.

  • You're trying.

  • You're tryingto add up a receipt.

  • You know, this items $1 in this item is $2 this items bob dollars.

  • And this night of $5 then you try to add that all hell's going to take place.

  • And so one of things you do is you can assign a data type So again for price for aid.

  • For that type of thing, you can say this will only accept an end.

  • But again, it is important with numbers and end is a whole number 1 to 20 51,050.

  • Whereas a float a float is a number with a decimal point.

  • Uh, 1 10 1 not 10 20 not 50.

  • You know that type of thing.

  • So that's What a flotus on DSO again.

  • One things ever be thinking with the data type is make sure to really be thinking about what kind of data you want to be accepting on.

  • Then you put that data type in there, and it's important, understand when you create the front end.

  • If somebody puts in a different type of data that could be accepted into that that particular field in the database, then then the end, sir, command basically will fail out.

  • So if you try to put Bob in the age, it will fail out on.

  • You want that because you don't want people putting Bob and ages were bobbing prices that everything.

  • Then again, once you have the columns of column names, the data types that you have the records So again you know user I d.

  • One equals Eli Eli a gmail dot com age 40.

  • You know, record to Su su at hotmail dot com, Age 25 someone and so forth, and then those are the records on.

  • Then finally, they talk about again.

  • That whole idea of the schema the schema is this whole design that we've created.

  • The database named the Table names the column names all of that information.

  • The important thing to realize with that is, when people are coding for the front end, they cannot send data to fields that do not exist.

  • They cannot retrieve data from feels that do not exist.

  • And so you're front and developer sent your back, and developers have to be at least kind of sword on the same page s O that when they're developing the full application that the data that is being brought in by the front end has some place to go and that when the front end is requesting that and that is actually requesting data from the right place.

  • So this is one problem you can run into a scheme us is.

  • When you have different people in different departments trying to create a front end in the back end, they may name thing.

  • They may not realize what the naming convention is.

  • They may not realize where data is stored within particular tables in that can cause real problems.

  • That's why there are some databases out there, not my sequel that called Scheme A List, databases and scheme.

  • A list database is basically the front and people would just dump that in all day.

  • They don't need no schema, Uh, but that's not my secret.

  • That's something we'll talk about later.

  • Is that just gives you, like an overall idea of what's going on with my sequel structure.

  • So when you start thinking about this when you start actually going out there to build a database based system, or if you're trying to maintain, one can have a better idea of what's going on.

  • The final thing again is there is something called a storage engine in a storage in you and that's kind of thing.

  • Like geeks or like Woo, I want to play with storage engines.

  • Don't yeah, dumped the storage in again is the component that actually does.

  • Basically the searching through the database does the right does the reeds.

  • There are reasons why you may want to change from the default storage engine, so the defaults torque engine and my sequel is currently it's called I know D B, which will be fine for you again if you're installing WordPress.

  • If you're building, you're stupid.

  • You're stupid little app.

  • I don't d b is gonna be fine.

  • There may be reasons to change the store attention, But don't change it until you know what the hell you're doing.

  • And you know why you're doing it?

  • Because it can run into a lot of lotto Were the kind of problems on you don't want to be dealing with your kind of problems right now.

  • So just just Just don't mess with the story, get it?

  • It's fine.

  • Just leave it where it is.

  • So as s o.

  • Uh uh, that was a basic introduction, Thio my sequel structure.

  • As always, I enjoyed doing this class and foresee the next one.

creating these classes requires equipment and service.

Subtitles and vocabulary

Click the word to look it up Click the word to find further inforamtion about it