In previous sections, we have described what databases are, what the parts of a database are, and what the types of databases are. But how do you interact with a database? How do you add, change, or delete data?
There are two ways to connect to a database.
1. Command Shell:
Command-shells come in many different forms. Some can be quite simple, while others are quite fancy, complete with graphics and icons!
2. Network Sockets:
As with computers, people, and animals, databases have a type of language. The most common language used by relational databases is SQL, or Structured Query Language.
As you may or may not know, databases are arranged in table-like structures. The columns are called fields, while the rows are called records. (See Parts of a Database for more details.) It is in these fields and records that data is stored. You can use commands in the SQL language to access and manipulate the data in the fields and records of a database.
How does SQL keep track of all of these tables? Well, SQL databases have "data dictionaries." These are merely tables that keep track of all of the data tables! You will type in the name of the table where the data you want access to is held, and the database will search through its data dictionary until it comes up with your table.
When you type in a command
to an SQL database, you first must type in the name of the table you want.
Then, you can give the database the specific details that you want. The database
will search through its data dictionaries until it finds the correct piece
of data. The database will then produce a "view," or result, of
the information that you specified! It's as simple as that.
Back to Databases