0% found this document useful (0 votes)
24 views

Select From Where: / Number 8

Uploaded by

Shavo Hakobyan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Select From Where: / Number 8

Uploaded by

Shavo Hakobyan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

/*

NUMBER 8
*/

SELECT OrderID, CustomerID ,ShipCountry FROM Orders

WHERE ShipCountry ='France' or ShipCountry ='Belgium'

/*
NUMBER 9
*/
SELECT OrderID, CustomerID ,ShipCountry FROM Orders

WHERE ShipCountry in('Brazil','Mexico','Argentina','Venezuela')

/*
NUMBER 10
*/
SELECT FirstName, LastName, BirthDate FROM Employees

ORDER By BirthDate

/*
NUMBER 11
*/

/* tarberak 1 */
SELECT BirthDate, CAST(BirthDate AS DATE) FROM Employees

/* Tarberak 2 */
USE [Northwind]
GO

SELECT [FirstName] +' '+ [LastName] AS [Full Name]


,CAST([BirthDate] AS date) AS [Date]
FROM [Employees]

ORDER BY BirthDate DESC

/* NUMBER 13 */
SELECT OrderID ,ProductID , UnitPrice,Quantity , TotalPrice = UnitPrice *
Quantity FROM [Order Details]

ORDER BY OrderID ,ProductID

/* NUMBER 14 */
SELECT COUNT(*) AS CountCustomer FROM Customers;

/* NUMBER 15 */

SELECT MIN(OrderDate) As FirstDate


FROM Orders

/* NUMBER 16 */
SELECT DISTINCT Country FROM Customers

WHERE Country in ( SELECT Country FROM Orders)

/* NUMBER 17 */
SELECT DISTINCT ContactTitle FROM Customers
WHERE ContactTitle in (SELECT ContactTitle FROM Employees)
ORDER BY ContactTitle DESC

/* NUMBER 18 Column 1 ? Column 2 ? */


SELECT ProductID , ProductName,CompanyName FROM Products
LEFT JOIN Suppliers
ON Suppliers.SupplierID = Products.SupplierID

/* NUMBER 19 */
SELECT OrderID ,CAST( [OrderDate] AS DATE ) AS OrderDate, CompanyName FROM
Orders
INNER JOIN Shippers ON OrderID < 10300

/* NUMBER 20 */
SELECT DISTINCT CategoryName FROM Categories
JOIN Products ON Products.CategoryID = Categories.CategoryID

You might also like