What is a Relational Database :
A relational database is a type of database that stores data in a structured format, using tables and relationships between them. It is called “relational” because the tables are related to each other through common columns, known as keys.
An example of a relational database is a customer database for a retail store. This database would contain multiple tables, such as a table for customers, a table for orders, and a table for products. The customer table would contain information about each customer, such as their name, address, and phone number. The orders table would contain information about each order placed by a customer, including the date of the order, the product(s) purchased, and the price. The products table would contain information about each product, including the product name, description, and price.
To create a relationship between these tables, we would use a common column that appears in each table. For example, we could use a customer ID column in each table. The customer ID in the customer table would be the same as the customer ID in the orders table, which would be the same as the customer ID in the products table. This allows us to easily link information from one table to another, based on the common customer ID.
Another example of a relational database is a library database. This database would contain tables for books, patrons, and loans. The books table would contain information about each book in the library, such as the title, author, and ISBN number. The patrons table would contain information about each patron, including their name, address, and phone number. The loans table would contain information about each book loaned out by the library, including the patron ID, book ID, and loan date.
To create a relationship between these tables, we would use common columns such as a patron ID and a book ID. The patron ID in the patrons table would be the same as the patron ID in the loans table, and the book ID in the books table would be the same as the book ID in the loans table. This allows us to easily link information from one table to another, based on the common patron ID and book ID.
In summary, a relational database is a type of database that stores data in a structured format, using tables and relationships between them. It allows us to easily link information from one table to another, based on common columns. Examples of relational databases include a customer database for a retail store and a library database.