MySQL and MariaDB are free relational databases. They run on many systems including Windows. They are very popular and simple to use.
You will need to learn a little about SQL (Structured Query Language). Examples of the MySQL commands you will need are provided in this document.
Note: Other databases can be used. Just substitute them for MySQL/MariaDB. The SQL commands may be slightly different.
Click HERE for some useful Python files.
Step 1. Install MySQL. There is plenty of documentation on the web on how to do this. It is a simple process. (see XAMPP for more information.)
Note: It may be already installed or available on another system via the network.
Step 2. Download the MySQL libraries,etc. for the language you are programming in. (Perl, Python, Jave, etc.)
Step 3. Code and test the program.
Things to consider
Windows MySQL command-line tool (Good for testing MySQL commands)
Create database
DROP DATABASE IF EXISTS phonebook; CREATE DATABASE phonebook;
Create database table
USE phonebook; CREATE TABLE info( id int not null auto_increment, firstname varchar(128), lastname varchar(128), phonenumber varchar(32), PRIMARY KEY (id) ) ENGINE=InnoDB;
Display database table information
USE phonebook; DESCRIBE info;
Enter data
USE phonebook; INSERT INTO info (firstname,lastname,phonenumber) VALUES ('firstname','lastname','phonenumber');
Return data
USE phonebook; SELECT firstname,lastname FROM info WHERE phonenumber='phonenumber'; SELECT phonenumber FROM info WHERE lastname='lastname'; SELECT * FROM info;
Java - using MySQL
Python - MySQL Connector
Add more fields to the database. (address, multiple phone numbers, ...)
Add a delete command.
Add a modify command.
What do you do if someone has more that one phone number? You create a database with two tables; one table for person information and one for phone numbers. You connect the two tables with foreign keys. Click HERE for an example.