top of page
Writer's pictureanisa mumtaz

UNDERSTANDING DATABASES IN SQL: BENEFITS OF STRUCTURED DATA


In the previous blog, we have solved one of the problems with the cards, which is to use the customer data more easily. But to track which customer has ordered which dishes and how many times is still difficult.

One way is to put all the information into a spreadsheet and insert what each customer has ordered into one column(field) or by adding one column(field) for each visit, but this is very time consuming and inconvenient like the note cards.



Imagine, if you want to find out what a customer has ordered, you will need to:

  • Dig through those column(fields)

  • Count the number of sandwiches, or burgers, or beverages each time.


You have to add data without accidentally removing what's already there. This is one of the limitations and here is where databases become even more helpful. We have to create another set of rows and columns which only contain the details about the orders.



These collections of rows and columns are called tables and they're the building blocks of databases.

  • Columns usually contain just one piece of information. So commonly, we'll split values like 'Full Names' into separate columns so we can use each piece of data they provide separately.

  • Some values, like dates, will be recorded in a slightly different way to accommodate the format that a database expects.


Following are the major features of a Database:

  • A database can contain more than one table.

  • Databases offer the ability to create relationships between tables based on rules you define.

  • The structure of tables in the database is called the schema.


If we have to add more information to both Customers and Orders tables, like a unique id_number for each row, then we can merge our orders table to our customers table and easily find out which dishes a customer has ordered.

In conclusion, in addition to providing structure for our data, a database allows us to assign certain rules to our data too. We can make sure that certain data isn't missing or that a column(field) contains only a specific type of data.




Recent Posts

See All

Comments


bottom of page