Latest Posts
Tuesday, November 23, 2021
Here are the steps:
1. Go to https://www.mongodb.com/download-center/community, then click on the "Download" button
Tuesday, November 16, 2021
One of the first thing you want to do is to connect to MongoDB so that you can run more commands.
Here is the command to connect to MongoDB
mongo --host=localhost --port=27017
All you need is the name of the host and port number, 27017 is the default port number and since we running the command on the MongoDB host, the host is localhost
Thursday, September 2, 2021
SELECT MAX(UnitPrice) AS HighestPrice, MIN(UnitPrice) AS LowestPrice FROM Products
The query above gets the highest and lowest prices for the Products table in the Northwind database

Friday, August 27, 2021
SELECT UnitPrice, ProductName FROM Products ORDER BY UnitPrice DESC, ProductName
The query above sorts the results based on the most expensive products, and then the product name. Useful if you want a secondary sort criteria. For example if there are multiple products that are $14.00 then those products will be sorted by their names after the price has been sorted.
Thursday, August 26, 2021
SELECT FirstName + ' ' + LastName AS Employee, HireDate FROM Employees WHERE DATEPART(yyyy,HireDate) = 1994
Thursday, August 19, 2021
SELECT AVG(UnitPrice) AS AveragePrice FROM Products
Thursday, August 12, 2021
- COUNT(*) count all the rows in the table including
- COUNT(column) return all the rows that contains value for the column, excluding the columns with null value
SELECT COUNT(*) AS NumberOfRows FROM Customers
Thursday, July 29, 2021
In this post we are going to create our first Entity Framework migration and creating an actual database in MySQL.
In order to do that we need to add a few NuGet packages to our Asp.Net Core project including the Entity Framework Core package. But, before we do that we want to find out what what version of .NET Core we are running. Obviously I have it memorized, but for the rest of you, you can type the command dotnet --version to figure out what the version is :) It's always a good idea to try and match the package version with the .NET Core runtime you have. It's one of the more annoying thing with Angular and Asp.Net Core, it's changing constantly. So as you can see my version 3.1.xxx so I should try to install packages that are made for 3.1.x.
The first package we are going to install is the Microsoft.EntityFrameworkCore. So open the ACMEBank.API project with Visual Studio Code. Press Ctrl+Shift+P and type NuGet and select
Tuesday, July 27, 2021
SELECT ProductName,UnitPrice FROM Products WHERE ProductName LIKE 'Chef%'
The query above returns all the records in the Products table that begins with the word "Chef"

Thursday, July 22, 2021
Thursday, July 15, 2021

The INNER JOIN functions like the WHERE clause by relating two or more tables using matching data. The difference is that the INNER JOIN is used in the FROM clause. So to the the employee's territory like the one we wrote in this blog. We would change the query into the query below to use the INNER JOIN instead of the WHERE clause.
SELECT e.FirstName + ' ' + e.LastName AS Name, t.TerritoryDescription,t.TerritoryID FROM Employees e INNER JOIN EmployeeTerritories et ON et.EmployeeID = e.EmployeeID INNER JOIN Territories t ON t.TerritoryID = et.TerritoryID
With the result:

Tuesday, July 6, 2021
SELECT EmployeeID, (FirstName + ' ' + LastName) AS Name FROM Employees WHERE EmployeeID IN (SELECT EmployeeID FROM EmployeeTerritories WHERE TerritoryID=01581)

Things You Should Know About Subqueries:
- They are not the most efficient performance wise
- You can only retrieve a single column in the subquery, retrieving multiple columns will throw an error
Thursday, June 24, 2021
SELECT COUNT(*) NumberOfProductsByCategory FROM Products GROUP BY CategoryID
The query above gives you the following results:

Thursday, June 17, 2021
Thursday, June 10, 2021
CREATE VIEW EmployeeTerritoriesDescriptions AS SELECT e.FirstName + ' ' + e.LastName AS Name, t.TerritoryDescription,t.TerritoryID FROM Employees e INNER JOIN EmployeeTerritories et ON et.EmployeeID = e.EmployeeID INNER JOIN Territories t ON t.TerritoryID = et.TerritoryID
The view above queries the employees territories using joins, by creating a view the person using the view does not have to know the underlying table structures that is in the database they can just use the view.
Sunday, June 6, 2021
Here are the steps:
- Create a folder call /data/ then create another folder call db underneath it with the mkdir command, I've already created the folder so I can't do it on the command prompt again.
Thursday, June 3, 2021
Saturday, May 29, 2021
Anyways here is how you add a dba to SQL Server 2014 on a Windows 8 machine.
1. Connect to your instance of SQL Server, then expand the "Logins" node
Friday, May 28, 2021
AdventureWorks Database Download
2. Click on the "Download" button on page
Sunday, September 8, 2019
- Click on "Server Explorer" tab in the left hand side, then click on "Add Connection"