0% found this document useful (0 votes)
6 views18 pages

Activity 5

The document details the author's learning experience with database management, specifically regarding collation settings and importing CSV files into MySQL. It emphasizes the importance of using appropriate collations like utf8mb4_unicode_ci for better text handling and describes the process of efficiently importing data while avoiding duplicates. Additionally, the author shares insights on various query techniques and the ability to export query results in different formats.

Uploaded by

jfs83166
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views18 pages

Activity 5

The document details the author's learning experience with database management, specifically regarding collation settings and importing CSV files into MySQL. It emphasizes the importance of using appropriate collations like utf8mb4_unicode_ci for better text handling and describes the process of efficiently importing data while avoiding duplicates. Additionally, the author shares insights on various query techniques and the ability to export query results in different formats.

Uploaded by

jfs83166
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

Jeric J.

Dela Cruz

BSIT 3-2

ACTIVITY 5

Database and Tables Sample data


Employee

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)

Calculating Top N items per Group


(with ranking and by job_title)
Calculating Top N items per Group
(with ranking and by job_title and limit by 3)
Data Cleaning
Month-to-month computation
of Growth Rate
Month-to-month computation
of Growth Rate
Month-to-month computation
of Growth Rate
Month-to-month computation
of Growth Rate
Modeling Exponential Growth
Modeling Exponential Growth
Change month Format
Lastly, I learned many more query techniques and patterns. Also, one useful thing is that when I
query, I can export that specific output into different formats, including CSV and, of course,
SQL, and different ones.

You might also like