Database Reference
In-Depth Information
Part III. Basics of Handling Data
The main point of a database is data. In PartII , you learned how to create and alter tables.
As interesting as that may have been, the data that will go in tables is essential. If you felt a
little confused when creating and altering tables in the previous chapters, it may be because
it's difficult to envision how tables and their columns will come into play with data,
without having more experience adding data.
In this part, we will explore some of the fundamental ways in which data may be entered
into a database and inserted into tables. This will be covered in Chapter6, Inserting Data .
It primarily involves the INSERT statement. The SQL statement for retrieving data from
tables is the SELECT statement, which is covered extensively in Chapter7, Selecting Data .
You've seen both of these SQL statements in use several times in the previous chapters.
However, in the next two chapters you will learn more about the various syntax and options
for each of them, and you will be given plenty of practical examples of their use.
Data often needs to be changed and sometimes deleted, so in Chapter8, Updating and De-
leting Data we'll take a look at how to update and delete data. This chapter will help you to
learn how to use the UPDATE and the DELETE statements to do these common tasks.
These are important for managing data in a database.
The final chapter of this part, Chapter9, Joining and Subquerying Data , is an advanced
one. It's not too difficult to follow, but you should definitely not rush through it. In it, you
will learn how to select data from one or more tables, and to use that data as a basis for in-
serting, selecting, updating, or deleting data in other tables. Thus, you should make sure
that you've mastered the material in the previous chapters before skipping ahead to
Chapter9 .
In each chapter of this part, there are practical examples that are used to explain the various
SQL statements and related factors. You should enter those examples into your server.
Even if you are reading this topic from a digital version on your computer, I recommend
highly that you manually type all of the SQL statements you are instructed to enter. It may
seem like a little thing, but the process of typing them will aid your learning process and
help you remember the syntax and the deviations of each SQL statement. When you make
a mistake and type something incorrectly, you'll get an error message. Deciphering error
messages is part of being a good MySQL and MariaDB developer. If you copy and paste
everything as I present it to you, you will only confirm the accuracy of the topic's ex-
amples, and you will learn only a little. It's easy to learn when you don't make any mis-
takes. It's more difficult, but you will learn more when you manually enter the SQL state-
ments and get errors and then have to determine where you went wrong.
Search WWH ::




Custom Search