The Simplest Way to Install SQL Server 2017 on macOS

This article we will show how to install Microsoft SQL Server 2017 on macOS, as we talk it in previous blog.

Which method we use?

Prior to SQL Server 2017, if we want to install it on macOS, a virtual machine (like Parallels Desktop) is essential. Then we can install a Windows system in it and then we install and run SQL Server.

Luckily, from SQL Server 2017, we can choose to install SQL Server on Docker containers.

How to install SQL Server on Docker?

1 What is Docker?

Docker is a platform which can make softwares to run in it. It is called a container, which is an isolated environment.

2 Download and install Docker

If you haven’t installed Docker on your Mac, the next step is to install Docker.

Go to Docker page to download the .dmg file and then double click and install it according to the instructions.

3 Run Docker and increase the memory

Run Docker as you used to run other softwares and the next step is to increase the memory. This is because the default value of Docker memory is 2 GB but SQL needs at least 3.25 GB.

I recommend we set the memory value to 4 GB.

  1. Click Docker icon on top menu of your Mac
  2. Click Preferences
  3. Set Memory under Advanced to 4 GB.

Click Apply&Restart

4 Download Microsoft SQL Server 2017

The next step is to download SQL Server 2017 from Terminal, which is an easy way.

Copy and paste the command in Terminal of your Mac:

docker pull microsoft/mssql-server-linux

Through it, the latest version of MS Server SQL can be downloaded.

5 Run a Docker image

Copy, change and paste the command in Terminal of your Mac:

docker run -d --name xxxxxxx -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=xxxx\xxxx' -p 1433:1433 microsoft/mssql-server-linux

We need to change the name and password as your own here.

This step is to run an instance of Docker image. A Docker image is a file, which is used to execute codes in a Docker container.

If you want to check, copy and paste the following command to see whether the Docker container is running:

docker ps

If it works, it will show like this:

6 Install the sql-cli command line tool

The next step is to install the sql-cli command line tool. It can allow you to run commands against your SQL Server instance.

Copy and paste the command in Terminal of your Mac:

npm install -g sql-cli

If an error happened and shows you do not have the permissions to access this file as the current user, just try add sudo in your command:

sudo npm install -g sql-cli

7 Connect to SQL Server

After sql-cli is installed, now we can connect to SQL Server using the mssql command.

mssql -u xxxxxxx -p xxxxxxx

Here xxxxxxx and xxxxxxx means your name and password.

Then you will see:


Now you’ve successfully connected to your instance of SQL Server.

Next blog we will continue our journey with SQL Server and Azure Data Studio. Maybe you will want to read more about Azure and Microsoft Learn in the previous blog.

If you are interested in or have any problems with Business Intelligence, feel free to contact me .

Or you can connect with me through my LinkedIn.

Welcome to SQL (SQL 101)

If you want to find a BI Analyst job in New Zealand, you may be not a master of Python, R, etc.

However, SQL knowledge is essential.

Here is a BI Analyst job advertisement on LinkedIn, which is a full-time role.

St John is also an accredited employer.

If you have a skill that is needed by a New Zealand accredited employer and they offer you full-time work when you are abroed, you may be able to get a Talent (Accredited Employer) Work Visa.

From the job description, we can find SQL knowledge is important.

What is SQL?

Firstly, I want to talk about Database(DB). We all know DB is a kind of software to store a large amount of data, mainly Relational DB.

Structured Query Language(SQL) is always linked with DB. SQL can be used to operate data, such as querying and updating.

The relationship between DB, data and SQL is like: DB is a plate, data is dishes on the plate and SQL is your fork.

Currently, most of the websites and Apps are based on SQL and DB.

There are several popular DB on the world, e.g., SQLite, MySQL, Postgres, Oracle and Microsoft SQL Server.

Among them, MSSQL Server is the most popular in New Zealand.

Luckily, all of them can support SQL although they have different characteristics.

It is like if you have the fork, you can operate dishes on different plates.

What is Relational DB?

A DB is composed of several tables (like tables in Excel) and tables are composed of rows and columns.

We can query and obtain some results from the DB through SQL language.

Maybe some people will be confused about: What is the difference between DB and Excel? Excel has already existed on the world, why SQL is created?

That is because DB = Tables + Relations between tables.

Tables in Excel can’t meet the data operating requirements in companies because of the complex relations between tables.

How to kick-start SQL?

After knowing the terms of SQL and Relational DB, the next step is to set up the environment with SQL Server, which we will talk in the next blog.

If you are interested in or have any problems with Business Intelligence, also feel free to contact me .

Or you can connect with me through my LinkedIn.

How Business Intelligence is Making the World a Better Place

What is Business Intelligence(BI)?

In general, BI refers to that companies slice and dice data to look for patterns. Then they make business decisions by the data insights.

When I ask other people this question: Do you know what is Business Intelligence?

I usually got the answer “No”.

However, I found most of people know what is Big Data. Of course, this is a buzzword.

Even those people who are not familiar with this area, they can tell me Big Data means the data is big…

This is a good thing. Even sometimes our understanding for terms is not precise.

It is common because a glossary consists of many knowledge systems.

It is hard to explain it in one sentence.

For example, Business Intelligence is a professional area, including ETL, Data Warehousing, etc. You can’t explain all of them to others.

Simply, BI is a pipeline which can transform data into information and then it creates business value.

How can we create business value using BI?

Reporting, which is common in New Zealand.

Reporting means using data visualisation techniques to visualise company’s business data.

It mainly focuses on finance, supply chain, marketing and human source departments.

For example, sales and marketing department cares about sales amount, order quantity, return rate, etc.

Then BI can be used to filter and extract analysis results. Tables and figures differ according to their subjects and they relate to each other.

Analysis about “abnormal” data.

Through data visualisation results, the abnormal data means some data indicators are beyond our predictions.

Sometimes it is positive that we are pursuing.

For example, average user registration amount is 1000 per month.

However, we find one month the number reaches 3000.

It is a kind of positive abnormality. Of course, sometimes the abnormal data can be negative.

We can analyse which factor contributes to the abnormality through one or more dimensions data tables and figures.

Those results can help to make better business plans.

Conclusions:

BI is actually a business and management area.

It comes from the presentation of visual analysis reports. Then it tries to find business problems (positive or negative) to improve business operations.

BI jobs in New Zealand:

According to Business Analyst on careernz website, BI analyst is in high demand and its salary is $81K-$104K per year.

Many companies hire BI analysts in New Zealand, including:

  1. Government departments or tertiary universities/institutes
  2. Finance companies
  3. Marketing companies
  4. Professional firms such as law and accounting

Next blog I will talk about which techniques are popular in New Zealand and how to learn them.

If you are interested in or have any problems with Business Intelligence, feel free to contact me.

Or you can connect with me through my LinkedIn.

How I Join Business Intelligence / Data Analysis Career(Academia)

Before February 2018: My Bachelor Degree

After I completed my bachelor degree of Information Security in Xidian University and experience in Huawei, I start to look for a new challenge.

Then I came to New Zealand to study the Master of Computer and Information Sciences in AUT.

February 2018 – July 2018: Selected Courses

In the first semester of my master degree, I enrolled in two papers: Data Mining and Machine Learning, Natural Language Processing.

The two courses have assisted me in broadening my knowledge while showing me the diverse research side of Computer Sciences, especially Machine Learning and Artificial Intelligence.

July 2018 – December 2018: Master Thesis

Then I enrolled in the 120 points thesis in the second semester.

The thesis research of my Master degree is totally a different challenge to me.

It differs from previous teaching courses because its requirements of the abilities of critical thinking and problem-solving are much stricter.

Moreover, research is also an iterative procedure, so patience and persistence are also essential when it comes with persistent failure.

Luckily, I met my primary supervisor and second supervisor, who guided and helped me a lot.

In 14th November (my birthday day) last year, my primary supervisor suggested me to apply for the Summer Research Award at AUT, which can further augment to my capabilities.

Summer Research Award is awarded to students who have got satisfactory results in the three-month project in AUT. The evaluation is based on the final data analysis report. Only 10 students in the Faculty of Computer Sciences can get the award.

December 2018 – February 2019: Summer Research Award

Then I applied for it and my proposal got approved.

Through three months, I successfully classified and achieved a 92% accuracy result by building a neural network model in this project.

In the last week of February this year, I developed creative contents as academic reports with online LaTeX Editor (Overleaf) to get my final payment.

I recommend the Summer Research Award in AUT, because not only it can bring you some extra gains and honour, but also it can offer you an opportunity to gain some practical skills.

The most important thing is that I start to realise I am more interested in practical industry rather than academia!

Attachment is the Summer Research Award I gained.

February 2019 – July 2019: Two Publications

I also developed my research and analytical skills while publishing two papers

  • “An automated privacy information detection approach for protecting individual online social network users” to the Japanese Society of Artificial Intelligence (JSAI) journal
  • “Privacy Information Classification: A Hybrid Approach” to The 4th International Workshop on Smart Simulation and Modelling for Complex Systems (SSMCS 2019)

Maybe some people think I should take a PhD degree to enhance my research skills. However, I am not interested in academia any more.

New Journey:

It is time for me to continue my journey and gain more experience in the industry of Business Intelligence and Data Science industry!

If you are interested about New Zealand University, selecting papers, Summer Research Award, or how to publish papers on journals or international conferences, feel free to contact me and I can give you some suggestions.

Or you can connect with me through my LinkedIn.

Three Importance Of Life-long Learning In Programming

A person with a life-long learning ability will become more competitive.

There are two factors contributing to the summary sentence above: human life expectancy and the high changing speed of the world

Human Life Expectancy

Here is a figure about life expectancy in China from 1960 to 2016.

From the figure, it is an indisputable fact that the average life expectancy is still prolonged. Unlike the previous generation, it seems the current millennial generation will need to face a hundred-year-old life.

Such a long life will cause the working years be longer too.

The High Changing Speed Of The World

Here comes another factor: this is a world that is changing at a high speed. 

What would it look like when a world that is changing at a high speed?

The most obvious fact is that some skills suddenly became something worthless, e.g., handwriting. A person who can handwrite beautifully may get a good job in the past, but now he/she can’t because of the cheap price of a printer. 

Another strong evidence is the rise of the Human Development Index(HDI). The HDI figure from 1980 to 2014 in China is demonstrated below.

From the curve, there is a tendency to be on an exponential rise.

Thus, from the facts we show above, this world is actually more and more cruel to many people. 

Too many peers have stopped early, and they have been left behind by the times, so they are at a loss early. 

The only way you can survive on the long life road that is not the same as your guess is to keep learning.

Keep learning is a significant skill. 

Whereas, massive people are exploded to a phenomenon called ‘Information Anxiety‘, which means some of them may suffer from the feeling of anxiety because of the excessive quantity of daily information[1].

Thus, many actions have been dedicated to alleviating anxious feelings by people, e.g., purchasing expensive online courses.

Here comes an interesting and awkward truth: They may spend more money but get little knowledge.

However, people with strong self-learning skills are not anxious, at least they will not be anxious because of the learning process – this is a major difference.

I. Forward Declaration:

The forward declaration is a declaration of an identifier in the area of computer programming (denoting an entity such as a type, a variable, a constant, or a function) for which the programmer has not yet given a complete definition[2].

In schools, we can find the textbooks are very rigorous. It means any term is forbidden to use without a statement. 

So, after completing a chapter, you can learn the next chapter. If you encounter unfamiliar terms, you can find them in a previous chapter.

However, people who are accustomed to this kind of knowledge system in schools will face undesirable consequences in the society. 

Because most of the social knowledge structure is ‘Forward declaration’.  There are some examples:

  1. Why do some people always start to understand what their parents have said after many years? 
  2. Why do some people always think that their managers are just fooling them before they become managers? 
  3. Why do some people understand that investors’ reminders or suggestions are correct after his/her company goes bankrupt?

The reason is that many things are “Forward declaration” and it is very difficult to understand at that time.

The advantage of self-learning programming in this aspect is that in the process of self-learning, your learning experience is actually equivalent to a life cycle. 

So, when facing the same “Forward declaration”, you will not feel so inexplicable.

II. The programming is practical, actionable and achievable.

III. The self-learners in programming area are the most.

Trust me, you are not alone.

If you are interested in some high income skills or have any problems about self-learning and programming, feel free to contact me .

Or you can connect with me through my LinkedIn.

Reference:

[1] Wurman, R. S. (2017). Information Anxiety: Towards Understanding. Scenario Journal, 6.

[2]http://pages.cs.wisc.edu/~fischer/cs536.s07/lectures/Lecture25.4up.pdf