ASior lab4


1

create login albert with password='abc'
create user albert for login albert
create login adrian with password='abc'
create user adrian for login adrian
use Northwind
grant select to adrian
grant control to albert
create login albert with password='abc'
create user albert for login albert
create login adrian with password='abc'
create user adrian for login adrian
use CJDate
grant control to albert
grant select to adrian
create login albert with password='abc'
create user albert for login albert
create login adrian with password='abc'
create user adrian for login adrian
use AdventureWorks
grant control to albert
grant select to adrian
create login albert with password='abc'
create user albert for login albert
create login adrian with password='abc'
create user adrian for login adrian
use cos
grant control to albert
grant select to adrian

select * from sys.sysusers

2

A


select UnitPrice, ProductID, Orders.ShippedDate, Quantity
from [Order Details] od
join Orders on Orders.OrderID=od.OrderID

B

select UnitPrice, ProductID, Orders.OrderID, Quantity
from [Order Details]
join Orders on Orders.OrderID=[Order Details].OrderID
where YEAR(OrderDate)=1997

C

select OrderID,Customers.CompanyName,EmployeeID,OrderDate,RequiredDate,ShippedDate,ShipVia,Freight
from Orders
join Customers on Customers.CustomerID=Orders.CustomerID

D

select UnitPrice, ProductID, s.CompanyName, Quantity
from [Order Details] od
join
(select OrderID, Customers.CompanyName
from Orders o
join Customers
on Customers.CustomerID=o.CustomerID) s
on s.OrderID=od.OrderID

E

select [Order Details].UnitPrice, [Order Details].ProductID, Orders.ShippedDate, [Order Details].Quantity
from [Order Details], Orders
where Orders.OrderID=[Order Details].OrderID

F

select UnitPrice, s.ProductName, s.CategoryName, Quantity
from [Order Details] od
join
(select ProductID, ProductName, Categories.CategoryName
from Products p
join Categories
on Categories.CategoryID=p.CategoryID) s
on s.ProductID=od.ProductID

G

select distinct Customers.CompanyName
from [Order Details], Orders, Customers, Products, Categories
where Categories.CategoryName='Beverages'

H

select distinct Employees.FirstName, Employees.LastName
from [Order Details], Orders, Employees, Products, Categories
where Categories.CategoryName='Beverages'

I

select distinct Customers.CompanyName
from Orders, Customers
where YEAR(Orders.OrderDate)=1998

J

select distinct Products.ProductName
from [Order Details], Orders, Customers, Products
where Customers.Country='USA'


Wyszukiwarka

Podobne podstrony:
Lab4 1 R4 lab41
lab4 spr
HiPUA lab4
i2 lab4
Grabowska Lab4
lab4 csproj FileListAbsolute (3)
i9g1s1 wozniak lab4 sd
lab4 srodowisko B&R
lab4
AK lab4
Kopia lab4 26810
JPPO Lab4
lab4 ZA

więcej podobnych podstron