Activity 5
Activity 5
Dela Cruz
BSIT 3-2
ACTIVITY 5
Sales
Users
After changing some format in the csv files and creating the employee, sales, and users tables,
before importing I got confused when I saw that the collation used was latin1_swedish_ci. I wasn’t
familiar with it and didn’t expect it to be set by default.
Collation controls how text is sorted and compared in the database. The default collation in some
MySQL setups is latin1_swedish_ci, even if you’re not using the Swedish language. It’s usually better to
use a more modern and flexible collation like utf8mb4_unicode_ci, especially if your data includes
special characters or emojis.
I also learned that we can import tables using CSV files. I already knew it was possible, but I
didn’t know how to actually do it before this activity. Learning the step-by-step process was really
helpful, especially because it makes it much easier to add large amounts of data quickly.
For example, now, I can prepare data in tools like Excel or Google Sheets, then import it directly
into the database. In that way, it's not too hard and complex to populate data at first if needed, since Excel
and Sheets have many different shortcuts and features for organizing data. Which will help me to save a
lot of time compared to manually entering records.
Another thing I learned is the option for partial import, where you can skip a number of queries
during the import process. I used to leave that setting empty because I didn’t understand what it was for.
Now I know that it’s useful when I want to skip certain rows or parts of the file, especially if I’m re-
importing data and want to avoid duplicating the first few rows. For example, if the first few queries were
already executed successfully, I don’t need to run them again. I can simply continue from a specific point
in the file, making the import process more efficient and easier to manage.
"When creating the user
table, I duplicated the
CSV file, removed some
columns, and renamed
others to username and
password. I also added
an id column with blank
values so that the auto-
increment primary key
would work. This way,
when I import the CSV
file, it only contains four
columns, and I don’t
have to make any
complex manual
changes."
Select specific column from
multiple table
Calculating Percentage of
the Total Sum
Calculating Percentage of
the Total Sum
Calculating Difference
from Min or Max Value
Calculating Difference
from Min or Max Value
Calculating Top N
items per Group
(simple)
Calculating Top N items per Group
(with ranking)