What Is A Database How Do I Use One? - : Information about Databases and how to get use them efficiently

free web hosting
Free Web Hosting > Computers & Tech > Databases

What Is A Database How Do I Use One? - : Information about Databases and how to get use them efficiently

lenbot
Hello All

Let's start off by talking about what a database is and how it would be efficient in using it. It wasn't until about a year and half ago now that I was first introduced to this new age of Database. I discovered a lot of neat things and even learned about databases the very long way.

A database is exactly how it sounds its data that has a base. The base being the place where you store all your data. If you have ever been to a library perhaps you have used the Index to search for an author, this is a database of authors. Ever seen a rolodex on someone desk, imagine multiple rolodex’s that were huddled together and were joined together by links of information. Simple it sounds but there is a lot more to it than that, but once you learn the simple stuff it makes a hell of a lot more sense. A phone book is a database of phone numbers; stored alphabetically by last name. You can simply look up Griffin Peter, until you find the Griffin Peter you’re looking for. A database is exactly that, you can use it to store information, and instead of you looking it up, you simple query the database to look up the information in the column in your rolodex.

Let’s get some terms and definition’s out of the way. You don’t need to fully understand what the definition mean. Just know that these are term’s used in Data basing is important. You eventually will get the meaning.

C.R.U.D.
Create, Read, Update, and Delete.

Primary Key
The candidate key selected as being most important for identifying a body of information (an entity, object or record).
Source (http://dictionary.reference.com/browse/primary%20key)

Table
A collection of records in a relational database.
Source (http://dictionary.reference.com/browse/table)

Database
One or more large structured sets of persistent data, usually associated with software to update and query the data. A simple database might be a single file containing
many records, each of which contains the same set of fields where each field is a certain fixed width.
Source (http://dictionary.reference.com/browse/database)

Record
An order set of fields usually stored continuously. Sometimes also called a “row” in data basing, and in spreadsheets it’s always called a “row”.
Source (http://dictionary.reference.com/browse/record)

Normalization
In relational database design, the process of organizing data to minimize redundancy. Normalization usually involves dividing a database into two or more tables and defining relationships between the tables. The objective is to isolate data so that additions, deletions, and modifications of a field can be made in just one table and then propagated through the rest of the database via the defined relationships
Source (http://webopedia.internet.com/TERM/n/normalization.html)

So let’s just create a small database that will store student’s class schedule. I am not going to go into the steps of creating it in Mysql for this is just a theory lesson and understanding on how to create a proper database.

So if you have a database of student schedules you’re going to have to store certain information. So we need to store Names of all the students, where they live and there courses, what time there courses are, and grade. Now this sounds easy enough, you have to remember that when creating a database you want to have as few records as possible and little redundancy also, preferably none, and absolutely no anomalies. Because you want have your database spend the least amount of time looking for the information, and never have data that can’t C.R.U.D. with out creating an anomaly.

Most databases have complicated ways of looking up information stored in there databases. A Database like Oracle is really efficient because they have written algorithms so that it can spend less time searching and return results faster. A simple Mysql program doesn't have such complicated ways, though it is very fast if you have millions and millions of records it will slow it down. And if you have millions of millions of people constantly asking the computer where this information is it can really task a computer and it will be lagy in response. The algorithms in databases are not the only thing that makes them different.

So let’s create a skeleton for a database where we want to store a student schedule.

Table Name: Class Attendants
AttendantID, First Name, Last Name, Address,

Table Name: Classes
CourseID, Course Name, Teacher, Time, Credits

Table Name: Student Course Schedule
SchedualID, StudentID, CourseID

This is a good database design for a school schedule because it is flexible and can be applied to many different schools if your running any kind of school it can be used. If you considered each table as sort of a rolodex you were looking at, perhaps this would be an easier concept of tables. If you look at the table Class Attendants, you will notice that it contains the Name of the student there last name and there address along with a Primary Key, Attendant. This unique identification (Attendant) allows for multiple students and teachers even if they have the same name, to be stored in the database. Same as the Class Table, along with the Student Course Schedule. The table Student Course Schedule is what we call at junction table, it connects both Class Attendants table and the Classes table together. If we didn’t have a Unique ID for each person in the Class Attendant table we would have to use something else to use another unique system of identifying our Class Attendants from one another. Let’s say our table looks like this.

Table Name: Class Attendants
First Name, Last Name, Address,

Table Name: Classes
CourseID, Course Name, Teacher, Time, Credits

Table Name: Student Course Schedule
SchedualID, First Name & Last Name, CourseID

With out the unique identifier to tell our students apart, when we try to C.R.U.D we would have problems. Such as we want to pull to look at all the classes Peter Griffin is in. We would call on our database to look at First Name & Last Name and pull all records pertaining Peter Griffin and find out that there are 32 classes for Peter Griffins in the school. Since your school only has 8 Classes for each student and there are 32 for this one student there must be an anomaly. Because there actually must be 4 different Peter Griffins going to your school and because you didn’t uniquely identify them apart you have no idea which class this Peter Griffin goes to. We could how ever identify them apart by there address, oh unless your kids come from George Forman’s house. Then you have multiple students with the same name from same house so that wouldn’t work either. So it is important when Data basing to take all these considerations in to play because when you C.R.U.D. your data you don’t want to have anomalies such as 4 Peter Griffins with no course schedule because you can’t tell any of them apart.

So our original skeleton of a database is actually quite fine and will work well. Though I am sure there are some out there that would create it differently, I will attempt to explain why you might create a similar database that works fine also but doesn’t even look close to mine. Creating a database is almost like an art, the creation of your own database will be exactly what is needed by you, there is but one true rule in creating a database. No anomalies, a bad database will have redundant data in it. But redundant data though it slows the system down and is just a crappy database, you cannot have a database that has anomalies, or you won’t be able to C.R.U.D your data and you don’t want that.

For a nice tutorial on database normalization and all the rules that go with it please go to
http://www.rsolutions.net/RSweb/TOC.htm and click on either Database Normalization or No Slide Title.

I know this article is not the greatest but I hope other’s instead of ranting how poor it is would contribute to what I have missed or didn’t make sense of.

Cheers

Lenbot

 

 

 


Reply

Mark420
Well done Lembot- a spiffy guide to first time creators of Databases.

Also If I might add something of my own...please guys if your looking at starting a database project for the first time please look at MySQL first..Im pretty confident it will be what you need.
The reason I say this is because most ppl start off in MS Access because its already on thier pc as part of an office install and they get bogged down in the crappy way access runs.

MySQL is free to use has lots of great GUI packages to help you build your database and make scripts,views,quiries on it.
If you couple Open Office to MySQL then you can manage data in spreadsheets etc with complete ease...unlike trying to get live data over to Excel in the Ms world ;((-Its an absolute hell!!

Also it makes sence to use MySQL if your posting here...because Astahost uses MySQL on thier servers so as part of your hosting package you have free access to it.

Hope this helps...

Mark420;)

Reply

lonebyrd
Thanks lenbot! That helped me to better understand 'primary key' a little better. I've read about it a little in a tuturial, but was never exatly sure about it. Your example with the Student ID was pretty clear to me. While I'm still learning about databases, this was a help for me.

Reply

evought
QUOTE(lenbot @ Jun 26 2006, 08:35 AM) *

<snip>

With out the unique identifier to tell our students apart, when we try to C.R.U.D we would have problems. Such as we want to pull to look at all the classes Peter Griffin is in. We would call on our database to look at First Name & Last Name and pull all records pertaining Peter Griffin and find out that there are 32 classes for Peter Griffins in the school. Since your school only has 8 Classes for each student and there are 32 for this one student there must be an anomaly. Because there actually must be 4 different Peter Griffins going to your school and because you didn’t uniquely identify them apart you have no idea which class this Peter Griffin goes to. We could how ever identify them apart by there address, oh unless your kids come from George Forman’s house. Then you have multiple students with the same name from same house so that wouldn’t work either. So it is important when Data basing to take all these considerations in to play because when you C.R.U.D. your data you don’t want to have anomalies such as 4 Peter Griffins with no course schedule because you can’t tell any of them apart.

<snip


Good summary, and great normalization example. I don't know how many times I've had students make exactly that mistake and not test enough to catch it. A book I used to have on learning Oracle started with some guys 19th century ledger and built a database from it. It was an excellent, interesting, yet simple set of examples that showed many of the common pitfalls and gradually went from a table or two to a non-trival database with triggers and views. Someone walked off with the book after a class at some point, so I no longer have it, but real world examples like this I think are the best teachers and finding the right one is an art form.

 

 

 


Reply

yordan
Very nice summary, and thanks for the effort explaining thins which are supposed to be obvious.
SQL stands for "simple query language", so everybody forgets that it has concepts, syntax and rules.

Reply

nikhil
Thankx that tutorial was really very useful ... but I have a problem that has not been taken here
I want to do practice on my PC
For that i want to setup up a server on my pc for that I am using SUN ONE SERVER 6.1 developer edition but i have been unable to connect it with the database....I tried with MSacess and db2(IBM database) both are SQL but both time the result was ZERO .MSaccess got connected but the out put was in some alien language and so far DB2 is concerned i was having problem in establishin the connection itself....If you know the solution please post it or send by mail to me my mail add is nikhil@icqmail.com

Reply

yordan
Some other servers are easier to setup for your PC.
Try downloading and installing easyphp.
It will install and automatically configure the web server, the database and a php environment, and phymyadmin which will help you create the dabases and their users.

Reply

Aequitas619
Thanks for the tutorial, I found it very useful. I do have one question though. How do I create random numbers with SQL? Hope its not a silly question sad.gif

Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : database information databases efficiently

  1. Some Useful Database Links. - (5)
  2. Accessing Ms Access Database From A Centralized Location? - (5)
    Hi I am a manager at a trading/wholesaling company (and have no programming background). I
    customized the Northwind sample access database to make invoices and keep accounts for my company.
    We now opening another office at a distant location. So, the order entry will be done at two
    points(we plan to use the same Access database). I am not able to figure out how to access the same
    MS Access database from two different location(as LAN can't be used). Moreover, we can't
    afford to pay huge sums to the software developers. Can intranet or uploading the database t...
  3. Space Needed For Database - (10)
    Iam assuming the information in the databases i will create will be stored in the 500 MB space i
    get, but since 500MB isn't enough iam wondering if you guys can tell me how much bytes the
    following take: Varchar(x),Tinyint,Text,date,smallint,mediumint,bigint,float.... And the rest
    present when you add/edit a row in a table. Also what are the ranges of tinyint,smallint,mediumint
    and big int...
  4. Database Access On Remote Server W/jsp - (0)
    Hello: I am new to JAVA and server-side applications and have a dumb question. I have set up
    Tomcat on my machine and created a JSP program to query an Access database using a DSN-Less
    connection. If I publish the page to a webserver and include the .MDB file will it work? I'm
    not sure exactly what needs to be packaged with my Java application to make it work. Since I
    don't have a remote server that supports .jsp I cannot really test it. I'm assuming that
    JDBC driver would be bundled with my site but not sure. Thanks!...
  5. Mysql Database Entry By Excel Sheets - (2)
    Hello .. I would like to ask if i can use use Microsoft excel files in order to make entries to
    mysql database. Thanks...
  6. Mysql Database Management - (1)
    Hi i am new, I have a problem in understanding the query decomposition in D-DB. Can anyone help me
    to understand the first question of the exercise 25.21 of Elmasri-Navath 4th edition? Consider the
    following relations: BOOKS (Book#, Primary_author, Topic, Total_stock, $price) BOOKSTORE
    (Store#, City, State, Zip, Inventory_value) STOCK (Store#, Book#, Qty) Consider a distributed
    database for a bookstore chain called National Books with 3 sites called EAST, MIDDLE, and WEST.
    Consider that BOOKS are fragmented by $price amounts into: B1:BOOK1:up to $20....
  7. Mirror My MySQL Database To Another Mysql Server - (4)
    Hi..I want to ask if its possible to automatically mirror my mysql databases into another mysql
    server?or create a small php script to do this? The reason is because, we all know that database is
    very improtant if we have dynamic website. I have my forum hosted and i want to automatically
    mirror this or backup into another mysql server(free). Like in freesql.org. So that im not afraid
    that i forgot to backup my database..also i have one central backup database. Thanks for the
    help..Im looking forward for this posibility....
  8. Integrate Access Database Onto Intranet Site - Looking to integrate access database into my intranet site (5)
    Hey guys, im new here and am looking for answers /tongue.gif" style="vertical-align:middle"
    emoid=":P" border="0" alt="tongue.gif" /> Firstly, i have designed a database using M$ access,
    it consists of multiple forms which i plan to host on an intranet website, i need to be able to add
    records directly from the form on the intranet website aswell as being able to edit/review current
    entries on forms in the database. My question is, how would i go about integrating these forms onto
    the intranet website? i plan on keeping the database and the intranet site on the s...
  9. Database - prblem with it (1)
    i have free script but it is working fine on a lot of sites i tried to use it to my web site ....i
    edit its config.php right and but my database name and my user name and password every thing right
    and when i try to install it it gives me this error can`t connect to database please choose
    file from this mobile.sql can any body help plz coz i tried huderd of times and no thing happend...
  10. Connecting To A Remote Database - (9)
    I wondered if anyone here can help. I have a database on a remote server (A). I want to access it
    through a php script on a different server C. I have allowed access on (A) in Cpanel - mysql dbases
    - Remote Access by putting the IP address of server C The host of server (A) has also whitelisted
    the IP of server C. Though I am having trouble connecting from server C which is with a different
    webhost. any ideas how to get round this? I have though of SSH forwarding, but I think this can
    only be used to connect a client - e.g. my pc to the remote server A. I do not ha...
  11. Permission Problem With Mysql Database Creation - Please Help! (8)
    I seem to have a problem with accessing my database with proper permissions. I have set the my
    database correctly giving my db username all priviliges yet i seem to be unable to even log on with
    this username with a denied access error. Any ideas on resolving this?...
  12. Databases - (2)
    How do you access databases?Even though i don't have a hosting account yet i want to think
    ahead. Please help thx, romeo123...
  13. Free Graphical Tools For Databases - (7)
    There are a lot of different free software in Internet, but I have found only couple of free
    graphical tools for database adminiatration. On another hand, MySQL is free for non commercial
    usage. That's way it will be nice to have any good free GUI for this database. I remember the
    time, when one of MySQL-Front versions was for free, but now it is opened only for testing period.
    There is also free version of Toad, which is not full Toad, but it looks also very well - However, I
    am not going to use Oracle (wchich is quite expensive commercial tool) on my desktop. The...
  14. Is It A Good Practice To Store Image Or Other Binary Files Directly In A Mysql Database - (4)
    Hello to all of you beautifull people out there, I am new to MySQL, i just wanted to know if its a
    good practice to directly store images and other binary files in a MySQL database. Any one with
    help? Thanks...
  15. Need Help In Database Auto_increment - (9)
    i am creating a game and i set when someone registers than he gets id...in "extra" i have set it to
    be "auto_increment" but whenever new player signs up he gets number bigger than 210...(my first id
    was 211,next was 212,third was 213,fourth got 214) how to set it to go from 1 to infinite? thnx...
  16. Embedded Database - Embedded Data base at client side, (7)
    Hi, Now its the era of Embedded databases, no more db servers, no more host,Because with embedded
    db you can get all those options, what you are used to get with DB Servers. Some of Embedded DB Are
    1) Cloudscape From IBM (NOW Derby from ASF) 2) HSQLDB (OpenSource) and many more Feel the power of
    EDB Cheers Arunkumar.H.G...
  17. Need Advice On Creating Online Music Database - ps - dont know anything about databases! (6)
    I need to create a database of around 1000 music albums that I can put on my site, with the ability
    to search the database according to several different criteria. Being a complete and total NOOB to
    the world of databases, can anyone point me in the direction of some software that will let me
    create a good-looking and functional database, but that isn't too complicated for me to
    use?! Sounds like a tall order I know, be grateful if anyone can help though. Thanks!
    Topic edited to reflect content better. ...
  18. The Best Database - What do you think is the best database? (48)
    Ive been planning to create a online application which requires tons of stuff from database. Ive
    been using interbase, at first it was good but after a month i find it not user friendly at all...
    Its to hard to code in php.. Can any of you guys give me a good database which is easy to use?...
  19. phpBB Database Transfer - Anyone here knows how to? (10)
    Hello, i'm a newbie in using phpBB and I still lack knowledge in mySQL database. How do I
    transfer the datas(users,configs, all of them) contained in my current forum to another one in
    phpBB? I hope someone can help, a short but detailed tutorial would be good. Example is, if I want
    to move to a new host and I want to transfer all the accounts on my old forum to the new one. Thanks
    in advance, hope anyone here knows how to....
  20. My Sql Database Help? - (3)
    Ok, i am new at web design, i dont know too much about it... I was working on a website for about
    a month this is what i got, My Web , like i said, i dont know much.. i used FrontPage and did all
    of that, my current host is AFMU which uses MySQL, but the way it is set up I dont know how to
    acquire the URL of the database or any information i dont know what it means at all.. i just want to
    do a simple login feature, i mean this is my first website and i am learning so I think it would be
    a great feature to add in and learn. i can create data bases from there but do n...
  21. Database Size? - So how big is everybody's MySQL database? (10)
    Well I know that MySQL databases can get rather big, so I was just wondering how big everybodies
    databases were? Do you have really big ones, or are they relatively small? Also what do you store in
    them? (just text, or binary data as well)...
  22. All About Databases - Info, for you! (3)
    QUOTE Hi, I noticed there were a lot of questions in all of the database topics, so i went
    around the internet using different sources, and have some information that will answer your
    questions and help you understand databases. I hope this helps, and if you have any other questions
    which arent answered below, please send a message asking. Thankyou. In computing, a database can be
    defined as a structured collection of records or data that is stored in a computer so that a program
    can consult it to answer queries. The records retrieved in answer to queries become i...
  23. Examining Databases At A Whole Glance - SQL-92 specification (7)
    Most of us using databases or doing data minings are not aware of SQL-92 specification seemingly
    these days. SQL-92 specifiaction is the SQL database query language standard. Oracle,mysql
    postgresql,mssql and DB2 - most widely recognized SQL database programs - are all closely related to
    SQL-92 specification for the use of query nevertheless how they implemented SQL-92 specification
    features inside in the program. Implementation of SQL-92 specification features are applied in the
    order of Oracle, postgresql and mysql. These databases might have specific database query...
  24. How Many Concurrent Users For Oracle Database? - This is to analyse and get perfect result for How many concurrent use (1)
    Hi friends, How many concurrent users can practically access the oracle database?
    they say tht the figure is hundreds of thousands users...is there any exact figure? or does the
    number of concurrent users depend on any other factors as wel? I think depend on parameter
    1.session 2.processes session Specific connection of a user to an Oracle instance through a user
    process. A session lasts from the time the user connects until the time the user disconnects or
    exits the database application. Multiple sessions can be created and exist concurrently for ...
  25. Database Programming In Vba 6.0 - (1)
    hi , i need some sample program in database.thanks...
  26. How Do You Make Large Databases? - (14)
    In a game I'm working on, I would like to have a database of actors/actresses. I'm not sure
    exactly how to do this. I'm pretty sure with the hosting here, I can only have 99 databases.
    I'm a little lost as to how to make it. Can all the actors/actresses be put on one database
    with the specific things I want to include (i.e. how well the do in each genre)? I'm new to
    Mysql and just need some help as to where to start....
  27. Need Info On Database Programming Courses - Oracle Database Programming (2)
    I know Database Programming on MS-ACCESS, now i am planning to go for some other Database
    Programming courses, People told me to go for Oracle or VisualAge. Can anyone told me to start with
    which one and how long is the course period and which one is easy and is it similar to ms access or
    somthig different....
  28. Ms Databases - (6)
    Hello, I can make my own MS Access database, but can anyone tell me how to make a password gate
    that checks the user info with the database? Olie122333 /biggrin.gif"
    style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" />...
  29. Can You Make Your Own MySQL Databases? - Im an idoit (7)
    Can you make your own MySQL database or do they have to be bought or found from a free site i really
    need help on this guys please reply or send me a PM when you have the time because i need so much
    help with this atm /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif"
    /> thankyou very much regards Morex Gaming owner Jarvis...
  30. Database Program With GUI - (14)
    I am looking for a program to create SQL databases through a GUI to simplify it, the only things i
    can seem to find are command prompt things and i can't work with them. I like MS access and
    would like something similar to that if possible. I am working with windows at the moment can anyone
    recommend a program i can use (preferably free) Many thanks...



Looking for database, information, databases, efficiently

Searching Video's for database, information, databases, efficiently
advertisement




What Is A Database How Do I Use One? - : Information about Databases and how to get use them efficiently



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE