MySQL has a command-line client that we will use to run SQL statements. As an exercise, we will create a new database from the ground up using the command-line client only.
You start the client from the terminal by typing the following:
~$ mysql -u root -p student mysql>
The parameter -u is the user name (root), while -p is the password (student). Normally, you wouldn’t want to type the password in cleartext like this, but we will allow it for the exercise database.
After pressing enter, you will see the mysql prompt (line 2). Then, creating a new database is as simple as:
mysql> CREATE DATABASE family
Data types
Database engines distinguish sharply between different data types. This is required in order to know how to handle the information. Determining the correct data type for a column is an essential skill for any database journalist.
There’s a big difference in how the database engine should treat dates, numbers, text or geographical locations. If you ask the database engine to compare one field to another, it is essential for it to know what kind of value it is handling.