Database Reference
In-Depth Information
Tip
Primary Key Best Practices In addition to the rules that MariaDB enforces, several
universally accepted best practices should also be adhered to
Don't update values in primary key columns.
Don't reuse values in primary key columns.
Don't use values that might change in primary key columns. (For example, when
you use a name as a primary key to identify a supplier, you would have to change
the primary key when the supplier merges and changes its name.)
There is another important type of key called a foreign key, but we discuss that
later on in Chapter 15, “Joining
Tables.”
What Is SQL?
SQL (pronounced as the letters S-Q-L or as sequel ) is an abbreviation for
Structured Query Language. SQL is a language designed specifically for com-
municating with databases.
Unlike other languages (spoken languages such as English, or programming lan-
guages such as Java or Visual Basic), SQL is made up of very few words. This
is deliberate. SQL is designed to do one thing and do it well—provide a simple
and efficient way to read and write data from a database.
What are the advantages
of SQL?
SQL is not a proprietary language used by specific database vendors.
Almost every major DBMS supports SQL, so learning this one lan-
guage enables you to interact with just about every database you run
into.
SQL is easy to learn. The statements are all made up of descriptive
English words, and there aren't that many of them.
Despite its apparent simplicity, SQL is actually a powerful language,
and by cleverly using its language elements you can perform complex
and sophisticated database operations.
Note
DBMS-Specific SQL Although SQL is not a proprietary language and there is a stan-
dards committee that tries to define SQL syntax that can be used by all DBMSs, the
reality is that no two DBMSs implement SQL identically. The SQL taught in this topic is
specific to MariaDB (and MySQL), and while much of the language taught will be usable
with other DBMSs, do not assume complete SQL syntax portability.
 
 
Search WWH ::




Custom Search