SQL for data analysis

data analysis, data analysts, data science, sql queries, relational databases, data management, aggregate functions, data analyst, data analytics, data visualization, sql projects, sql project, business analysis, sql certifications, inner join, statistical analysis, computer programming, data scientist, data scientists, big data, python programming, microsoft excel, sql databases, v, valuable insights, data structures, exploratory data analysis, general statistics, sql commands, complex queries, data model, professional certificate, structured query language, primary key, database application, spreadsheet software, full-stack web development, design intro, sql project idea, github repository

In the provided SQL query:

  • The SELECT statement is used to indicate the columns you wish to retrieve in the result set.
  • The FROM sales clause specifies the table from which the data is to be retrieved.
  • AS followed by title is an alias that gives a name to the result column for clarity

MIN() function applied to the “revenue” column, which will determine the minimum value in the “revenue” column.

minimum_revenue is the alias for the minimum value obtained using MIN().


  • This can be used to find out say city or state with minimum revenue from the given list,
  • Suppose you have sales agents revenue data then you can find out what was the minimum revenue and to which sales agent it belongs to.

MAX() function applied to the “revenue” column, which will find the maximum value in the “revenue” column.


  • Suppose you have city or country wise revenue data then you can find out from which city or country you are earning maximum revenue
  • Not only revenue it can be used on any numerical column for which you want to find the maximum value out of given set of values.

AVG() function applied to the “revenue” column, which will calculate the average value of the “revenue” column.

Average is nothing but sum of all the values of the column divided by count of the values.


  • Suppose you have revenue of all the states of a country and want to know average revenue per state then this functions can be used,
  • Another example can be of a class where you have data of all the students of a class and want to know

In the below example by dividing two columns a third column named revenue_per_agent is created out of division of revenue w.r.t num_sales_agents.


  • This division function can be used anywhere i.e. in any place where you want to find some unit economics like in above case revenue_per_agent,
  • Another example can be finding average revenue of a given set of sales of a particular product etc.

In the below example sum of two two columns i.e. sales_city1 and sales_city2 is stored in the final column known as combined_sales.


  • The two columns that you are trying to add must be of numerical type otherwise it will start throwing error.

SQL is a powerful language for data analysis, particularly for structured data in relational databases. It allows users to efficiently retrieve, aggregate, transform, and clean data, making it essential for generating statistics, data exploration, and decision-making. SQL’s performance and reproducibility, along with its ability to integrate with other tools and languages, make it a key component of data analysis workflows.

Q1. Professional certifications to learn SQL.

Ans: Refer this link to get a list of some good SQL certifications, go through the article to see what you can learn from each one and other details.
1. Learn SQL Basics for Data Science Specialization,
2. The Complete Oracle SQL Certification Course,
3. Microsoft Azure Data Fundamentals [DP-900] Full Course (Microsoft sql certification),
4. DP-203: Data Engineering on Microsoft Azure,
5. Become a Oracle SQL Certified Associate,
6. PostgreSQL 12 Associate Certification,
7. EDB 12 Associate Certification,
8. Google Data Analytics Professional Certificate (Google sql certification),
9. Microsoft Certified: Azure Database Administrator Associate (Microsoft sql certification),
10. Oracle Database SQL Exam Number: 1Z0-071 (Oracle Database SQL Certified Associate).

Q2. Some examples of relational and non-relational database products.

Some examples of relational databases are:
– PostgreSQL, MySQL, MariaDB, Oracle, SQL Server, SQLite, Microsoft Access etc.

Some examples of non-relational databases are:
– Mongodb, Cassandra, Couchbase, Graph database, Apache HBase, Neo4j, Redis, Amazon DynamoDB, Oracle NoSQL Database, CouchDB, Azure Cosmos DB etc.

Q3. Difference between relational and non-relational databases?


Q4. Application of non-relational databases?

Ans. Non-relational databases do not store data in a rule-based, tabular way. They are used for complex, unstructured data types, such as documents, media files etc.

Q5. What is relational databases?

Ans. Relational database is a better form of organising data into tables rows and columns. Data is organized in tables in such a way that one can easily join two tables and can extract relevant information.
For example if you have customer data in table_a and the purchase data in table_b, but both have a common identifier column called as customer_id then one can easily join table_a and table_b on customer_id and can get details of all the purchases done by a customer in a given time.
Benefits of having relational database is it helps in organising data easily and efficiently. Secondly, as it makes joining tables easy. So, one can get relevant hidden inside easily in case of relational data bases where information is stored in organised matter

Q6. What is big data?

Ans. In modern terminology to define big data 3Vs are considered, where three Vs are velocity variety and volume. So, big data is something where data is coming with very high velocity and of varied types in very high volumes.
Some of the examples of big data are customer behaviour data on software for example capturing each and every step a user is taking on the software starting from registration to signing in to using the software to making purchase etc.
And other example can be off capturing data of leads generated using paid advertisements. So, capturing the details of the user who clicked on ads, time, Geography, IP address and what other details are required.

Q7. What is the full form of SQL?

Ans. Structured query language is the full form of SQL.

Q8. What is primary key in database?

Ans. A primary key in a database is a unique identifier associated with each row or record of a table. This primary key makes it easy to retrieve that particular row out of millions or billions of rows and hence that is why primary key is very important.

Q9. Can we run SQL in microsoft excel or googlesheets?

Ans. Yes googlesheet do has this option i.e. it has QUERY() function which one can use to query data like we do in normal database using SQL. It’s just in googlesheet we query the data present on googlesheet – one just has to select the data and write the query that they want to perform on the data and can get the relevant result.
Refer this link for the article on how to use the query function in googlesheet.

Leave a Comment