Ім'я файлу: Документ Microsoft Word.docx
Розширення: docx
Розмір: 183кб.
Дата: 25.04.2022
скачати
Пов'язані файли:
Курсова_управлінський_облік_Овчиннікова ОП-32.docx
Перелік засобів навчання та обладнання навчального і загального
вакцинація.docx
історія хвороби.docx
Інструкційна карта перевірка компресії.docx
Інструкційна карта (1).docx
Інструкційна карта (2).docx
Реферат на тему_ _ Залізничний транспорт України_.docx
4.5. Родина Бобові.docx
Програма корпор.docx
Політичні режими.ppt
реферат 1.doc
ІНДЗ педагогіка.docx

SELECT EmployeeID, LastName, FirstName

FROM Employees

where FirstName in ('Robert')
SELECT EmployeeID, LastName, FirstName

FROM Employees

where FirstName = ('Robert')

SELECT ProductID, ProductName, Price, Price/2 as Discount

FROM [Products]

where ProductID in ( '1', '3', '7', '9')
SELECT ProductID, ProductName, Price, Price/2 as Discount

FROM [Products]

where ProductID in ( 1, 3, 7, 9)

SELECT OrderID, CustomerID, EmployeeID, ShipperID

FROM [Orders]

where EmployeeID in ('5') OR CustomerID > 88 AND ShipperID in ('1')
SELECT OrderID, CustomerID, EmployeeID, ShipperID

FROM [Orders]

where EmployeeID = (5) OR CustomerID > 88 AND ShipperID = (1)

SELECT * FROM [Products]

where ProductID >= 64 OR SupplierID in (SELECT SupplierID FROM [Suppliers]

where SupplierName in ('Tokyo Traders'))
SELECT * FROM [Products]

where ProductID >= 64 OR SupplierID = (SELECT SupplierID FROM [Suppliers]

where SupplierName = ('Tokyo Traders'))
SELECT OrderID, LastName, FirstName FROM [Employees]

join Orders on Employees.EmployeeID = Orders.EmployeeID

SELECT * FROM [Employees] as e

left join Orders as o on e.EmployeeID = o.EmployeeID

where OrderID is null

SELECT 'Orders' as TableName, ShipperName FROM [Shippers]

union

SELECT 'Suppliers', SupplierName FROM [Suppliers]

SELECT Max(ProductID), LastName, FirstName

FROM [Employees] as e

join Products as p on e.EmployeeID = e.EmployeeID

where LastName = ('Buchanan') AND FirstName = ('Steven')
SELECT Max(OrderID), LastName, FirstName

FROM [Employees] as e

join Orders as o on e.EmployeeID = e.EmployeeID

where LastName = 'Buchanan' AND FirstName = 'Steven'

SELECT CategoryID, ProductName, Price

FROM [Products]

where Price > (SELECT Avg(Price) FROM [Products])

SELECT OrderID, Quantity*Price as Total

FROM [OrderDetails] as o

join Products as p on o.OrderDetailID = o.OrderDetailID

Group by 1

INSERT INTO [Employees]

VALUES (11, 'Gringo', 'Karl', '1990-11-05', 'EmpID11.pic', 'Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree. He joined the company as a sales representative, was promoted to sales manager and was then named vice president of sales. Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association.')

UPDATE [Employees]

SET EmployeeID = 11

where EmployeeID = (SELECT CustomerID FROM [Customers] where CustomerID in (89, 90))
UPDATE [Oders]

SET EmployeeID = 11

where CustomerID in (89, 90)

Update [Products]

Set Price = (SELECT Price*0.1 FROM [Products])

where Price = (SELECT Price FROM [Products] where Price > (SELECT Avg(Price) FROM [Products]))
Update [Products]

Set Price = Price*1.1

where Price > (SELECT Avg(Price) FROM [Products])

7 - в болке HAVING
8 – DML ______ (все ответы правильные – не верно)
9 – Truncate ____________( SELECT – не верно)



 


     
  1. Молоко


  2.  
  3. Яйца


  4.  
  5. Сыр


  6.  



 


   


     
Яркие


     
80 грн/шт


   


   


     
Тусклые


     
70 грн/шт


   


   


     
Тёмные


     
75 грн/шт


   


 


SELECT * FROM Products as pd

join Oders as o on pd.ProductID = o.ProductID

where UserID = 1

скачати

© Усі права захищені
написати до нас