A simple web app where users like my father can log their fuel and service expenses,
A simple web app where users like my father can log their fuel and service expenses,
Today I tackled one of the most annoying parts of my data: locations. Storing cities and addresses as plain text meant someone could type ‘Colombo’ or ‘Col’, and it would mess up my queries. I went deep into normalization today, creating a full location hierarchy! I set up tables for Province, District, and City, linking them all beautifully with foreign keys. Now, every station just links to a standard City ID. It was challenging to connect 3 or 4 tables deep, but knowing the data is perfectly structured and safe from typos is incredibly satisfying.
Log in to leave a comment
As I kept playing around with the schema today, I started noticing more duplicate data. The ‘Fuel Type’ was just a string everywhere, and I had mixed both service and refueling stations into one table even though they are used differently. I decided to normalize further! I broke out Fuel_Type into its own dedicated table so I could manage fuel names centrally. More importantly, I split the generic Station table into Refueling_Station and Service_Station because they handle entirely different operations. Wrapping my head around restructuring the tables and updating foreign keys was a bit of a puzzle, but my schema is starting to look much more professional and realistic now.
Log in to leave a comment
DEVLOG #2
what I worked on:
After the initial thrill of setting up my first database, I realized keeping all station details inside the refilling and service records wasn’t the best idea. If a station’s name changed, I’d have to update it in many places! So, I took my first step into database optimization. I extracted the refilling and service stations into a brand new Station table and linked them up using Foreign Keys. It was tricky getting the hang of relational data initially, but seeing how it eliminated duplicate station names felt like a massive level-up in my database design skills!
Log in to leave a comment
Today was all about setting up the data foundation for my Fuel Tracker app. For my App I wanted a mechanism to store data , so I heard about the there are systems called Database Management Systems from the antigravity as I asked to where to begin.. he said form there. And I heard that MySQL is a easily can be learned database so I chose that. So, I officially dove into SQL for the first time! I spent nearly 6 hours installing and configuring the MySQL Server and Workbench. Once the environment was ready, I successfully designed the initial schema to track fuel entries, including fields for liters, cost, and date. Seeing my first database table come to life in the Workbench was a huge win.
Log in to leave a comment