The Query’s goal is :
Find the top 5 Locations
List the users who live in those top 5 Locations, alphabetized by their DisplayName
There are a LOT of ways I could write this query, but for the purpose of this post, I’m only going to contrast common table expressions (CTEs) versus temp tables:
We’re talking about a relatively … Read More →
In this article (Italian), we have already discussed Continuous Integration and DLM. We described the main reasons for putting a database under source control and for testing our databases. In this article, we are going to discuss a real scenario of SQL Server unit testing with the tSQLt framework.
What Is Unit Testing
In computer programming, unit … Read More →
Apprendre le SQL
Le SQL (Structured Query Language) est un langage permettant de communiquer avec une base de données. Ce langage informatique est notamment très utilisé par les développeurs web pour communiquer avec les données d’un site web. SQL.sh recense des cours de SQL et des explications sur les principales commandes pour lire, insérer, modifier et … Read More →
What are advantages of DBMS over traditional file based systems?
Ans: Database management systems were developed to handle the following dif?culties of typical ?le-processing systems supported by conventional operating systems.
1. Data redundancy and inconsistency
2. Dif?culty in accessing data
3. Data isolation – multiple ?les and formats
4. Integrity problems
5. Atomicity of updates
6. Concurrent access by multiple users
7. Security … Read More →
One common requirement is to create an XML structure that is based on the schema of an existing table. Let’s assume that we’ve received a request to create XML data from relevant fields in the Person.Person table, for the person having BusinessEntityID 10001. We need to gather the values from this row:
We need to … Read More →
One of the most common jokes you’ll hear when talking about the most important tasks for a Database Administrator goes like this – a DBA needs one of two things, a good backup or a good resume. It’s true. If you’re not doing backups, and ensuring that you can recover databases from those backups, you’re … Read More →
Table of Contents
Help! I’m lost!
But I don’t want to use the Brian Keller VM!
I already have MS RM set-up. What’s the minimal work I need to do to add a DB to my system?
Exercise 1 – Source Controlling your Database
Linking a Database to source-control
Exercise 2 – Getting your Database into the Continuous Integration Process
Part … Read More →
Simple Way To Use Pivot In SQL Query
This post intends to help T-SQL developers get started with PIVOT queries. Most business applications will need some sort of PIVOT queries and I am sure many of you must have come across pivoting requirements several times in the past.
Let us have a table name Invoice which has … Read More →
SQL Server’s query optimizer uses distribution statistics to determine how it’s going to satisfy your SQL query. These statistics represent the distribution of the data within a column, or columns. The Query Optimizer uses them to estimate how many rows will be returned from a query plan.
Distribution statistics are created automatically when you create an … Read More →