Monday, November 30, 2009

Relationships in RDBMS

The relationship in a RDBMS refers to the relation which exists between data of one table and data of another table. There are three kinds of relationships:

1. One to One relationship: In a normalized table, preference should always be given to one-one relationship. This means that a particular column in a table should have a one-to-one relationship with the primary key. In other words, if we know the value of the column we will immediately know the value of the primary key.

2. Many to one or one to many relationship: This refers to the relation between a single primary key and many foreign keys or a single foreign key and many other primary keys. In such relationships, a table is present where each key column of the different tables are included.

3.Many to many relationship - An example of such a relationship is a supplier supplying different parts and a part being supplied by different suppliers. In such cases, a third table is created which will hold the supplier as well as the parts tables’ columns.

What is Normalization: Basics of Relational Databases

Normalization is a design procedure which provides a method for representing data and their relationships precisely in a tabular format that makes database easy to understand and operationally efficient.

Advantages of normalization -

1. Reduced data redundancy - Data redundancy means the repetition of data in a table. This is undesirable since data maintenance becomes a tedious job as more and more records are added to the table.

2.Protection against update and delete anomalies - Update and delete anomalies: The tables which are normalized will contain primary and foreign keys. To maintain data integrity and referential integrity constraints, RDBMS instructs us to insert primary key values into a table at any given point of time but foreign keys can be inserted into any table if and only if the corresponding primary key value is already existing. This helps in maintaining data integrity and referential integrity constraints.

Similarly, with delete anomalies a primary key value will be deleted unconditionally only if any dependencies does not exist for that key.

3.Smaller tables - A table will be split into many smaller tables when it is normalized

Wednesday, September 2, 2009

Any Faithful Followers?

Hi,

It has been quite sometime that i updated this blog, sorry about that!

Coders i am back in action and now i will start the series of XML and PL/SQL Tutorials.

Keep your comments coming and you can also find interesting updates on my new web technology blog and tech blog too

Next post coming in few hours :)

Saturday, April 11, 2009

Handy JavaScript Code Snippet to float a block of code

Here's a handy JavaScript Code Snippet to float a block of code, you can particularly use this piece of code to float your ad-blocks to left or right!

< div style="display:inline; padding:5px; margin:0 0 0 10px;border:1px solid #fff >

/* your business logic goes here */

< /div >

Monday, January 12, 2009

50th Post on the blog, PL/SQL code-snippets will also be a part of the blog

This is the 50th post on this blog, and i wish to convey my thanks to all the frequent visitors and extensive users of this blog.

On this occasion, i would like to mention that hereon i will also be posting some SQL & PL/SQL code snippets on this blog.

Moreover, i will also offer some tips and info for the testers, apart from the coders and developers.

I wish to expand this blog as a more generic one, rather than catering to the needs of barely the hard core programmers!

If you are also a professional programmer, or fresh graduate or even a student, you can contribute. Any handy info provided will be publisher under your name, so kindly contribute generously. It's not about contributing money, as this blog is not a commercial one, but rather an informative one!

Remember that knowledge is meant to be shared, because by sharing it, you increase it, unlike money!

I don't demand any PayPal donations, all i demand from my visitors is their patronage, and handy contributions in form of comments!

Keep visiting and keep sending me your queries and sharing your knowledge!

This is a great destination for everyone, irrespective of whether you are a professional programmer, fresher or just some who fancies reading techie stuff

Happy New Year 2009!

Wishing a very Happy and Warm New Year to everyone!

This year, I will dedicate a lot of time to this blog, and take it one step further.

Till now, there used to be posts about useful code snippets, but hereafter along with that i will also be publishing useful tips for sutdents, fresh graduates as well as professional programmers.

It is all about your dedication, programming can be boring, or it may be real fun, it's left upto you, how you really take it!!

Programming is not all about mugging up syntax!

It is pretty natural that students tend to mug up C/C++ codes & clear the examinations. However,when things come down to real life scenario, it is not possible to by-heart code snippets & survive in the IT industry.

So it is good to realize this fact that programming is not all about mugging up the syntax but rather learning how to deal with the language and how to make use of appropriate Data structures at the right time!

It may take a while for you to get accustomed to real-life programming, however once you get used to it, programming will be real fun, doesn't matter if it is C, C++, Java, PHP, Perl, Shell, Unix, SQL, PL/SQL or any other language.

C-code snippet to reverse a given number

#include < stdio.h >
#include < conio.h >

int findReverse(int number)
{
int reminder,sum=0;
while(number > 0)
{
reminder=number%10;
sum=sum*10+(reminder);
number=number/10;
}
return sum;
}
void main()
{
int number,reversenumber;
printf("Enter positive integer :");
scanf("%d",&number);
int tempnumber=number;
reversenumber=findReverse(number);
printf("The reverse Number of %d is %d\n",tempnumber,reversenumber);
}