Oracle for Beginners: Part - 1 – Databases

KSMJKL.BLOGSPOT.COM

Oracle

You’ve probably heard the word Oracle mentioned in discussions about databases, but you possibly do not know that Oracle is a corporation. It makes software to create and manage databases – so-called Database Management Systems. That’s the DBMS acronym from way back in paragraph 1; and an RDBMS is, of course, a Relational Database Management System.

Here is tutorial for beginners  https://www.youtube.com/watch?v=XI6kbcW4w5Y

Databases

It’s time to roll up our sleeves and get our hands dirty. Go get your address book again. Remember I’d said the data in databases is organized in groups – all the names over here, the phone numbers over there, the addresses over in that other place? Well, those groupings are called tables.

Data Types

You will have noticed that we’ve got different types of data in our tables – from the PHONE_NUMBER table that contains nothing but numbers to FRIEND_NAME and ADDRESS that both contain character strings, numbers and, in the case of the ZIP CODE column, a combination of both.

The Oracle database needs to know the types of all the data you keep. (That way, for instance, if you ask it to subtract the value in the ADDRESS.CITY column from the value in the ADDRESS.HOUSE_NO column, it’ll be able to tell you that you’re crazy.) There is a long list of data types that Oracle recognizes, but we’ll only focus on the 3 main types.


NUMBER

This one’s self-explanatory. If a column is created as a NUMBER column, only numbers can be stored in it. It can be whole numbers, decimals, negative or positive.


VARCHAR2

Okay, this one’s a little weird. There’s a lot of history packed into the name of this data type; however, it’s mostly boring, so I won’t go into it. What you need to know is that it stands for Variable Character and is the data type required to store character strings, such as the data in FRIEND_NAME.FIRST_NAME, FRIEND_NAME.MIDDLE_NAME and FRIEND_NAME.LAST_NAME.

There is one interesting difference between the VARCHAR2 and NUMBER data types, and that is that you can only store numbers in NUMBER columns; however, you can record any string of alphanumeric characters in VARCHAR2 columns. For example, with its combination of numbers and letters, we cannot record ADDRESS.ZIPCODE in a NUMBER column, but we can save it as a VARCHAR2.


DATE

Another self-explanatory data type. We haven’t used any dates in our hypothetical database thus far – but we will; I’m saving that pleasure for later.

The One About Primary Keys.

I’ve got another term for you: Primary Key. A primary key is a key – a column or combination of columns – that uniquely identifies a row.

Relational Databases

We now have all the pieces of the puzzle. We can now redefine – and understand – relational databases. A Relational Database is a database in which the data is organized in tables with the relationships being maintained between the different tables.