I was doing some data cleaning the other day, I ran into the issue of text fields having line feeds (lf) and character returns (cr) — this creates a lot of issues when you do data import/export. I had run into this problem sometime before as well and didn’t remember what I did back then so I am putting the solution here so it can be referenced later if need be.
To solve this, you need to remove LF, CR and/or combination of both. here’s the T-SQL syntax for SQL Server to do so:
SELECT REPLACE(REPLACE(@YourFieldName, CHAR(10), ' '), CHAR(13), ' ')
if you’re using some other database system then you need to figure out how to identify CR and LF’s — in SQL Server, the Char() function helps do that and there should be something similar for the database system that you’re using.
It’s a three-step process:
- Figure out where (location) you want to work and who (company) you want to work for.
- Note the “skills” required in job Descriptions at companies in your desired location(s) > find common themes from job descriptions > Pick up those skills if you don’t have them already!
- Start Applying!
- Getting a job is a function of Number of Job Applications and your conversion rate (Offers Received/#of Job Applications). Optimizing # of Job Applications is easy — you just need to apply to as many jobs as you could. To improve conversion rate, you would need to do number of things: clear HR/Culture-fit rounds, clear TECH rounds, create a portfolio of projects to talk about, etc.
- You could also consider applying for internships to get experience. This should help you land full-time roles.
Related Answer: Paras Doshi’s answer to How do I prepare myself to be a data analyst?
VIEW QUESTION ON QUORA
If the database that you work with supports Window/Analytic functions then the chances are that you have run into SQL use-cases where you have wondered about the difference between Row_Number(), Rank() and Dense_Rank(). In this post, I’ll show you the difference:
So, let’s just run all of them together and see what the output looks like.
Here’s my query: (Thanks StackExchange!)
Row_Number() OVER (Order by Reputation desc) as RowNumber,
Rank() OVER (Order by Reputation desc) as Rank,
Dense_Rank() OVER (Order by Reputation desc) as DenseRank
Which gives the following output:
DisplayName Reputation RowNumber Rank DenseRank
-------------------- ---------- --------- ---- ---------
Hardik Mishra 9999 1 1 1
Alex 9997 2 2 2
Omnipresent 9997 3 2 2
Sergei Basharov 9993 4 4 3
Oleg Pavliv 9991 5 5 4
Jason Creighton 9991 6 5 4
Aniko 9991 7 5 4
Notlikethat 9990 8 8 5
ZeMoon 9989 9 9 6
Carl 9987 10 10 7
Note that all the functions are essentially are “ranking” your rows but there are subtle differences:
- Row_Number() doesn’t care if the two values are same and it just ranks them differently. Note row #2 and #3, they both have value 9997 but they were assigned 2 and 3 respectively.
- Rank() — Now unlike Row_Number(), Rank() would consider that the two values are same and “Rank” them with same value. Note Row #2 and #3, they both have value 9997 and so both were assigned Rank “2” — BUT notice the Rank “3” is missing! In other words, it introduces some “gaps”
- Dense_Rank() — Now Dense_Rank() is like Rank() but it doesn’t leave any gaps! Notice that the Rank “3” in the DenseRank field.
I hope this clarified the differences between these SQL Ranking functions — let me know your thoughts in the comments section
Originally published on Quora: How do I prepare myself to be a Data Analyst?
Based on how you are framing your question, it seems that you currently don’t have “Data Analysis” Background but want to build a career in this field. Here are three things you could do:
- Learn Tech Skills: You will need technical knowledge to be successful at analyzing data. SQL and Excel are a good starting point. You could do a lot with these tools — then depending on the bandwidth that you might have you could explore R. How do you learn this? Here’s a learning pathway: Learn #Data Analysis online – free curriculum ; Also search for free courses on Coursera or other platforms.
- Learn Soft/Business Skills: This is as important as tech skills (if not more!) when it comes to Data Analysis. Finding Insights from your data is half the battle, you will need to put the insights in a context/story and influence business decisions and sometimes influence business change. we know change is always hard! So your soft/business skills will be very important. Also, you will benefit a lot from learning about how to break down problems, communicate your solution by using “business” language vs tech-speak.
- Apply them (and keep improving): Now that you have picked up some tech and soft/biz skills, apply them! Get an internship, Help out a non-profit in your free time (Data Kind, Statistics Without borders, Volunteer Match are good resources to find a non-profit) and start applying your skills! It would also help you get some “Real” world experience and applying what you have learned while “learning-on-the-job” is arguably the BEST way to pick something up!
Hope that helps!
You have your SQL Server Reporting Services environment in native mode — and you want to modify the data source of a report there.
- Navigate to Report Manager.
- Navigate to the Report that you want to Manage and run it
- After the report renders, you will have a breadcrumb navigation on the top right
- Click on the Last Part of the Breadcrumb Navigation
- It should open up the “properties” section of this report
- On the properties section, you should be able to manage the data source
- Make the changes that you wanted to the data source settings of this SSRS report — and don’t forget to click “apply”
Author: Paras Doshi
I was talking with a database administrator about different categories that SQL Commands fall into — and I thought it would be great to document here. So here you go:
||Data Manipulation Language: SQL Statements that affect records in a table.
||SELECT, INSERT, UPDATE, DELETE
||Data Definition Language: SQL Statements that create/alter a table structure
||CREATE, ALTER, DROP
||Data Control Language: SQL Statements that control the level of access that users have on database objects
||Transaction Control Language: SQL Statements that help you maintain the integrity of data by allowing control over transactions
BONUS (Advance) QUESTION:
Is Truncate SQL command a DDL or DML? Please use comment section!
Author: Paras Doshi
I spend a lot of time writing SQL code — and as a reader of this blog, You might be in the same boat. So any productivity gains that we could get here could go a long way. On that note, here’s a quick productivity tip: Learn to comment/uncomment multiple lines of SQL code using keyboard shortcut.
If you are using SQL Server Management Studio, it’s “CTRL-K followed by CTRL+C” for commenting AND “CTRL+K followed by CTRL+U” for uncommenting.
If you are using some other Data Management Software tool, I am sure you can find it using their HELP section or googling around.
Either ways, these shortcuts go a long way in making you more productive! What is your favorite productivity tip?