Você está na página 1de 3

SAIC (Shanghai Automotive Industry Corporation) Motors is Chinese automotive manufacturing

company headquartered in Shanghai, China. It is the worlds largest manufacturer of 2 Wheelers as


well as the second largest two-wheelers company in India. It wants to automate the Inventory
Management System to maintain Category and product details.
1. Create the following tables and perform necessary tasks defined below:
Cateogry
CategoryID int Primary Key Identity(1001,1)
CategoryName varchar(20) unique not null
IsActive bit default 1 (0 Not Active, 1 - Active)
Product
ProductID int Primary Key Identity(10001,1)
Name varchar(50) unique not null
Colors varchar(100) default Black
Description varchar(200)
Price money check price between 25000 and 250000
CategoryID int
IsActive bit default 1 (0 Not Active, 1 - Active)
Note: All DB tables should prefix with tbl and suffix with _EmployeeID (Ex: tblProduct_432123)
and Stored Procedures prefix with usp_ and suffix with _EmployeeID (Ex:
usp_GetProducts_432123)
2. Alter Product table by adding Foreign Key constraint on CategoryID Column, which references
CategoryID Column in Category table.
3. Insert the following data in Category and Product tables.
CategoryID

ProductID
10001

CategoryName

IsActive

1001

Motor Cycle

1002

Scooter

1003

Super Bikes

Name
SBR250R

Colors
Perl

Description

Price

White, Engine Type: 162920

CategoryID
1001

IsActive
1

ProductID

Name

Colors

Description

Price

CategoryID

IsActive

Sports Red, 4 stroke, SI


CBR Repsol engine
Cylinder
capacity:
249.6cc
10002

SBUnicorn16 Geny Gray, Engine Type: 83972


0
Imperial Red Air cooled, 4
stroke,
SI
engine
Cylinder
capacity:
162.71cc

1001

10003

Walto

Sports Red,
Black, Candy
Palm Green,
Candy Jazzy
Blue

Engine Type: 56392


Air cooled, 4
stroke,
SI
engine
Cylinder
capacity:
109.20cc

1002

10004

SBActiva125 Rebel Red,


Black,
Midnight
Blue, White

Engine Type: 65135


Air cooled, 4
stroke,
SI
engine
Cylinder
capacity:
124.9cc

1002

10005

Gold Wing - Prominence Engine Type: 3113765


SB
Red,
Dual Liquid
Tone Candy Cooled,
4
stroke, 12Valve SOHC
Displacemen
t: 1832cm3

1003

b) Display the Product details of SBActiva125


c) Display total number of products available for each Category with CategoyID.
d) Display Product and Category details of each product.
e) Display the Product Details of Category Scooter
f) Create a view to display Product ID, Product Name, Description, Price, and Category Name of
active products.

g) Create a Stored Procedure to retrieve only active Category Details.


h) Create a Stored Procedure to add product details for an active category into Product table
and return the ProductID if details are stored successfully, Otherwise return 0 ( in case of any
error).
4. Design a Product class with the following fields and define Properties, Default Constructor
and Parameterised Constructors to access them.

Product ID

Name

Description

Color

Price

CategoryID

5. Design an Interface IInventoryManagement with the following members:

List<Category> GetCategoryDetails() - (Hint: Use 3g Stored Procedure)

int AddProductDetails(Product p) return Product ID (Hint: Use 3h Stored Procedure)

bool RemoveProduct(int ProductID) should not remove the product details, instead it
should update the IsActive field of that particular Product.

6. Design InventoryManagement class for SAIC Motors to implement the members of


IInventoryManagement interface.

Note: INSTRUCTIONS TO UPLOAD


Copy all SQL Script Files and C# Project File along with its .CS files to a folder, Zip the folder
and then upload it into iON.

Você também pode gostar