www.SQLdemon.com    
  Home | Place like no other Learn | Things you should know Labs | Try what you know Stuff | Things you may need Blog | Latest things to discuss
 

Understanding the Database concept


Databases


Many people define database in different ways but by definition, a database is a collection of data stored in an organized form. Moreover, people often use the term Database to refer the software that is running and that is not correct. A day-to-day example of a database can be a file cabinet with different collection of data, reports, etc...

In addition, the software that can simulate this kind of database environment on an electronic form and manipulate data as necessary can be called a Database Management System or in short DBMS.




Tables


In relation to the example given above, this could relate to file folders that are used to store related data, and in the database world the tables are defined as a structured file that store data of a specific type.
The data stored in the tables are organized using mechanisms such normalization, and they are logically arranged in order to prevent duplicate data, and retrieve fast.

All the tables have their unique identifiers; therefore, a database cannot have more than one table with the same name but can exist in another database.

The tables also have a set of defined properties to inform what kind of data the can be stored. This can be broken down to the name of piece of information, data type, and how much data it may contain, and the relationship with the other data, etc…This is also referred as a Schema.



Columns


Table is a collection of rows and columns, and a column contains a specific piece of information within a table. In addition, this can be understood as what you see on a spreadsheet where Customer Name, Address, Phone number, is stored. The specifics can be understood as if that is a customer name it has to be only characters and cannot contain numbers and they are referred to as Data types.



Rows


Data in a table is stored as rows and each record has its own row. They are bound to follow the data types that are define by its column definition.




Primary Key


This is a very popular term in databases and it is nothing but the unique identifier within each record that used to identify the row. The records such as Employee ID, Passport number are used as primary keys in most of the scenarios. The primary key is very useful when it come to performing actions in a table since you can find the exact data to be altered, removed or extracted.

These are some guidelines in defining a primary key.

  • Two rows cannot have the same primary key value.
  • Every row should have a primary key.
  • The values in Primary keys are not modified or updated.
  • They are discarded forever in case of deleting a record from a table and made sure the same key value is not used again.