What is a Database Schema?

In database terms, a schema (pronounced “skee-muh” or “skee-mah”) is the organisation and structure of a database. Both schemas and schemata can be used as plural forms.

A schema contains schema objects, which could be tablescolumns, data types, views, stored procedures, relationships, primary keys, foreign keys, etc.

A database schema can be represented in a visual diagram, which shows the database objects and their relationship with each other.

Screenshot of a database schema.
A basic schema diagram representing a small three-table database.

Above is a simple example of a schema diagram. It shows three tables, along with their data types, relationships between the tables, as well as their primary keys and foreign keys.

Continue reading

Is it Pronounced “S-Q-L” or “Sequel”?

Ever since its early days, there’s confusion over how to pronounce SQL. If you’ve ever worked in a large team of SQL developers, you might’ve heard some developers pronouncing it as “S-Q-L” or “ess-que-ell” [ ˈɛs kjuː ˈɛl ] and others using “sequel” [ ˈsiːkwəl ].

And the confusion extends itself to commercial and open source products too. Any mispronunciation will extend itself to products such as SQL Server and MySQL, not to mention product tools and features such as MySQL Workbench, mysqladmin, mysqldump, and Access’s SQL view, to name a few.

Continue reading

What is SQL?

SQL is the standard language for querying data inside a relational database management system (RDBMS). It is supported by all of the major database systems, such as Microsoft Access, SQL Server, MySQL, Oracle, PostgreSQL, DB2, etc.

SQL is a relatively easy language to learn when compared to most programming languages. It is based on SQL “statements” that, at times, can resemble natural language.

For example:

SELECT CustomerName
FROM Customers
WHERE CustomerId = 1

The above SQL statement is asking the database to:

Select the value of the CustomerName column from the Customers table where the CustomerId column’s value equals 1“.

Continue reading