14 Sep 2023 Martyna Sławińska 11 SQL Window Functions Exercises with Solutions In this article, we present 11 practice exercises involving SQL window functions, along with solutions and detailed explanations. SQL window functions are a powerful feature that lets us extract meaningful insights from our data easily, yet few SQL courses offer SQL window functions exercises. This makes practicing window functions quite difficult. In this article, we’ll give you 11 practice exercises that feature window functions. All exercises shown in this article come from our interactive courses Window Functions and Window Functions Practice Set. Read more 10 Aug 2023 Martyna Sławińska Advanced SQL Practice: 10 Exercises with Solutions As SQL proficiency continues to be in high demand for data professionals and developers alike, the importance of hands-on practice cannot be emphasized enough. Read on to delve into the world of advanced SQL and engage in practical exercises to enhance your skills. This article provides you with a collection of ten challenging SQL practice exercises specifically for those seeking to enhance their advanced SQL skills. The exercises cover a selection of SQL concepts and will help you refresh your advanced SQL knowledge. Read more 6 Jun 2023 Martyna Sławińska How to Use SUM() with OVER(PARTITION BY) in SQL Discover real-world use cases of the SUM() function with OVER(PARTITION BY) clause. Learn the syntax and check out 5 different examples. We use SQL window functions to perform operations on groups of data. These operations include the mathematical functions SUM(), COUNT(), AVG(), and more. Typically, you use SUM() function with GROUP BY. In this article, we will explain what SUM() with OVER(PARTITION BY) does in SQL. We’ll show you the most common use cases in real-world applications to determine the ratio of the individual row value to the total value, calculate running totals, and find a custom order total that includes discounts for certain products. Read more 8 Dec 2022 Martyna Sławińska How to Export Data From Microsoft SQL Server to a CSV File When working with data and databases, it is common to export data for further processing or transport to another database. Follow this article to learn how to export data from Microsoft SQL Server to a CSV file. In this article, we first recall what a CSV file is and why you would want to export data in this format from an MS SQL Server database. Then, we cut to the chase and export data to a CSV file using both SQL Server Management Studio (SSMS) and SQL Command Line (SQLCMD). Read more 22 Nov 2022 Martyna Sławińska How to Export Data from MySQL into a CSV File A database is a primary platform for working with data and storing data. But often, you must take your data out of the database. Read on to find out how to export data from MySQL database into a CSV file. In this article, we’ll demonstrate how to export data into a CSV file. We’ll start by introducing what a CSV file is and why we use it. Then, we’ll export data from a MySQL database into a CSV file. Read more 15 Sep 2022 Martyna Sławińska How to Import a CSV File to a MySQL Database CSV files store and transfer data between databases. Read on to find out how easy it is to work with CSV files in a MySQL database. CSV files are one of the oldest data exchange formats and are still heavily used by IT professionals from various domains. It is common for online data resources and different database software to offer their data uploads and downloads in CSV format. In this article, we’ll briefly review what a CSV file is and how to work with it. Read more 11 Nov 2021 Martyna Sławińska What Are Aggregate Functions in SQL, and How Do I Use Them? Data is your source of knowledge. And thanks to SQL aggregate functions, you can extract the precise knowledge you need from your data efficiently. Read along to find out more. The core SQL aggregate functions are the following: COUNT(column_name | *) returns the number of rows in a table. SUM(column_name) returns the sum of the values of a numeric column. AVG(column_name) returns the average value of a numeric column. Read more 29 Sep 2021 Martyna Sławińska Why Use Primary Keys and Foreign Keys in Databases? Relational databases organize data in a standardized manner. All data is entered into tables, the so-called relations. The tables are linked with one another to create connections between the data. The backbone of any relational database is the primary and foreign keys. Read along to find out why they are so important. In this article, we focus on the reasons why relational databases use primary and foreign keys. First, we review what primary and foreign keys are. Read more 12 Aug 2021 Martyna Sławińska An Overview of MS SQL Server Data Types SQL Server data types define what can be stored in a column, local variable, expression, or parameter. It is essential to pick the right data type. Ultimately. your choice of data types affects the whole database. Read on to learn about all of the data types available in MS SQL Server. In this article, we’ll cover numerical, text, and date and time data type categories in detail. We’ll go through their syntax, storage size, and typical use cases. Read more 7 Jul 2021 Martyna Sławińska Primary Key vs. Unique Key: Explaining the Differences When designing a database, we often need to decide between defining a primary key vs. a unique key. Both of them are crucial during the design and further phases of a database. They allow us to uniquely identify each row, ensure the uniqueness of values in the column(s), and more. Let’s take a deep dive to learn more. This article will go through the primary and unique keys, their functions, and features. Read more «« « 1 2 3 » »»