Work/Life Balance – #TSQL2sday

This post is a contribution to T-SQL Tuesday! I’m excited to be here once again 🙂

This month we’re talking about Work/Life balance and I’m contributing with some things that I’ve learned along the way.

When I start thinking about the topic, work/life balance sounds as something that may be separated in two big parts: your personal challenges, and the culture of the place you work at. It’s important to be aligned with your employers culture – but only up until a point that makes sense and it’s comfortable to you.

What I mean by comfort, it’s making sure that you’re able to have your professional life and still have time for your own stuff. After all, work is only part of your life.

I work since I was 15. Since I started, I have a better idea of how to take better care of my mental and physical health. These two topics are my pillars when thinking about the balance I need. I want to be able to make decisions on my professional life, while still taking care of me along the way.

Mental health it’s still health!

There’s a big stigma that surrounds this theme. Some people are afraid to talk about it. That’s why whenever I’m having a casual conversation at work, I’ll usually tell the person that I’m currently doing therapy. I like to talk about my hobbies and things outside work. I believe that sometimes we get stuck on day to day tasks, and it’s a nice reminder for others that hey – you are also human! Also, after I open up more, others seem more encouraged to talk about their own stuff.

We need to acknowledge and be constantly remembered that we’re all people with our own outside-of-work lives.

Things that help me mentally

  • making sure I take some time-off: who does not love vacations? They’re great, but lately I’ve been more open to paying attention to my body and mind working hours. During the day, I’ll make sure to block time for high focused work when I’m most alert. I know that I don’t function before a good breakfast, and that coffee (or just taking the break!) is a perfect mood booster for my afternoons, when I’m getting tired. This leads to…
  • taking smarter breaks: this one is easier said than done. I have a hard time not leaning into social media whenever I need a break. So sometimes I’ll try to do something small like picking up snack, filling my water bottle, stretching with some guided video, reading a book’s chapter, reading an article etc.
  • never work when I’m sleepy, thirsty or hungry: this is something that I internally always felt. Then, last year I joined a conference where one of at presenters said this when she was finishing her talk, and it was like my unconscious shouting to me “I’ve been trying to warn you about this, other people feel it too!”. This is why it’s so important to pay attention to your internal body clock, knowing when you’re likely to be hungry or tired can help you better plan your day. Pro-tips: don’t be the person who schedules meetings during lunch time, people will not love you.
  • having hobbies: besides making good conversations topics, I love doing manual work like drawing, cooking, and I’ve even learned some macrame. It’s amazing how into the flow my work gets when I’m doing an activity that requires my full attention like that. Doing something that relaxes you is like giving your brain a break from the work. So that next time you have a challenge in front of you, it may be easier to think in a different way and come up with fresh new ideas.
  • meditate: I’m anxious. Most people say I look super zen. Luck for them (and me) they can’t see what goes on inside an over thinker’s head. Most of the time, I get lost in thought. It happens. I try to deal with it by acknowledging the facts – this is just a thought, that I created, or, this is just a feeling, and everything is fine, nothing will blow up. To me, meditation is not relaxing, but awareness instead. It’s an anchor that provides tools for when I’m drifting off being concerned about things that will probably never happen.
  • be open to your loved ones: with most of us working from home, it’s likely that you need to share your space with others. I try to be honest about my work and I clearly say when I’d rather not be disturbed for a couple minutes, and that maybe it’s better to start lunch without me because I’ll be late.

Taking care of your body

I’m not going to lie and say I love exercising. I wanted to be the person that wakes up at 5AM, drinks some weird green juice, gets yoga done, takes a shower and it’s ready to work before everyone else is even up! I’m not that person and I probably won’t never be.

I have a tendency to visualize this perfect scenario and then if one tiny part does not go as planned, I’ll just throw it all away. Waking up at 7AM instead of 5? I guess I won’t have time to exercise today after all… Did not exercise when I was planning to? Oh I guess it’s irrelevant to have my healthy dinner than, I’ll just have pizza again.

Because of this behaviour of mine, I need to remind me that it’s ok if I could not wake up at the right time. Or if today I have a headache that won’t allow me to move as freely as I wanted to. Sometimes I’m just not in the mood.

The important thing is doing little things. Doing the best you can do. Each day. Don’t be too hard on yourself. But also make sure you’re not being too soft, like if you were your grandma when the kids wanted something.

Some things that help me take care of my body

  • exercising, and doing so because I love my body. Try different things, eventually you will find something that will help you relax, disconnect, feel stronger even! This leads to a more positive mindset for me. Like the day I did a plank for over a minute and felt like NOBODY MOVE, I’LL FINISH THAT PROJECT TODAY.
  • eating healthy, whole, foods: I come from Brazil, and we have one of the best cuisines – not because it’s fancy, but because it’s nutritiously rich. Most people will eat good proportioned food that is home made and that should be (nutritionally) enough for our bodies. Not to mention we actually leave our computer desks and take proper breaks to eat and refill on energy. I was not someone who cooked, but apparently I like it now and I’ve learned to value more the full process. At home, we make lists of what we’ll eat during the week, then grocery shopping and sometimes we even do a meal prep so that we can freeze things. Having my lunch be frozen so that all I need is to microwave it makes me instantly happier and gives me extra free time for my lunch break, yay! (Of course this is coming from someone with no kids and I have a partner that shares this work with me so I’m speaking from my experience 🙂 ).

This is part of what helps me maintain a good work/life balance. I’m also part of a group of people at work that encourages others to be more physically active. We promote stretching and meditation weekly sessions with the team. I think that even just talking about it at work and making people see our efforts and concerns reminds them of “hey – other people are feeling the same and they care!”. Thinking of our shared human connection can have a huge impact on our work/life balance.

Special thanks to TJay for hosting this month’s theme 🙂

Do you need SQL for a data related job?

Illustrations by Camila Henrique

I wanted to talk about this because I see a lot of doubts and lack of direction from people who are either beginning now in IT land or thinking about switching careers. The short answer to “do I need to know SQL for a data job?” , is yes. In the next few paragraphs I explain why I think so.

It’s easy to get caught up in all the fancy programming languages and methodologies for projects that sometimes the basics… are just not there. I believe having a good foundation opens paths to other doors that you could not see before. And I’m certain that SQL is one hell of a foundation to have in the data land.

Data jobs have been on a hype for the past few years. There’s a lot of speculating about what a data person job is (and actually it can vary a lot). However, there is one skill that seems to endlessly haunt job descriptions. Can you spot it below?

Taken from Linkedin, July 2021

Taken from Linkedin, July 2021

Taken from Linkedin, July 2021

SQL is always on high demand for any data job. Because it’s part of our basics. And knowing your basics can help you thrive. You can learn a lot of interesting stuff about data, but in the end, you’ll most likely need to get your hands on a database at some point, and SQL is how you talk to a database (and I think that’s beautiful. Stop judging me!).

I’m working on a series of posts dedicated to people who would like to learn SQL from zero. I’ll focus on the Microsoft product, MS SQL Server. They have a version of SQL just for it, it’s called T-SQL. I hope to share my knowledge with you and perhaps help someone along the way. This is my way of giving back to the community 🙂

Any questions or suggestions, my comments are always there for you.

If you want to check out this same post in Portuguese, click here.

Event invitation – Women Techmakers Montreal

Invitation to join online event: Women Techmakers Montreal!

Hello everyone! Today’s post is an invitation to the Women Techmakers Montreal event.

Women Techmakers is a program created by Google to celebrate International Women’s Day and to highlight the talent of women in technology. This program has been in over 200 global events and seen across 52 countries. The next event will be on Saturday, March 20, 2021.

Last year, I remember being really excited to go to the event in Montreal, when COVID hit and events all over were cancelled. Luckily, the organization switched to an online event instead. It was an amazing day! Full of such inspiring women, and such a beautiful community.

This year, I wanted to: 1- let more people know about the event, and 2- get people to join the event!

Who can join?

All genders are welcome! If you’re into tech, I’m positive you’ll find a topic that will get your attention. Sign up and enjoy (:

The event is totally free and lasts the whole day (from 9AM to 6PM EST). Check out their amazing agenda.

If you’re wondering about what happened last year, check this playlist with their sessions.

Find more info on their site.

I hope to see you there!

T-SQL Tuesday – My (least) favorite SQL data type: DATE

Hello! This post is a contribution to T-SQL Tuesday. T-SQL Tuesday is a monthly blogothon where we get together and write about a different topic. March’s topic was to blog about you favorite data type, hosted by Brent Ozar.

I wrote two versions of this post. This one you’re reading in English, and this one in Portuguese.

If you work with data, you probably do not have control over all the data sources you need. What I mean, is that for example, you may receive data from different places. Perhaps it’s your job to centralize and standardize it the best you can, so that it makes sense to your team. Once you understand the data, value can be extracted from it.

When your data comes from different systems, it’s likely you will not have control over the data’s validation. For example, one of you vendors may be very specific about the data types allowed into their systems, which means when the data gets to you, you’ll see something (ideally) more structured. However, your data may also be handled by a group of fed up developers who decided they will allow everything the user wants (special attention to the the verb there being want instead of need, big difference).

Date data types are really important and used in SQL. But for humans, dates can be formatted in some ways… For example, I’m from Brazil, and the way we write our dates is different from the US.

  • Brazil: DD/MM/YYYY
  • US: MM/DD/YYYY

In SQL, your date type stores data like this: YYYY-MM-DD. No room for mistakes, right? Bam, Wrong.

Remember when I said you may have different data sources and you can’t control their data type validations? Let’s think of the following example:

  • Your clients use a 3rd part system
  • The 3rd party uses the data to do whatever it is their system does
  • They send you that data with the results of your project
  • You, a smart data person, tries to load the data into your system. Most importantly, your system is formatted with the data types you expect to receive. So, for example, if you expect a field with a date value, you’ll format your table to have a date type column.
  • Let’s use the table “ThirdPartyInfo” as an example.

Now, as should have assumed by now, your third party did not applied any data validation to the date types. Hence, you may get some crazy “dates”, like this:

  • Jan/2021
  • 03-20-18
  • 01-02-03 (where to even begin with this one?!)
  • 2022/2
  • and many others….

Here’s what happens when you try to insert something that’s not a date, into any of the date columns:

It does not matter the method you’ll use to input data to your table, you’ll get an error if you’re not passing date values to your date types columns.

How can you avoid issues like this

  • Be open to your vendor about why this is important to your data, and explain to them your tables data type. How? Documenting, the thing IT people hate most.
  • If the vendor is pushing back, talk to your superiors, and show them a scenario in which you need to spend your precious (expensive) time to fix this mishap. Enforce this could be avoided if everyone were on the page about the data types for the data you share.
  • If nothing above works, or you need a temporary solution, you could validate the data on your end too. More work upfront, but your future self will thank you for putting this effort now.

Learning it the hard way

  • Real life example: I recently had an issue that cost me a lot of time. I had received a csv I needed for reporting, and the file had a few date fields. My table, was expecting date types to come in all the fields, but I was getting errors on my data loading job.
    • I had to take a step back and find where the issue was. I thought it would be easy to find, by checking the most recent info that got into the system (this was a daily file we received), and so I started looking for the issue. My main mistake, was that I did not isolate the date column that was giving me an error. In the SQL Server, the error message was really vague, I could only tell there was a string trying to be converted to date and I had several different date fields in my table.
    • My second big mistake was fixing everything I found on the source file, and I thought was wrong and causing the issues. Spoiler alert: it wasn’t.
    • It took me some time to realize that “ISDATE” was an easy way to search for a column that is expecting a date type, but received something else instead:
In desperate times, we may be blind by stress and not think about simple things, like this.

You see that the return to that query has the string value. Now, you could apply this kind of check as a validation before you load data into your production table, and also use it to troubleshoot issues like mine.

With all that being said, I actually like the DATE data type in SQL. It works great, the real issue is that we as humanity never agreed on a single date format. Sigh. I hope this helps!

If you want you can read more about the Date types here: Date types in SQL

Would you solve my problem in a different way? Tell me how below in the comments (:

Commenting and Naming practices with T-SQL scripts

Image: https://tinyurl.com/pt8ly0ix

Do you know that feeling when you’re starting another query and this time you’re thinking “I won’t re-use this… this is a one-time thing…”. We both know you’re lying.

I said that because most of the time:

  • you’re code is reusable
  • you’re human and you forget stuff, so perhaps tomorrow you forgot something you realized how to do today
  • I’ve never seen where you keep your scripts but I bet that needs a clean up

When you’re working on something, try to picture your future self. Your older self has probably no clue about what this *really_important_2018_script* project was. Is your older/wiser version happy while reading that? I don’t think so.

If you make an effort now to be more “tidy” with your code, here’s who will be happy:

  • your future self
  • your colleagues who read your code
  • people who will take your job in the future and think “hey! this person don’t suck as much as I thought… just a little!”

How to add comments in SQL

Basically, there are two ways to add comments in SQL:

1- add “–” and start typing!

2- add “/**/” and write in between the stars.

No one is better than the other. The first option is usually for in-line smaller comment. The second it’s more for commenting out blocks of code or writing bigger comments in a way they will not be on one same line.

Initial comments

Personally, I believe comments are a good thing. It’s not something I do with every line, however, when I open a new query, I automatically add my comments.

Here’s how I like to start my scripts:

Important note: if you’re writing a stored procedure, remember to add this block of comments after your “CREATE PROCEDURE” statement. When you do so, the comment will show up when you right-click on the stored procedure and chose “Modify”. Otherwise it’s gone and saved only on your main script file.

Naming your file

Try to be descriptive when naming your file, and don’t abbreviate too much. The name you chose may seem relevant now, but again, ask yourself “is my future version hating me now?”. If the answer is yes, than chose something else.

If the script you are creating is part of a bigger project that involves other scripts, then try to start every file name with something that refers to the project itself.

For example: sp_AutomatedFinancialReports_CalculatingEmployeeSalary

Here’s what we know based on the file name:

  • sp: this is a stored procedure
  • AutomatedFinancialReports: project name that’s descriptive
  • CalculatingEmployeeSalary: this is what your specific script will do as part of the project

Avoid at all costs using “new”, “old”, “final” and relative names on your file. This is not useful long-term. If you’re creating many drafts, I’d go with versions like “v1”, “v2”, or just add the plain date to your file name. But remember this is a temporary name, and that once you figure your “v23_final_new” file, you’ll change the name accordingly. Another trick is to move your thousand drafts to a, guess what, drafts folder. The idea is that your main project folder keeps your already tested and ready to go script.

This is some basic stuff I do everyday and I hope you find it useful. Do you add something else that you’d like to share? Leave a comment (:

Want to read this post in Portuguese? Check out this link.

See you later!

Get to know me

Hello!

As my first official post on this site, I’d like to introduce myself, share what I’d like to talk about as well as my writing goals.

My name is Camila Henrique. I’m from Indaiatuba, a small city in São Paulo, Brazil. I am living in Montreal, Canada, as I’m writing this in January 2021. I’ve worked with Microsoft SQL Server since 2015. Today I’m a DBA/SQL Dev in a medium size agency. Last but not least, I speak Portuguese, English and French, and I love learning new languages.

What will I talk about?

I’ve always been someone who really appreciates having a mentor. Be that at school or work. I just find it better when someone can guide me towards good decisions. However, I also know how hard it is for people who are just beginning their professional life, to find a good mentor. I’m not by any means trying to replace that person in your life right now, but I’d like to help. So, for you, my dear beginner IT person – I will talk about first steps you can to take in your career.

If you’re into SQL, wondering about first steps, or searching about specific data things, I’ll post beginner tips and tricks that you can practice in real life.

I believe we, information technology humans, often misjudge the importance of knowing how to properly communicate with other humans. No matter what you do, I’m sure your work involves talking to other people, and well, we’re not really known for that. That’s why I want to share things I’ve learned about communication.

If you’re someone who natively speaks Portuguese, like me, I’d like to assist on your bilingual journey by posting in both Portuguese and English, so you can chose and practice as you’d like. I’d love to be part of my country’s community, as well as reaching more people with my English content.

I’m also passionate about topics that involve diversity at work, and sometimes I find it hard to talk about that in the tech field. That’s why this will be one of the topics I’ll present here.

And because I know people like “personal” stuff: I’m into yoga, I love drawing and I definitely buy more books than I read and do not recommend that (but won’t judge you either, welcome to the club!).

I hope we get to spend some wonderful time together. If you follow me, let me know about you in the comments, I’d love to make more internet friends.

See you!