A Basic Introduction of Database, Tables and SQL.

It seems to be the most basic thing but this post is specifically to those who have just started or want to start their career in Database Domain. When you are a novice. You have only idea about what is a Database. But in practical life how companies are actually managing it?

Let us start with the basic.

What is a Database?

Let me take you to the old days of humanity. When there was no Computer. How companies are managing their data back then. Forget about the company ask your Grand Father, How he use to manage all the accounts. The answer is simply writing it in text book. He comes in every night working hard, and wrote all his spending and earning in a notebook. He must have fully covered 10, 20 or much more notebooks in his entire life. This whole collection of his notebooks is nothing but a database. GrandPa database. Database is a repository of essential information. It can be in any format.

Now your grandpa must have wrote his work in different formats. Like in para. “I have to pay Mr. Mark an amount of $10.” Or he might write the same thing as “Mark – Pay $10”. But what should be the most appropriate way to store your data. It would be.

Name MoneyToPAy MoneyToReceive
Mark $10 0

This is a Table. For me it is much easier to read

This give us a basic idea of what is a Database and what is a table?

Now we will enter to the age where Computers. All of your Grandpa Document can be stored in a computer. He will have its own database where he will write all his daily account in details. But how? What is an interface for him to make database, to store data in it.

This is where huge companies provided their product. ORACLE, IBM, MICROSOFT. Tools which can help you create a database, create table. Store data in it. See the result when required. One of such tool is MS SQL developed by Microsoft. Oracle owns Oracle Database. They all have their own methods to work on databases but ultimately they provide you with one solution which is letting you manage you huge database in table format. Conceptually, MS SQL is no different from ORACLE or MYSQL (etc). But each have their own benefits.

What is SQL?

Structured Query Language. Now, Companies have provided us a method to store your data. But how a user is going to interact with that data. How to read or write into a table. For that purpose Structured Query Language is used(SQL). Because Microsoft named their product as MS SQL, Most people think that that SQL is related to Microsoft only. But that is not correct, even Oracle and other platforms uses SQL to work with database (Yes, a little syntax can vary but ultimately the meaning of keywords remain same for all).

So, SQL is a language which can be used to work with your Databases.

Stay Tuned, In my next post I will explain about Microsoft SQL Server.

Next Continuation(https://sqldose.wordpress.com/2016/04/10/starting-with-ms-sql-server/)

7 thoughts on “A Basic Introduction of Database, Tables and SQL.

  1. Fabian Pascal says:

    Question: As a “senior SQL programmer” with such a passion for SQL Server, I am sure you know what 3 relational operations a SQL SELECT statement consists of and what operator they combine into. Can you tell us what they are?

    Like

  2. lokesh says:

    Hi Fabian,

    After going through your blog and your profile. I am sure I will not be able to match up the DB expertise you have. I will write what I know about relational operations kindly guide me through this.

    SQL SELECT is made of three Relational Operations.

    SELECT(σ), PROJECT(∏) and JOIN(⟗).

    SELECT (σ(R)) : It is used to retrieve the rows(records) satisfying certain conditions.
    For example :

    σ(EmployeeSalary) in SQL SELECT Statement will be

    SELECT *
    FROM EMPLOYEESALARY
    WHERE Salary=1000.

    PROJECT (∏(R ) ): Sometimes We may not require all of the columns in our result. To fetch only the required attributes(Columns) SQL SELECT use PROJECT.

    ∏empname, empsalary(EMPLOYEESALARY ) This is equivalent to

    SELECT emname, empasalary
    FROM EmployeeSalary

    JOIN (Table1 ⟗ Table2) : JOIN clause in SQL SELECT is handle by JOIN relational operation.

    So if I write the below SELECT statement

    SELECT empID, empName, EmpSalary
    FROM Employee JOIN EmployeeSalary on E.empID=ES.empID
    WHERE ES.Salary>10000

    Is equivalent to below RELATIONAL OPERATION.

    ∏ empid, empname, empsalary (σ(EMPLOYEE ⟗ EmployeeSalary))

    Let me know what you think about the above explanation. Drop a link if you have any specific source to read more about it.

    Like

    • Fabian Pascal says:

      No. Cartesian product, project and restrict, which together form a join.
      The point of my comment was that most important when trying to explain SQL databases is to begin with the relational model (RDM) and put SQL in that context: what it does right and what it does wrong. Without that SQL will be misused.
      Teaching database without data and relational fundamentals causes huge problems and you should be very careful doing that, particularly to beginners who cannot tell when you are making mistakes.

      Liked by 1 person

      • Degradable says:

        Sorry but I think this is wrong. Simplicity was what the blog was about and taking a stab at relating to the non technical, the basics.
        By definition a Database is a “Structured set of Data”. It does not need therefore, to be relational, that is a feature. I would argue that the original blog made a good starting point to then go on and expand upon Enhancements to the Database including “Relational Database”.
        Note also the title “A Basic Introduction of Database, Tables and SQL”
        If the blog poster wants to expand upon the topic he has given himself scope to do that. I am afraid your post may have put someone of doing a service to others and attempting to start at the most basic level. Perhaps you mean well, but if that is the case a revision of the wording you used would be suggested.
        Blogger, I am learning all the time and like to read basic as well as more in depth. I like the use of analogies to explain things, and I believe the ability to do this very often demonstrates a strength of understanding in the areas that you have studied or worked with up to that point.

        Good on you Blogger

        Like

      • Fabian Pascal says:

        I suggest you read my blog @All Analystics and you’ll see the problems, particularly my next post. It quotes Einstein: Everything should be as simple as possible, BUT NOT SIMPLER.

        Like

Shoot Your Comments!