What is Database?

12 June 2010

Simple stuff about database and how it is used.


First off, database is like a base for data. It is like a box that can contain stuff inside. It is basically a collection of data or information stored for future use. The data stored in a database are usually called records. Data can be created, edited or deleted through the use of a Database Management System.




An example of a simple database.






What are Database Management Systems? (DBMS)
A DBMS basically manages a database by providing functions to edit, create or delete records or data from a database. A good and popular example would be Microsoft Access or Oracle. If you use Microsoft Access, you can see that data is stored in a grid or table (relational database model). It is commonly known as DataGrid in some programming languages.



An example of DBMS.






How Does Data Flow?
In reality, users perform certain tasks through computers to obtain or insert data into a system. As such, there is a flow of data and it can be represented through Data Flow Diagrams (DFD) which contains of External Entity, Process and Database.

As such, DFDs show the Inputs and Outputs of data in a system or program. Data flows as input, to a process and becomes output. For example...


INPUT
A user (External Entity) requests data (Process).


OUTPUT
Data is requested from a place where data is stored (Database) to be shown to the user (External Entity).



Another example of DFD.






Database Programming
Well, database is just one big collection of data, like how you would store files in cabinets in everyday life. So what if a user needs to know only certain data in a database? Does the user need to look through each and every record in it to find what he or she wants? Nah, that's why we have programming.

Data can be managed through the use of programming languages such as Structured Query Language (SQL) for relational database models (those tables with rows and columns) which are so commonly used nowadays. By doing a query, the programmer can select and display certain data for the user, and this is how a search function can be done. SQL is also used to change values in the data and so on. With programming, databases are managed very well and gives the user many options to use the data in the database. For web databases, a common language would be MySQL with PHP.



An example of a form created through programming for users to key in data into a database.






Data Structures
This is not really database, but it does involve grouping of data so I thought I'd include this. In high-level programming languages, they have the use of Data Structures as a way of organizing or storing data for efficient use later on. This is mostly to make a mini-database concept mainly for temporary use or for varying quantities. The mini-database created is actually a variable (which will contain a group of other variables) where you can just create it out of nowhere and remove it later on if you don't use it. There are many data structures, but these are just a few simple ones.


1. List
List is basically like a real-life list. You list out some stuff and they have an order or sequence.


2. Set
A set is a group of data that has no order or sequence. The data inside the set does not duplicate and no two are the same as well.


3. Stack
A stack is just like a stack of books, where you would only start from the top of the stack. If you add in data, called Push, it will be added onto the stack. When you delete data, called Pop, the highest data or the one most recently entered will be removed. This also has an order and is also categorized as a List.








4. Queue
A queue is like how you queue up in life. When you add in a data, it will be at the back of the queue. When you remove data, the one at the front of the queue will be removed. This works like a first-come-first-serve concept.









5. Array
An array is used such as it is like rows and columns. In one row, there can be many columns. The variable acts as one row, and data can be put into many different columns from there by specifying an index. It's like different dimensions for one thing. They appear like this...

Variable[0] = "Blah"
Variable[1] = "Worst"
Variable[2] = "Hooo!"
... and so on.


For simplicity, it looks like this.


012
VariableBlahWorstHooo!








Love,
Nicholas.