SQL, which is short for Structured Query Language, is a database computer language designed for accessing and manipulating databases. This guide will provide a quick introduction to SQL covering basic topics to give you an overview of the language and its capabilities.
RDBMS Concepts
RDBMS stands for Relational Database Management System. This is the basis for SQL, and for modern database systems like MS-SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access. It is a structuring of data into database tables, records and fields. Each database table has rows of data consisting of one or more fields. The records stored in each table is data that has been logically grouped together, like all customer information or all order information. This organization of data into specific tables is called normalization.
What is Normalization?
Database normalization is the process of efficiently organizing data in a database. This process eliminates redundant data, for example, storing the same data in more than one table and ensures that data dependencies make sense. The benefits of this are saving space in database storage and making sure that data is stored in a logical form resulting in faster operations.
Imagine that you are responsible for keeping track of all the books being checked out of a library. You could use a single table to track all the critical information such as name, address, phone, book title and due date to name a few. This single table meets the basic need to keep track of who has checked out which book, but does have some serious flaws in terms of efficiency, space required, and maintenance time.
For example, as voracious reader Bob checks out more books over time, you will have to re-enter all of his contact information for every book each time. To re-enter Bob’s contact information wastes time, and increases the opportunity for error. Also, when an update is necessary like a change of address or phone number, each of Bob’s records must be located and corrected. If one of Bob’s records has a different phone number from the rest, is it a correction, a record overlooked during the last update, or a data-entry mistake?Many of these issues are avoided by dividing the information into multiple tables with the goal of having “a place for everything, and everything in its place.” Each piece of information should appear just once, simplifying data maintenance and decreasing the storage space required.
Schema
A schema is a logical database object holder. A database schema of a database system is its structure described in a formal language supported by the database management system. In simpler terms, schema is a container for database objects. It's a convention to help you better organize your tables.