questions sql jaikishan

1
1 Prepare a report the identifies the five most expensive bicycles. The report should list the bicycles in desceding order from most expensive to lease expensive, the quantity on hand for each, and the markup percentage for each. SELECT TOP 5 [Product Table].[Product Number], [Product Table].[Selling Price], [Product Table].[Product Name], [Product Table].[Quantity on Hand],([Selling Price]-[Purchase Cost])/[Purchase Cost] AS [Profit Margin] FROM [Product Table] ORDER BY [Selling Price] DESC; SELECT TOP 5 [Product Table].[Product Number], [Product Table].[Selling Price], [Product Table].[Product Name], [Product Table].[Quantity on Hand],([Selling Price]-[Purchase Cost])/[Purchase Cost] FROM [Product Table] ORDER BY [Selling Price] DESC; Prepare a report that lists each supplier, its products, their quantities on hand, and associated reorder levels. The report should be sorted alphabetically by supplier. Within each supplier category, the products should be sorted alphabetically. SELECT [Supplier Table].[Company Name], [Product Table].[Product Name], [Product Table].[Product Number], [Product Table].[Quantity on Hand], [Product Table].[Reorder Level] FROM [Product Table], [Supplier Table] WHERE [Product Table].[Supplier Number]=[Supplier Table].[Supplier Number] ORDER BY [Supplier Table].[Company Name], [Product Table].[Product Name]; Prepare a report listing only the bicycles that are low in stock and need to reorder. The report should provide supplier information for the items identified. SELECT [Product Table].[Product Name], [Product Table].[Supplier Number], [Supplier Table].[Company Name], [Supplier Table].[Street Address], [Supplier Table].[City], [Supplier Table].[State], [Supplier Table].[ZIP Code] FROM [Product Table], [Supplier Table] WHERE [Product Table].[Supplier Number]=[Supplier Table].[Supplier Number] AND [Quantity on Hand]<=[Reorder Level] ORDER BY [Product Table].[Product Name];

Upload: akshay-tyagi

Post on 15-Jul-2015

30 views

Category:

Business


0 download

TRANSCRIPT

Page 1: Questions sql jaikishan

1 Prepare a report the identifies the five most expensive bicycles. The report should list the bicycles in

desceding order from most expensive to lease expensive, the quantity on hand for each, and the

markup percentage for each.

SELECT TOP 5 [Product Table].[Product Number], [Product Table].[Selling Price], [Product

Table].[Product Name], [Product Table].[Quantity on Hand],([Selling Price]-[Purchase Cost])/[Purchase

Cost] AS [Profit Margin]

FROM [Product Table]

ORDER BY [Selling Price] DESC;

SELECT TOP 5 [Product Table].[Product Number], [Product Table].[Selling Price], [Product

Table].[Product Name], [Product Table].[Quantity on Hand],([Selling Price]-[Purchase Cost])/[Purchase

Cost]

FROM [Product Table]

ORDER BY [Selling Price] DESC;

Prepare a report that lists each supplier, its products, their quantities on hand, and associated reorder

levels. The report should be sorted alphabetically by supplier. Within each supplier category, the

products should be sorted alphabetically.

SELECT [Supplier Table].[Company Name], [Product Table].[Product Name], [Product Table].[Product

Number], [Product Table].[Quantity on Hand], [Product Table].[Reorder Level]

FROM [Product Table], [Supplier Table]

WHERE [Product Table].[Supplier Number]=[Supplier Table].[Supplier Number]

ORDER BY [Supplier Table].[Company Name], [Product Table].[Product Name];

Prepare a report listing only the bicycles that are low in stock and need to reorder. The report should

provide supplier information for the items identified.

SELECT [Product Table].[Product Name], [Product Table].[Supplier Number], [Supplier Table].[Company

Name], [Supplier Table].[Street Address], [Supplier Table].[City], [Supplier Table].[State], [Supplier

Table].[ZIP Code]

FROM [Product Table], [Supplier Table]

WHERE [Product Table].[Supplier Number]=[Supplier Table].[Supplier Number] AND [Quantity on

Hand]<=[Reorder Level]

ORDER BY [Product Table].[Product Name];