Relational databases, SQL, and schemas

The heart of the RDBMS is the relational data model; data is expressed in rows and columns within tables. The names and types of the columns are defined up-front and are collectively called the schema. The rows represent the data stored in the RDBMS and can be accessed using a very popular language called SQL.

In the preceding tables, each account holder has two accounts, one savings account and one current account, and each has different balances. This can be expressed in RDBMS like in the example given below. Here you can see that each account holder is given a unique key (Customer_ID), which makes querying for savings or current account balance a lot easier and faster:

In these tables, the column definitions are the schemas: for instance, the schemas of both relations Current Accounts and Savings Accounts have three columns named Acc_ID, Holder_Name, and Balance_$.

When data is inserted into these relations, or tables, the RDBMS will check and ensure that the rows being inserted match the schema and also satisfy constraints that might have been specified by users.

SQL is a common syntax that works with pretty much all RDBMS and is known and used by millions of individuals, including many non-technical folks. Business analysts, sales teams, even a few CFOs know how to write SQL queries. A typical SQL query that would pull all data from a relation might look as follows:

SELECT Customer_ID, Holder_Name from 'Savings Accounts' 

SQL queries can get pretty complex, but they are a great abstraction that allows pretty much anyone in an organization to access the data they need from an RDBMS. In the days before the term big data caught on, SQL queries were the way to work with big data.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset