Select Businessentityid, Firstname, Middlename, Lastname From Person - Person Where Middlename Like ' (E, B) '
Select Businessentityid, Firstname, Middlename, Lastname From Person - Person Where Middlename Like ' (E, B) '
Select Businessentityid, Firstname, Middlename, Lastname From Person - Person Where Middlename Like ' (E, B) '
2) Write a query displaying the order ID, order date, and total due
from the Sales.SalesOrderHeader table. Retrieve only those rows
where the order was placed during the month of September 2005
and the total due exceeded $1,000.
========--------
SELECT SalesOrderID, OrderDate, TotalDue
FROM Sales.SalesOrderHeader
WHERE OrderDate BETWEEN '2005-09-01' AND '2005-09-30'
AND TotalDue > 1000;
SELECT FirstName
FROM Person.Person
WHERE LastName LIKE 'Ja%es';
SELECT FirstName
FROM Person.Person
WHERE LastName LIKE 'Ja_es';
=======---------
'Ja%es' -> % sign can be replaced by any number of character. Like ‘James’, ‘jammes’,
‘Jamees’ etc.
'Ja_es' -> _ sign can be replaced by only 1 character. Only return ‘James’ but not return
‘jammes’ or ‘Jamees’.
4) Write a query displaying the first name and last name from the
Person.Person table all in uppercase.
========--------
SELECT UPPER(FirstName) AS FirstName, UPPER(LastName) AS LastName
FROM Person.Person;
6) Write a query that displays the count of orders placed by year for
each customer using the Sales.SalesOrderHeader table.
======-------------
SELECT CustomerID, COUNT(*) AS CountOfSales, YEAR(OrderDate) AS OrderYear
FROM Sales.SalesOrderHeader
GROUP BY CustomerID, YEAR(OrderDate);