Session Start: Tue Dec 05 12:04:36 2000 * TDavid turns on the log I see roscoe can't spell either * LaughingEyes scoots off to see roscoes post hahahahahaha http://www.adultnetsurprise.com/learning_center/php/php_week_14.html roscoe is in a panic right now!!! hehe, roscoe, you should call kaiser about what we talked about earlier, mon, really :) are tou the doctor one? yeah that was me it was the absolute truth too promise did you order already? no...waiting on a reply heh should i? *** Rowdy has joined #netsurprise Hiya all! welcome rowdy :) rutro it's rowdy howdy rowdy ! yea go ahead NP..hell if i can promote NP you can be late :) hiya Rowdy rutro? forget... I'm not asking...lol heh thanks... Thanks rowdy! anybody here not know what mySQL is useful for? :) no I dont know or have questions about what a relational database is? whistle ......look around you got me for 52 minutes to drill my brain on that, if you like :) Thank you roscoe... the admin@adultplaces was my order if ya didn't already figure that one out...lol Well tho seriously tell us about relational db's :) yea got ya rowdy thanks. or how to design a good relational database, maybe is a worthy discussion is there sound for this? let's talk about what a relational db is no roscoe the idea with relational db is to reduce redundancy in data ok. ill shut up then. ie. let's say you have the url you are tracking TDavid sounds good to me as I think I know what it is but not positive well if you put the http:// in each url that becomes quite redundant we know each url begins with http:// after all :) TDavid... trust me... not all folks realize that :)) hehe, ok ... well, they all do .. so we can relate any url to http:// or at least by submissions one would get that idea that they don't ...lol so now if we want to print a url say to the screen we pull from the database and add to the beginning http:// that is a simple one-level type illustration of relating data to one another relational database have many levels however some of them become quite complex let's use thelinksmachine as an example ... at the surface it seems like a rather simple database, but in actually it is a fairly complex relational database you sign up your website and now you are one piece of data -- your registration data which might include your email address, your home page url, your login, pw, etc now each link that you submit becomes related to you and the features of each link all relate to various pieces of data *** Kaiser is now known as kaiserphone none of which is ever repeated where else wouldyou expect to find kaiser you could have one table with all data in it and this is what some people will do ... and then realize, wait i'm having to put the same data in over and over again so the idea when developing a data structure is to relate everything to something else good point TW :) and not to repeat this process so you end up with smaller more precise tables of data it's like finding Kaiser in the phone book which makes seraching or querying it much simpler *** belle has left #netsurprise you would probably go to the "k" first, right? *** Renegade has joined #netsurprise or try to open the book in the "k" section of the book or where you think the "k"'s might be hi Renegade It's a good thing I don't read cahts or look at the computer when I'm on the phone.... yes, pipeln, it does make querying much easier, but not necessarily more simpler well less steps for me.... in fact some complicated database have very sophistocated queries ... some use complicated algorithms so your saying indexrecords across various tables instead of one large one Sorry, Hi Creator i'm just not very good at math and unfortunately it does become a mathematical computation sooner or later so i have to contact some database guys to help me with algorithms sometimes once I understand the math I can write the code, but I sometimes have trouble understanding the math maybe some of you are good at math ... but I was horrible *** Imaster has joined #netsurprise wb Imaster ty CrEaToR basic math, no problem ... if you start talking advanced calculus well, that's another story hehe i hate math too..... math in a database? I'm really good at math... unfortunatly... the only time I've used it on a server type application was counting the amount of folks I shut out of the local dial up company once....lol i built the e-commerce engine for Vince Carter's web site, it is very complex and had me pulling my hair out. good point :) well tw, math comes into the part where you put together the query and the code to extrapolate the data in the most efficient way different laws of searching by guys who study the way that data is fetched most queries for most databases are simple so most of what I'm saying here won't apply ... however, a good database structure will scale very well, which is very important in long term usage and access of the data the music example works good like finding all small shirts that have a certain logo and is available in black, and is somewhere between $10.00 and $30.00 after a discount of 10% IF they are a fan club member heh sorry no, that is a great example the more you need to get out of the database the more you'll have to put into the query :) and the less hair you have after it is done thats math? I thought it was just query strings......... call me ignorant but!! well what is algebra? it is dealing with a situation like pipeln just described *** Renegade has quit IRC (QUIT: User exited) just a complicated query which would be impossible without relational databases *** esco has joined #netsurprise Wellllllllllllll! inform me:) but before you can do the query, you have to store the data in a format that allows for these type of queries so let's start there hi esco let's build a music database as i outline in the course text http://www.adultnetsurprise.com/learning_center/php/php_week_14.html we want to create a table of artists -- this will store the name of the band/artist and information specific to the artist the artist will have a unique id number but what about bands like Led Zeppelin and solo artists like Robert Plant? they would be two separate artists, yes? ya i think so but really Robert Plant has two relations ... one to his solo career and one to Led Zeppelin but rober plant put out music on cd as robert plant .. not always as led zepplin and he also has done other projects with other bands, so he would have relations to other bands, yes? his work with other bands.. if it wasnt on HIS cd .. would be other band f/ robert plant - blablarocksucks now we neeed to do a query -- we need to figure out what every song robert plant has ever done? this is why we need to make each artist unique ya and form a relationship to a BAND, if it is exists so robert plant would be a separate artist, and hold a 1-to-1 relationship to the artist Led Zeppelin and any other band he belonged to so now we have the fields for the artist database: artist_name, date_established, artist_1, artist_2, artist_3, artist_4, artist_5 we might have 6 fields say because most bands are 6 members are less, yes? * Rowdy makes notes to hire TDavid if he needs a relational database ...lol yea most are less it would be easy to add a new field to the end if we have some 12 piece band, i spose but that's the idea, make the table so you can add a field to it without causing the end of the world now we need to look at songs ... well songs are unique units themselves, so they should be a separate table now what about an orchestra .. each member get thier own field? or are they just one feild together i would make the orchestra a unit and each performer a separate artist ah ok the name of the performer is held in the artist_name the 1-to-1 relationship is in the field artist_1 (which is a reference to the ID number of the artist) this way the artist name only shows up one place in the database a reference is made to it from wherever it relates so now when we do our song table we'll have the following fields: song_title, song_writer, artist_performer, date_created the song writer might be different than the artist, yes? a lot of artists don't write their own music a lot do but what if you wanted to know every song Eddie Van Halen ever had done guitar work for he did the guitar solo for michael jackson beat it by the way well if the song beat it, didn't show eddie VH with a 1-to-1 relation to him, it would never show up in a database query, that is so we'd probably need a song_writer1, song_writer2, song_writer3, etc and these would be 1-to-1 relations to the artist IDs now we have the songs that are on CDs ... CDs and tapes and records are really units themselves, so there should be a separate table for these tapes and records are formats, so if you wanted to track the format of a song, you'd probably want a field for that, but it might be easier to make a table for each the more you can break down related data, likely the more efficient it will become because let's say you want to find songs by robert plant on tape recorded in the 80's you could query your tape table by artist id (robert plant's) and by date range from 1980-1989 instead of trying to figure out the format from the CD table and then the artist id and then the data er date so 2 steps instead of 1 perhaps a small advantage seen here, but a huge advantage when thousands of queries are performed also, the biggest advantage of relations is updating data what if I mispelled Robert Plent? if it is replicated over 100 different tables in 1000 different records, yikes, an update nightmare but in the artist section I update one row in one table where his name is placed one time and everything else that relates will not be affected what if I want to change the title of a song? ... I goto the song table and update the song name in one place and so on and so forth this making sense? any questions? made sense to me... well, as much as it's going to at this point :) i think sometimes programming gets confused as being a super-hyper technical thing, when in reality it is logic. You break down programming tasks, no matter how large they are into tiny little bitesized pieces I look at some huge algorithm and I think, omg, how can i understand this 1000 lines of code as a whole is very confusing .. you have to break it down to 20 lines or maybe 5 lines and take it one line at a time a database is similar in that if you look at one table you can really only get a small snapshot of the data as a whole it is how the data relates across all tables good point TDavid so if I am going to write a tgp script, that is a lofty goal ... i'm going to think ... what makes up a tgp script? well, you need some way to get data to the admin so that they can review the submissions. so we need a submit script a submit script is really nothign more than a form -- which forms are done in HTML, so I need to design a form with the fields I will need for my tgp script the submit script will take the results of that form and save it in a temporary place so that the admin can review the form er review the results of the form, that is so we need an admin area ... which again begins with a form you design the form and then you design all the little individual components approving a submission ... well we need to take that data and move it to a more permanent location in the database and mark the record as approved and at the same time we need to delete from the temporary location then we return and offer the admin a list of submissions minus the one we just approved :) so when people say, I need a search engine, the next question is ... to search what? to search where? to search how? everyone in this room is a programmer. We all decide each morning how we are going to do something. Maybe we'll wear a white shirt, maybe a red tie, maybe we won't wear anything at all :) so if I'm sitting down to create a mySQL relational database, I'm going to sit down with a blank sheet of paper and write down all the pieces of information I'd like to be able to track maybe this list is 100 items long then i'm going to create groups and place these items in groups well this item belongs in "group a" this one in "group b" and so on and so forth until all the data belongs to some group when i'm done, the groups will most likely form the tables for the database and the data will be fields inside the table this is 90% of designing a database ... the last 10% is the actual application ... which involves things like determining field sizes ie. a name field should be some set variable length .. you don't want it to be 100 characters, that is too wasteful of space maybe 15 or 20 characters if a guy has a 40 character name, he should get it changed :) and your database will truncate him and he will have a changed name hehe ;) so it is important to set the field sizes lengths that lean on the side of being restrictive and not too loose each extra character allotment can equate to wasted byte of space, so it does add up 1000 bytes = 1000 unused characters approximately you can always make fields bigger without much risk to your database design, but it can be treacherous to go the other way *** PipeLN has quit IRC (QUIT: User exited) ie. you have a field size 50 for email and you make it 25 ... now you might be cutting off some people's email addresses which of course would damage your database, and some changes like this are irreparable if you had 25 and made it 50, you wouldn't be truncating data :) well .. there's my info on creating a relational database :) a well designed one can be your best friend, a poorly designed one can be your worst enemy :) a lot of info it was as well :) *** CrEaToR is now known as CrEaToR-bRb we'll be adding to this on Friday's script school, but is there any questions? or am i just populating the logs with info? hehe :) yeah, it's a lot rowdy, a lot to digest I know nothing about a radio. But I bet if I took it apart and examined the schematic with someone who could teach me WHY each thing does what it does, I could build one someday. I'm not very mechanically inclined though, so maybe not lol haha well i know there is an on-off switch, that much I know hehe I'd probably tackle the radio before I would a huge data base i bet the guy who created a radio realized, hey ... i have to figure out how find a signal ... out there so he did the hardest part which is creating the chip or whatever it is that does that reminds of that movie, Frequency, you see that? hehe *** EclectiXXX has quit IRC (QUIT: User exited) guy can communicate with his dad in the past, fascinating little story doesn't ring a bell ... but probably with all the movies the wife and kids rent ahhh... ok... ya, I rember that one remember even well i guess that about does it for introduction to mySQL databases hehe hope i didn't scare anybody away from designing them, they are quite fun to play around with beauty of it is you can always backup the data and then build a new one and make it better *** roscoe has quit IRC (QUIT: User exited) kind of like making soap box cars ... some are slow, some are fast, some scream good job.. I understood it to a decent degree well thanks :) only have to understand concept, the language behind it comes easy if concept is understood (for those reading the logs) very true like i said earlier about math. I don't understand the math sometimes, i need to get help once i understand the math i can write the code i don't understand how the server works sometimes in some cases so I goto a server guy to help me understand why the server does this or that, once I understand I can then write the code funny thing is a lot of really good database guys can't write code ... they spend their time building beautiful database structures and interacting with the database directly ... but writing php or perl or c to query their own designs is problematic I could see that ... a lot of folks that are outstanding in one field has problems applying it to others... for some it comes natural i guess this is why networking is so important, and i don't mean networking in the internet since :) er sense doh! yep * TDavid logs off Session Close: Tue Dec 05 13:32:56 2000