Turgut Tezir

CS 704

SQL

Product > $ 20

SELECT DISTINCT ([Product].[ProductName]) AS Expr1, [Product].[ItemNum]

FROM Product, Fact

WHERE ((([Fact].[CurrentBid])>20));

Expr1 / ItemNum
AC Adapter / 1232322222
Compag Preserio E1900 / 1222000022
Dell Dimension PS12XX / 1233221111
Dell Optiplex GX115 / 1200000012
Dell TXT100 Monitors / 1200333000

Product Quantity equal 4

SELECT DISTINCT ([Product].[ProductName])

FROM Fact, Product

WHERE [FACT].[Quantity]=4;

Expr1
AC Adapter
Compag Preserio E1900
Dell Dimension PS12XX
Dell Optiplex GX115
Dell TXT100 Monitors

All Cities Sell Products

SELECT [Location].[City]

FROM Fact, Location

WHERE [Fact].[LocationID]=[Location].[LocationID];

City
New Jersey
New York
New York
Brooklyn
New York

All Countries Sell Products

SELECT [Location].[Country]

FROM Fact, Location

WHERE [Fact].[LocationID]=[Location].[LocationID];

Country
USA
USA
USA
USA
USA

Less than two bids Products Name

SELECT DISTINCT ([Product].[ProductName])

FROM Product, Fact

WHERE [Fact].[NumBids]<2;

ProductName
AC Adapter
Compag Preserio E1900
Dell Dimension PS12XX
Dell Optiplex GX115
Dell TXT100 Monitors

All States Sellers are Sell Products

SELECT [Location].[State]

FROM Fact, Location

WHERE [Fact].[LocationID]=[Location].[LocationID];

State
NJ
NY
NY
NY
NY

Seller who has two bids

SELECT DISTINCT (user.FirstName), User.LastName

FROM [user], fact

WHERE fact.NumBids = 2 AND fact.SellerID = User.UserID;

UserName / LastName
Alberth12 / Dimond
Boby77 / Koko
TurgutCS704 / Tezir

Select User who bids one time

SELECT DISTINCT (User.UserName), User.LastName

FROM [user], fact

WHERE fact.NumBids = 1 AND fact.SellerID = User.UserID;

UserName / LastName
TezirCS704 / Turgut

Select User who bits 2 Times

SELECT DISTINCT (User.UserName), User.LastName

FROM [user], fact

WHERE fact.NumBids = 2 AND fact.SellerID = User.UserID;

UserName / LastName
Alberth12 / Dimond
Boby77 / Koko
TurgutCS704 / Tezir

Select the product <$300

SELECT DISTINCT ([Product].[ProductName]) AS Expr1, [Product].[ItemNum]

FROM Product, Fact

WHERE ((([Fact].[CurrentBid])<300));

Expr1 / ItemNum
AC Adapter / 1232322222
Compag Preserio E1900 / 1222000022
Dell Dimension PS12XX / 1233221111
Dell Optiplex GX115 / 1200000012
Dell TXT100 Monitors / 1200333000

Select Student Name

SELECT [Fact].StudentName

FROM Fact;

Select Student Name
StudentName
Turgut Tezir
Turgut Tezir
Turgut Tezir
Turgut Tezir
Turgut Tezir

Select Seller Last Name and Sell Items

SELECT User.LastName, User.SellerSellItems

FROM [User];

Select Seller Last Name and Sell Items
LastName / SellerSellItems
Dimond / Sell computer and accessories
Koko / Sell computer and accessories
Birld / non-applicable
Tezir / Sell computer and accessories
Turgut / Sell computer and accessories
Orphan / non-applicable
kolyp / Sell computer and accessoriese
July / Sell computer and accessories
Korea / Sell computer and accessories