Friday 6 September 2013

D1

common errors in databases 

there are many errors in databases that are common to come across these include thing like null values incorrect data types deleting fields renaming incorrectly and validation any one of these could stop your database in its tracks and all of them are easy to avoid if you concentrate on what you are putting into the database for example you could stop the database by having a column called "films" and everything messes up because you have have the database looking for the file "filmz" this is a simple mistake that could cost you dearly.

null values 

null values are when you have a field in a database that requires information to function but there is no information there the  information is equal to 0 and can not be compared to any other information an example of this is when you are signing up to a website and on this website you have to fill out your name your age and the country you live in but you only fill out the name and age the program will not let you continue because you need to fill out all of the required values.



deleting fields

if you delete a field it will cause an error and format the table because the information required will not be there this is similar to a null value this is a problem that could cause you to restart you database if you do not have a back up because of the damage it can do to the database so it is important to make sure you have back ups of the data because this way if anything goes wrong you will be able to back track a few steps instead of all the way back to the beginning 



incorrect data types

an incorrect data type can also stop your database from functioning because if you have numbers that you are calculating with and you only set there type as text then the database will not calculate those numbers this is the same as if you have numbers you are not calculating with you are just using as more of a way to track your data and you use these numbers as numbers then your database will try to calculate these numbers that are not included in the database 



validation 

validation is the rules that the computer preforms as data is being entered into the database  it will check the data against the set of rules you are able to apply these rules during the setup of the development stage of making your database but if you apply rules that are not specific enough they will not work therefore stopping your database and example of this would be on games like fifa they will match you with someone who is the same level as you this means that they take your level and put it in a database and the rule would be to group your account with other accounts with the same values on the level column 




M1

Referential integrity


Ref Integrity

from what i understand of referential integrity it is when you have all of the data required of a relation
what this does is it stops you putting any null values into the database or it will not function properly
for example when you sign up for an email account you need to fill out all of the boxes such as name and date of birth and alternative email address if any of these boxes are not filled out it will bring up an error message that will stop you from continuing with the information and will ask you to fill out the missing information and will often state "all fields are required" this means that you will need to go back and fill out the null values because if there is a null value in a database then it would not function properly




Primary key

there are different keys such as primary and foreign keys the primary keys are for keeping track of data when there is more that one piece of data that is similar for example in the library they will have multiple poppies of the same book but they still need to catalog them differently so they will use what i believe to be a bibliographic catalog this means that they will have 10 copies of Alice adventure in wonderland and these ten books will all have the same key such as ZTUE and then they will have a number so the books would go from ZTUE01 to ZTUE10 this is one of the earliest and forms of a database but using the primary keys means that you can keep track of multiples of the same data




Foreign key

the foreign key is the data that is in the columns this is the data that is used to connect the data and show the relationships between it for example on IMDB you can look at a movie and look at the actors that are in that movie and from there you can look at what others movies they have been in this is how you move from one column to another using the relationships between the foreign keys