top of page

RELATIONAL DATABASE IN SQL



Why use a database?


  • Databases let us work with large amounts of data efficiently.

  • They make updating data easy and reliable. They also help to ensure accuracy.

  • They offer security features for controlling access to information, and they help us avoid redundancy(lag).

  • A database is a structure that stores information in an organised, consistent, reliable and searchable way.

  • There are different databases for different cases used. We are here to focus on Relational databases.

What you should know?


The database gives a structure to data and defines rules that the data must follow. The data we have should be useful for something, and a database gives us the tools both to protect data and to use data to answer questions.


   Take an example, you have a restaurant, and you have a few customers regularly coming there. They support your business, and they're great for referring to new customers, so you decide you want to give them some discounts. You'll invite them to a holiday party, and once they've ordered 10 meals in your restaurant, you will offer them half off for their favorite dish.


First, you must have a list of who they are. You can write down each customer's information on a note card. You would probably have the name and email or phone number they have used to make previous reservations.


Example of a note card


For a few customers, the set of note cards is fine, but as you get more of them, it's harder to tell which of the pieces of information is missing for each customer. And it's hard to look them up to keep track of the meals they've ordered, because they're not sorted by name or by anything, and to send out invitations to the holiday party, you have to copy the information over to invitations manually by hand. That's difficult.



Here, the data is unstructured, and it can be helpful by moving it into a spreadsheet, where you can add data, and more easily work with each customer's information. Here, it's a lot easier to see gaps in the data and it becomes easier to do other things like print those party invitations.


Data stored in a spreadsheet


Here we have some of the basic structure we'll work with when using databases. We organize information about individual customers in rows, and we organize pieces of data with the same characteristics into columns, like names, email addresses, phone numbers, and so on. Rows are sometimes called records and columns are sometimes called fields. We can clearly see how the information is organized if we look back at the note cards we started with. 

Row and column in a table


One card is one record or one row, and each piece of information on the card is placed in a column of similar data. Now we can throw the cards away, because we have our data in a more structured format. In conclusion, here we discussed understanding databases and the benefits of spreadsheets when compared to unstructured data. 

Recent Posts

See All

Comments


bottom of page