Ali Mohamad Termos Trabalho Eduardo 24-08-2023

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

Ali Mohamad Termos

Trabalho Eduardo
24-08-2023

SELECT * FROM Products;

SELECT ProductID, ProductName, SupplierID, CategoryID, Unit FROM Products;

SELECT ProductID, ProductName FROM Products;

SELECT ProductID as ID, ProductName as NOME FROM Products;

SELECT ProductID, ProductName, SupplierID, CategoryID, Unit, Price, price *


productID as total FROM Products;

SELECT ProductID, ProductName, SupplierID, CategoryID, Unit, Price, price *


productID as total FROM Products
where productID < 4;

SELECT ProductID, ProductName, SupplierID, CategoryID, Unit, Price, price *


productID as total FROM Products
where productID > 4;

SELECT ProductID, ProductName, SupplierID, CategoryID, Unit, Price, price *


productID as total FROM Products
where productID = 4;

SELECT ProductID, ProductName, SupplierID, CategoryID, Unit, Price, price *


productID as total FROM Products
where productID <> 4;

SELECT ProductID, ProductName, SupplierID, CategoryID, Unit, Price, price *


productID as total FROM Products
where productID in 4;

SELECT ProductID, ProductName, SupplierID, CategoryID, Unit, Price, price *


productID as total FROM Products
where productID in(1,5,6);

SELECT ProductID, ProductName, SupplierID, CategoryID, Unit, Price, price *


productID as total FROM Products
where productName like('%Gumbo%');

SELECT ProductID, ProductName, SupplierID, CategoryID, Unit, Price, price *


productID as total FROM Products
where productName like('%Fernando%');

SELECT ProductID, ProductName, SupplierID, CategoryID, Unit, Price, price *


productID as total FROM Products
where productName like('%A%');

SELECT ProductID, ProductName, SupplierID, CategoryID, Unit, Price, price *


productID as total FROM Products
where ProductID >= 5;

SELECT ProductID, ProductName, SupplierID, CategoryID, Unit, Price, price *


productID as total FROM Products
where ProductID <= 5;

SELECT ProductID, ProductName, SupplierID, CategoryID, Unit, Price, price *


productID as total FROM Products
where ProductID = 3 or ProductId = 10;

SELECT ProductID, ProductName, SupplierID, CategoryID, Unit, Price, price *


productID as total FROM Products
where ProductID = 3 and productName like('%A%');

SELECT ProductID, ProductName, SupplierID, CategoryID, Unit, Price, price *


productID as total FROM Products
order by productName

SELECT ProductID, ProductName, SupplierID, CategoryID, Unit, Price, price *


productID as total FROM Products
order by Price desc

SELECT max(categoryId) FROM Products

SELECT min(categoryId) FROM Products

SELECT avg(categoryId) FROM Products

SELECT count(categoryId) FROM Products

SELECT sum(categoryId) FROM Products

SELECT sum(categoryId), max(categoryId), min(categoryId), count(categoryId),


avg(categoryId) FROM Products

SELECT categoryId, count(categoryId) FROM Products group by categoryId

Select P.* ,C.CategoryName ,C.Description From products P, categories C where


C.categoryId = P.categoryID

Select P.* ,C.CategoryName ,C.Description From products P, categories C where


C.categoryId = P.categoryID and C.categoryId in(3,5,7)

CREATE VIEW PRODUTOCATEGORIA AS Select P.* ,C.CategoryName ,C.Description From


products P, categories C where C.categoryId = P.categoryID and C.categoryId
in(3,5,7)

You might also like