130 likes | 260 Vues
This document provides an overview of the MSY Technology database, designed to manage product stock across nine stores in Australia. It supports the organization of computer parts inventory, detailing relationships between stock, products, branches, and categories. Key functionalities include querying product categories, generating reports on available stocks, and leveraging SQL for actions like foreign key constraints and views for specific brand and price information. This system enhances efficiency in stock management and improves customer service.
E N D
THE DATABASE OF MSY TECHNOLOGY PTY. LTD PRODUCTRonaldDiningrat High Distinction AssignmentAutumn 2007
Overview of Database • This database is designed for MSY Product Stock. • http://www.msy.com.au/Parts/PARTS.pdf • Has 9 store around Australia. • Selling computer parts • The database is used to organise the stock from all over the store • Store, Stock, Product and Product category.
ERD Stock BranchName* ProductNo* Available Product ProductNo BrandName BrandType ProductCategoryNo* Price Store BranchName Street Suburb State Postcode Tel Fax WorkingHours ProductCategory ProductCategoryNo Category Subcategory
A Simple query of a single table • List the table of product categroy
Natural join • List branch name, product no. and brand type from table stock and product
Group by • List the branch name and stock available in each store.
Sub Query • List the brand name and brand type of product that has price cheaper that ML-2010
Check Constraint CONSTRAINT State CHECK (State IN ( 'NSW', 'VIC', 'QLD', 'ACT', 'WA', 'SA', 'NT', 'TAS' ))
SQL Syntax for Actions • CONSTRAINT FKProduct FOREIGN KEY (ProductCategoryNo) REFERENCES PRODUCTCATEGORY • ON DELETE CASCADE • ON UPDATE CASCADE • CONSTRAINT FKStock2 FOREIGN KEY (ProductNo) REFERENCES PRODUCT • ON DELETE CASCADE • ON UPDATE CASCADE
Create View • Create a table contains brand and price of ASUS