SlideShare a Scribd company logo
1 of 27
University of Salford
Msc(Hons) Business with Information Technologies
Data Management Module1
2010/2011




                                               Frederico Costa
                                               @00255034
                                               University of Salford Year 1

                                                                         1|Page
Introduction

HyperAV is a company inserted in the cinema and hi-tech market. In this Individual Assignment,
based on Oracle I created a Database (from now on known as DB) that could be used by this
company in order to be helpful to run and organise the business itself.
The DB includes all the stores based in London, Manchester, York, Newcastle, Cardiff and the
warehouse located in Birmingham.
It also shows useful information about sales, staff, customers, suppliers, products and stock.
For this assignment I created random names and addresses, phone numbers and products.
I would like to thank my lecturer Andrew Schofield for all the support and patience, advice and
instructions.
This Assignment is divided in Section A, Section B and Section C and this report will follow the same
structure.

LOGIN and PASSWORD

BZA764
descobreagr




SECTION A



         Entity Relationship Diagram (ERD)
                                                                             Works at
             Customer                                    Staff                                   Location
                                                                                Staffed by

    Places                                                                                      Stores
                                   Makes sale


             Is placed   Sold by                           Located at
             by
                              Is for
             Customer                                    Stock                                    Supplier
              Order                Part of

                                                            Is instance of          Supplies         Supplies

                                             Has items                   Is supplied
                                                                                                                Is supplied
                                             of                          by
                                                                              Part of                           by
                                                     Product                                   Supplier Order
                                                                              Consists of




A customer places an order in a store. It is created an order, a form is given to a customer and a staff
sells an item. (Customer_Order Table ; Customer Table; Location Table; Stock Table).

A product is chosen by a customer and is sold by a store, taken from that store. A supplier is
contacted to supply this product. A order is made by the store to the supplier, which delivers it in the


                                                                                                                          2|Page
warehouse (Birmingham) and then is sent to the store that ordered the product.( Stock Table ;
Product Table ; Supplier Table; Supplier_Order Table).

It works as a group of tables that have an incremental primary key. Various primary keys become
foreign keys in different tables.




Entity Relationship on Database




This represents the attributes and system design. All the primary keys and foreign keys are specified
by colour and the same happens with any related value (i.e. “Location_ID”).


Many staff works in a Store – a store is a workplace for many Staff

Many Customers goes to many stores – a store takes many customers



                                                                                            3|Page
A customer chooses many products – many products can be chosen by many customers

Many customers places many orders – many orders can be placed by a customer

Many stores stocks many products – many products are stocked by many stores

A Stock controller controllers many products – each product is controlled by a stock controller

A supplier supplies one and a product (each supplier supplies only one) – a product is supplied by
one and only one supplier.




This Database consists in 8 Tables.
Table 1: HYPERAV_CUSTOMER




                                                                                             4|Page
Taken from a customer form, Customers give their details to become part of the Database.

CUST_ID – Increments a customer by time order (e.g. first customer have ID 1) ;

CUST_TITLE – Identifies a customer as Mr, Mrs, Miss, Dr, Dra ;

ALL THE OTHER DATA IS RELATED WITH ADDRESS AND CONTACTS




Table 2

CUSTOMER ORDER




                                                                                           5|Page
CUST_ORDER_ID – Increments a new order made by a customer

CUST_ORDER_DATE – Indicates the date that the order was made

CUST_PAYMENT_METHOD – Shows the method used to purchase the item(s)

CUST_ORDER_NOTES – notes relative to order (e.g. Delivery)

CUST_ID – Foreign Key from CUSTOMER table

STAFF_ID – Foreign key from STAFF table




Table 3

LOCATION




                                                                      6|Page
LOCATION_ID – Gives an ID to every single store



ALL THE OTHER DATA IS RELATIVE TO ADDRESS



Table 4

PRODUCT TABLE




                                                  7|Page
PRODUCT_ID – Defines an ID to a product

PRODUCT_PRICE – Defines a price for a product

SUPPLIER_ID – Foreign Key from SUPPLIER_ID

ALL THE OTHER ARE RELATED WITH THE TYPE AND COMPANY FOR THE PRODUCT




                                                                  8|Page
Table 5

STAFF TABLE




STAFF_ID – Generates an ID for a Staff member

STAFF_SALARY – shows the salary paid for each Staff member, it varies on the Location;

LOCATION_ID – Foreign Key from LOCATION Table

ALL THE OTHER ARE RELATED TO STAFF ADDRESS




                                                                                         9|Page
Table 6

STOCK TABLE




STOCK_ID – Generates an ID for every order made by a store (or for a store) to a Supplier

CUST_ORDER_ID – Foreign Key from Customer Order Table

PRODUCT_ID – Foreign Key from Product Table

LOCATION_ID – Foreign Key from Location Table


                                                                                        10 | P a g e
Table 7

SUPPLIER TABLE




SUPPLIER_ID – Generates an ID to identify the product Supplier

ALL THE OTHER ARE RELATED TO SUPPLIER DETAILS

NOTE: Supplier table has a “one to many” relationship with the SUPPLIER_ORDER. A supplier gets
many orders but just delivers one type of product.




                                                                                    11 | P a g e
Table 8

SUPPLIER_ORDER




SUPPLIER_ORDER_ID – Generates an ID to an order from a store to a supplier

SUPPLIER_ID – Foreign Key from SUPPLIER Table

PRODUCT_ID - Foreign Key from Product Table

LOCATION_ID - Foreign Key from Location Table

SUPPLIER_ORDER_QUANTITY – shows number of items ordered to every different product. This
Stock is delivered in the Warehouse (Birmingham) to be re-sent to fulfil stock in other stores.




                                                                                       12 | P a g e
Assuptions



All the tables are populated with no more than 10 fields.

Although not all the data might be real, there are some assumptions that were made and needs to be
considered in this report.

Customer Orders

All the orders are updated until the end of October.

Products

The products are categorized in 4 groups:

TV

Mobile

Computer

Accessories

Store

There’s only a cashier per store, the other 2 (or 1 in some cases, explained in the Store’s
assumptions) are sales assistants and Supervisor, so only 1 member of staff per store makes the sale
(i.e. Simon in London).

Supplier Order

The quantity of items ordered from the suppliers depends on the sales that the company had on the
previous month. The figures in Supplier_order table determine how many items the company can
store.

Staff

Birmingham Warehouse allocates a employee to ensure all the stock transfers and deliveries.

Birmingham as been set as a store too.

Stock

The stock is updated until the end of October.

There’s a table that shows how many items can be stored.




                                                                                        13 | P a g e
Total   Stock
Stoc    _Lond                                    Stock_Newcast      StockWarehous     Stock_Manches
k       on       Stock_Cardiff   Stock_York      le                 e                 ter
97      29       3               5               10                 30                20
195     77       18              20              20                 30                30
73      40       10              3               5                  10                5
999     400      100             80              20                 300               99

        Total
Total   Room
Roo     for
m for   Stock    Total Room      Total Room      Total Room for     Total Room for    Total Room for
Stoc    Londo    for Stock       for Stock       Stock              Stock             Stock
k       n        Cardiff         York            Newcastle          Warehouse         Manchester
100     30       5               5               10                 30                20
200     80       20              20              20                 30                30
90      40       10              5               15                 10                10
1000    400      100             80              20                 300               100




This table shows that London and Manchester are bigger stores and that’s why they have more staff
and more room for stock (it doesn’t mean that the sales have to be better).




Procedures description

A customer goes to a store to buy something. The customer is helped to choose the best item for
himself by a sales assistant or Supervisor and pays on the till. The cashier check if the item is
available in the store. If it is not available it is ordered from the warehouse.

The system is updated and the Stock Controller orders the sold item from the supplier to replace the
item sold so the company can always have it’s maximum stock always available.

The customer’s order is inserted on the system and delivered (if required).The delivery is free. For
every customer is created an ID and the same is automatically done for the order too.




                                                                                            14 | P a g e
SECTION B

QUERIES




a)   Create SQL code to list all staff members and the branch at which they work.



Select * from HYPERAV_STAFF NATURAL INNER JOIN HYPERAV_LOCATION ;

In this Query it was select ‘everything’ from HYPERAV_STAFF and was used a NATURAL INNER
JOIN to relate with HYPERAV_LOCATION. This way all staff members were listed and related to its
branch.




                                                                                      15 | P a g e
QUERY PLAN




b)   Create SQL code to list all products in stock, the stock level of
each product and the total value of stock for each product.

Select PRODUCT_ID, PRODUCT_DESCRIPTION, COUNT(STOCK_ID) STOCK_LEVEL,
SUM(PRODUCT_PRICE) TOTAL_VALUE from HYPERAV_STOCK NATURAL INNER JOIN
HYPERAV_PRODUCT GROUP BY PRODUCT_ID, PRODUCT_DESCRIPTION ;


This query lists all products in stock (stock level) and total value (note that before it was shown the
ideal stock but that is business strategy, not business reality so I assumed the stock on replacing what
is sold gets stocked again, that is why the actual stock is only a re-stock of what was sold.




                                                                                            16 | P a g e
QUERY PLAN




c)   Create SQL code to display all products which are in stock at the
Manchester branch and which have a price of over £500. The output
should be sorted by price.

SELECT * FROM HYPERAV_LOCATION NATURAL INNER JOIN HYPERAV_STOCK NATURAL
INNER JOIN HYPERAV_PRODUCT WHERE LOCATION_TOWN_CITY like 'Manchester' and
PRODUCT_PRICE > 500 ORDER BY PRODUCT_PRICE

This query displays all products which are in stock at Manchester Branch with a price over £500.

Note: It could be done with this code too ‘SELECT * FROM HYPERAV_STOCK NATURAL INNER
JOIN HYPERAV_PRODUCT WHERE LOCATION_ID =2 and PRODUCT_PRICE > 500 ORDER BY
PRODUCT_PRICE’




                                                                                          17 | P a g e
QUERY PLAN




d)    Create SQL code to prompt the user for a supplier and to then
display all products which the chosen supplier offers.



SELECT * FROM HYPERAV_SUPPLIER NATURAL INNER JOIN HYPERAV_PRODUCT WHERE
SUPPLIER_ID= :ENTER_ID

This code creates a prompt that gives the opportunity to choose the SUPPLIER_ID and check all its
attributes.




                                                                                        18 | P a g e
As an example it was shown all the attributes for SUPPLIER_ID 1.



QUERY PLAN




                                                                   19 | P a g e
e)    Create SQL code to display information about each customer and the
orders that they have placed. The output should include customers that
have not placed any orders. Sort the output by the date of the order.
(Note, you should ensure that your sample data properly demonstrates
this query, i.e. that it shows customer with no orders)


SELECT * FROM HYPERAV_CUSTOMER LEFT OUTER JOIN HYPERAV_CUSTOMER_ORDER
ON HYPERAV_CUSTOMER.CUST_ID =HYPERAV_CUSTOMER_ORDER.CUST_ID ORDER BY
CUST_ORDER_DATE;

This Query shows all the customers and the orders placed by them.
This Database didn’t have a customer without orders because it was assumed that all the customers
would fill the form on the first purchase but it was created a “Test” customer, ID 21 to show that the
code is working.




                                                                                            20 | P a g e
QUERY PLAN




             21 | P a g e
SECTION C (APPLICATION BUILDER)


a)       Forms for inputting customer and customer order details




CUSTOMER FORM (Blank)

     -     To become a customer and be inserted in the system;




                                                                   22 | P a g e
CUSTOMER ORDER FORM (blank)
   - To place an order;




                              23 | P a g e
b)   A report on the products sold by the company, including an analysis
        page which show a pie chart of the different types of products.




Products sold by the company and report of turnover by product (value obtained).

The Chart cannot be shown in the actual report because it is necessary a SVG viewer and the actual
computers cannot download it (no administrator permission in computers in University) but it is
available on the Oracle Platform.




                                                                                        24 | P a g e
Conclusion



This report is expected to fulfil all the tasks from section A, B and C for this assignment and to explain
the strategy plan for this company (just about the database).

It correspond to the use of queries, input forms and reports but more utilities from an Oracle Platform
can be used such as SQL Queries, Application Builders and in a forward stage, connect databases
with MYSQL and PHP or to create Retail Databases more developed.




                                                                                              25 | P a g e
Conclusion



This report is expected to fulfil all the tasks from section A, B and C for this assignment and to explain
the strategy plan for this company (just about the database).

It correspond to the use of queries, input forms and reports but more utilities from an Oracle Platform
can be used such as SQL Queries, Application Builders and in a forward stage, connect databases
with MYSQL and PHP or to create Retail Databases more developed.




                                                                                              25 | P a g e
Conclusion



This report is expected to fulfil all the tasks from section A, B and C for this assignment and to explain
the strategy plan for this company (just about the database).

It correspond to the use of queries, input forms and reports but more utilities from an Oracle Platform
can be used such as SQL Queries, Application Builders and in a forward stage, connect databases
with MYSQL and PHP or to create Retail Databases more developed.




                                                                                              25 | P a g e

More Related Content

Similar to MSc Business with Information Technologies Data Management Module1 2010/2011 Database for HyperAV cinema company

PROCUREMENT & INVENTORY MANAGEMENT
PROCUREMENT & INVENTORY MANAGEMENTPROCUREMENT & INVENTORY MANAGEMENT
PROCUREMENT & INVENTORY MANAGEMENTZohaib Ansari
 
Inventory management
Inventory managementInventory management
Inventory managementAshfaq Umar
 
Introduction To Msbi By Yasir
Introduction To Msbi By YasirIntroduction To Msbi By Yasir
Introduction To Msbi By Yasiryasir873
 
ACCOUNTING FOR MATERIAL.pptx
ACCOUNTING FOR MATERIAL.pptxACCOUNTING FOR MATERIAL.pptx
ACCOUNTING FOR MATERIAL.pptxDaveN31
 
Distribution operations
Distribution operationsDistribution operations
Distribution operationsRush Jobsite
 
Supply chain management
Supply chain managementSupply chain management
Supply chain managementMANNU KUMAR
 
Purchase order and inventory management training
Purchase order and inventory management trainingPurchase order and inventory management training
Purchase order and inventory management trainingDSarmah
 
Gestão de stocks lingua inglesa 1
Gestão de stocks lingua inglesa 1Gestão de stocks lingua inglesa 1
Gestão de stocks lingua inglesa 1Isabel Miguel
 
Gestão de stocks língua inglesa
Gestão de stocks língua inglesaGestão de stocks língua inglesa
Gestão de stocks língua inglesaIsabel Miguel
 
Inventory Management Project
Inventory Management ProjectInventory Management Project
Inventory Management ProjectMOHD ARISH
 
Inventory management
 Inventory management Inventory management
Inventory managementN M
 
Project report inventory
Project report inventoryProject report inventory
Project report inventoryRaj Aman
 
NMIT-SUPPLY-CHAIN-MANAGEMENT-Lesson5
NMIT-SUPPLY-CHAIN-MANAGEMENT-Lesson5NMIT-SUPPLY-CHAIN-MANAGEMENT-Lesson5
NMIT-SUPPLY-CHAIN-MANAGEMENT-Lesson5Jacqueline Quek
 
NASCC_Presentation_2015 v1
NASCC_Presentation_2015 v1NASCC_Presentation_2015 v1
NASCC_Presentation_2015 v1John Schuepbach
 
Qs2 um en_05_customer_return_to_credit
Qs2 um en_05_customer_return_to_creditQs2 um en_05_customer_return_to_credit
Qs2 um en_05_customer_return_to_creditkhayer
 

Similar to MSc Business with Information Technologies Data Management Module1 2010/2011 Database for HyperAV cinema company (20)

Supply Chain Management, Basics
Supply Chain Management, BasicsSupply Chain Management, Basics
Supply Chain Management, Basics
 
PROCUREMENT & INVENTORY MANAGEMENT
PROCUREMENT & INVENTORY MANAGEMENTPROCUREMENT & INVENTORY MANAGEMENT
PROCUREMENT & INVENTORY MANAGEMENT
 
Inventory management
Inventory managementInventory management
Inventory management
 
Inventory management
Inventory managementInventory management
Inventory management
 
Inventory mgmt
Inventory mgmtInventory mgmt
Inventory mgmt
 
Introduction To Msbi By Yasir
Introduction To Msbi By YasirIntroduction To Msbi By Yasir
Introduction To Msbi By Yasir
 
ACCOUNTING FOR MATERIAL.pptx
ACCOUNTING FOR MATERIAL.pptxACCOUNTING FOR MATERIAL.pptx
ACCOUNTING FOR MATERIAL.pptx
 
Inventory types
Inventory typesInventory types
Inventory types
 
Distribution operations
Distribution operationsDistribution operations
Distribution operations
 
Ppts of odoo
Ppts of odooPpts of odoo
Ppts of odoo
 
Supply chain management
Supply chain managementSupply chain management
Supply chain management
 
Purchase order and inventory management training
Purchase order and inventory management trainingPurchase order and inventory management training
Purchase order and inventory management training
 
Gestão de stocks lingua inglesa 1
Gestão de stocks lingua inglesa 1Gestão de stocks lingua inglesa 1
Gestão de stocks lingua inglesa 1
 
Gestão de stocks língua inglesa
Gestão de stocks língua inglesaGestão de stocks língua inglesa
Gestão de stocks língua inglesa
 
Inventory Management Project
Inventory Management ProjectInventory Management Project
Inventory Management Project
 
Inventory management
 Inventory management Inventory management
Inventory management
 
Project report inventory
Project report inventoryProject report inventory
Project report inventory
 
NMIT-SUPPLY-CHAIN-MANAGEMENT-Lesson5
NMIT-SUPPLY-CHAIN-MANAGEMENT-Lesson5NMIT-SUPPLY-CHAIN-MANAGEMENT-Lesson5
NMIT-SUPPLY-CHAIN-MANAGEMENT-Lesson5
 
NASCC_Presentation_2015 v1
NASCC_Presentation_2015 v1NASCC_Presentation_2015 v1
NASCC_Presentation_2015 v1
 
Qs2 um en_05_customer_return_to_credit
Qs2 um en_05_customer_return_to_creditQs2 um en_05_customer_return_to_credit
Qs2 um en_05_customer_return_to_credit
 

More from Frederico Costa

Dynamic Web Development Report by Frederico Costa
Dynamic Web Development Report by Frederico CostaDynamic Web Development Report by Frederico Costa
Dynamic Web Development Report by Frederico CostaFrederico Costa
 
Accounting assignment frederico costa
Accounting assignment frederico costaAccounting assignment frederico costa
Accounting assignment frederico costaFrederico Costa
 
Corporate Strategy Assignment 1 by Frederico Costa
Corporate Strategy Assignment 1 by Frederico CostaCorporate Strategy Assignment 1 by Frederico Costa
Corporate Strategy Assignment 1 by Frederico CostaFrederico Costa
 
Trade unions assignment by Frederico Costa
Trade unions assignment by Frederico CostaTrade unions assignment by Frederico Costa
Trade unions assignment by Frederico CostaFrederico Costa
 
Frederico costa project management
Frederico costa project managementFrederico costa project management
Frederico costa project managementFrederico Costa
 

More from Frederico Costa (8)

Individual report mdp
Individual report mdpIndividual report mdp
Individual report mdp
 
Dynamic Web Development Report by Frederico Costa
Dynamic Web Development Report by Frederico CostaDynamic Web Development Report by Frederico Costa
Dynamic Web Development Report by Frederico Costa
 
Accounting assignment frederico costa
Accounting assignment frederico costaAccounting assignment frederico costa
Accounting assignment frederico costa
 
Corporate Strategy Assignment 1 by Frederico Costa
Corporate Strategy Assignment 1 by Frederico CostaCorporate Strategy Assignment 1 by Frederico Costa
Corporate Strategy Assignment 1 by Frederico Costa
 
Trade unions assignment by Frederico Costa
Trade unions assignment by Frederico CostaTrade unions assignment by Frederico Costa
Trade unions assignment by Frederico Costa
 
Zara segmentation by
Zara segmentation byZara segmentation by
Zara segmentation by
 
Advwebdesign report
Advwebdesign reportAdvwebdesign report
Advwebdesign report
 
Frederico costa project management
Frederico costa project managementFrederico costa project management
Frederico costa project management
 

Recently uploaded

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Recently uploaded (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

MSc Business with Information Technologies Data Management Module1 2010/2011 Database for HyperAV cinema company

  • 1. University of Salford Msc(Hons) Business with Information Technologies Data Management Module1 2010/2011 Frederico Costa @00255034 University of Salford Year 1 1|Page
  • 2. Introduction HyperAV is a company inserted in the cinema and hi-tech market. In this Individual Assignment, based on Oracle I created a Database (from now on known as DB) that could be used by this company in order to be helpful to run and organise the business itself. The DB includes all the stores based in London, Manchester, York, Newcastle, Cardiff and the warehouse located in Birmingham. It also shows useful information about sales, staff, customers, suppliers, products and stock. For this assignment I created random names and addresses, phone numbers and products. I would like to thank my lecturer Andrew Schofield for all the support and patience, advice and instructions. This Assignment is divided in Section A, Section B and Section C and this report will follow the same structure. LOGIN and PASSWORD BZA764 descobreagr SECTION A Entity Relationship Diagram (ERD) Works at Customer Staff Location Staffed by Places Stores Makes sale Is placed Sold by Located at by Is for Customer Stock Supplier Order Part of Is instance of Supplies Supplies Has items Is supplied Is supplied of by Part of by Product Supplier Order Consists of A customer places an order in a store. It is created an order, a form is given to a customer and a staff sells an item. (Customer_Order Table ; Customer Table; Location Table; Stock Table). A product is chosen by a customer and is sold by a store, taken from that store. A supplier is contacted to supply this product. A order is made by the store to the supplier, which delivers it in the 2|Page
  • 3. warehouse (Birmingham) and then is sent to the store that ordered the product.( Stock Table ; Product Table ; Supplier Table; Supplier_Order Table). It works as a group of tables that have an incremental primary key. Various primary keys become foreign keys in different tables. Entity Relationship on Database This represents the attributes and system design. All the primary keys and foreign keys are specified by colour and the same happens with any related value (i.e. “Location_ID”). Many staff works in a Store – a store is a workplace for many Staff Many Customers goes to many stores – a store takes many customers 3|Page
  • 4. A customer chooses many products – many products can be chosen by many customers Many customers places many orders – many orders can be placed by a customer Many stores stocks many products – many products are stocked by many stores A Stock controller controllers many products – each product is controlled by a stock controller A supplier supplies one and a product (each supplier supplies only one) – a product is supplied by one and only one supplier. This Database consists in 8 Tables. Table 1: HYPERAV_CUSTOMER 4|Page
  • 5. Taken from a customer form, Customers give their details to become part of the Database. CUST_ID – Increments a customer by time order (e.g. first customer have ID 1) ; CUST_TITLE – Identifies a customer as Mr, Mrs, Miss, Dr, Dra ; ALL THE OTHER DATA IS RELATED WITH ADDRESS AND CONTACTS Table 2 CUSTOMER ORDER 5|Page
  • 6. CUST_ORDER_ID – Increments a new order made by a customer CUST_ORDER_DATE – Indicates the date that the order was made CUST_PAYMENT_METHOD – Shows the method used to purchase the item(s) CUST_ORDER_NOTES – notes relative to order (e.g. Delivery) CUST_ID – Foreign Key from CUSTOMER table STAFF_ID – Foreign key from STAFF table Table 3 LOCATION 6|Page
  • 7. LOCATION_ID – Gives an ID to every single store ALL THE OTHER DATA IS RELATIVE TO ADDRESS Table 4 PRODUCT TABLE 7|Page
  • 8. PRODUCT_ID – Defines an ID to a product PRODUCT_PRICE – Defines a price for a product SUPPLIER_ID – Foreign Key from SUPPLIER_ID ALL THE OTHER ARE RELATED WITH THE TYPE AND COMPANY FOR THE PRODUCT 8|Page
  • 9. Table 5 STAFF TABLE STAFF_ID – Generates an ID for a Staff member STAFF_SALARY – shows the salary paid for each Staff member, it varies on the Location; LOCATION_ID – Foreign Key from LOCATION Table ALL THE OTHER ARE RELATED TO STAFF ADDRESS 9|Page
  • 10. Table 6 STOCK TABLE STOCK_ID – Generates an ID for every order made by a store (or for a store) to a Supplier CUST_ORDER_ID – Foreign Key from Customer Order Table PRODUCT_ID – Foreign Key from Product Table LOCATION_ID – Foreign Key from Location Table 10 | P a g e
  • 11. Table 7 SUPPLIER TABLE SUPPLIER_ID – Generates an ID to identify the product Supplier ALL THE OTHER ARE RELATED TO SUPPLIER DETAILS NOTE: Supplier table has a “one to many” relationship with the SUPPLIER_ORDER. A supplier gets many orders but just delivers one type of product. 11 | P a g e
  • 12. Table 8 SUPPLIER_ORDER SUPPLIER_ORDER_ID – Generates an ID to an order from a store to a supplier SUPPLIER_ID – Foreign Key from SUPPLIER Table PRODUCT_ID - Foreign Key from Product Table LOCATION_ID - Foreign Key from Location Table SUPPLIER_ORDER_QUANTITY – shows number of items ordered to every different product. This Stock is delivered in the Warehouse (Birmingham) to be re-sent to fulfil stock in other stores. 12 | P a g e
  • 13. Assuptions All the tables are populated with no more than 10 fields. Although not all the data might be real, there are some assumptions that were made and needs to be considered in this report. Customer Orders All the orders are updated until the end of October. Products The products are categorized in 4 groups: TV Mobile Computer Accessories Store There’s only a cashier per store, the other 2 (or 1 in some cases, explained in the Store’s assumptions) are sales assistants and Supervisor, so only 1 member of staff per store makes the sale (i.e. Simon in London). Supplier Order The quantity of items ordered from the suppliers depends on the sales that the company had on the previous month. The figures in Supplier_order table determine how many items the company can store. Staff Birmingham Warehouse allocates a employee to ensure all the stock transfers and deliveries. Birmingham as been set as a store too. Stock The stock is updated until the end of October. There’s a table that shows how many items can be stored. 13 | P a g e
  • 14. Total Stock Stoc _Lond Stock_Newcast StockWarehous Stock_Manches k on Stock_Cardiff Stock_York le e ter 97 29 3 5 10 30 20 195 77 18 20 20 30 30 73 40 10 3 5 10 5 999 400 100 80 20 300 99 Total Total Room Roo for m for Stock Total Room Total Room Total Room for Total Room for Total Room for Stoc Londo for Stock for Stock Stock Stock Stock k n Cardiff York Newcastle Warehouse Manchester 100 30 5 5 10 30 20 200 80 20 20 20 30 30 90 40 10 5 15 10 10 1000 400 100 80 20 300 100 This table shows that London and Manchester are bigger stores and that’s why they have more staff and more room for stock (it doesn’t mean that the sales have to be better). Procedures description A customer goes to a store to buy something. The customer is helped to choose the best item for himself by a sales assistant or Supervisor and pays on the till. The cashier check if the item is available in the store. If it is not available it is ordered from the warehouse. The system is updated and the Stock Controller orders the sold item from the supplier to replace the item sold so the company can always have it’s maximum stock always available. The customer’s order is inserted on the system and delivered (if required).The delivery is free. For every customer is created an ID and the same is automatically done for the order too. 14 | P a g e
  • 15. SECTION B QUERIES a) Create SQL code to list all staff members and the branch at which they work. Select * from HYPERAV_STAFF NATURAL INNER JOIN HYPERAV_LOCATION ; In this Query it was select ‘everything’ from HYPERAV_STAFF and was used a NATURAL INNER JOIN to relate with HYPERAV_LOCATION. This way all staff members were listed and related to its branch. 15 | P a g e
  • 16. QUERY PLAN b) Create SQL code to list all products in stock, the stock level of each product and the total value of stock for each product. Select PRODUCT_ID, PRODUCT_DESCRIPTION, COUNT(STOCK_ID) STOCK_LEVEL, SUM(PRODUCT_PRICE) TOTAL_VALUE from HYPERAV_STOCK NATURAL INNER JOIN HYPERAV_PRODUCT GROUP BY PRODUCT_ID, PRODUCT_DESCRIPTION ; This query lists all products in stock (stock level) and total value (note that before it was shown the ideal stock but that is business strategy, not business reality so I assumed the stock on replacing what is sold gets stocked again, that is why the actual stock is only a re-stock of what was sold. 16 | P a g e
  • 17. QUERY PLAN c) Create SQL code to display all products which are in stock at the Manchester branch and which have a price of over £500. The output should be sorted by price. SELECT * FROM HYPERAV_LOCATION NATURAL INNER JOIN HYPERAV_STOCK NATURAL INNER JOIN HYPERAV_PRODUCT WHERE LOCATION_TOWN_CITY like 'Manchester' and PRODUCT_PRICE > 500 ORDER BY PRODUCT_PRICE This query displays all products which are in stock at Manchester Branch with a price over £500. Note: It could be done with this code too ‘SELECT * FROM HYPERAV_STOCK NATURAL INNER JOIN HYPERAV_PRODUCT WHERE LOCATION_ID =2 and PRODUCT_PRICE > 500 ORDER BY PRODUCT_PRICE’ 17 | P a g e
  • 18. QUERY PLAN d) Create SQL code to prompt the user for a supplier and to then display all products which the chosen supplier offers. SELECT * FROM HYPERAV_SUPPLIER NATURAL INNER JOIN HYPERAV_PRODUCT WHERE SUPPLIER_ID= :ENTER_ID This code creates a prompt that gives the opportunity to choose the SUPPLIER_ID and check all its attributes. 18 | P a g e
  • 19. As an example it was shown all the attributes for SUPPLIER_ID 1. QUERY PLAN 19 | P a g e
  • 20. e) Create SQL code to display information about each customer and the orders that they have placed. The output should include customers that have not placed any orders. Sort the output by the date of the order. (Note, you should ensure that your sample data properly demonstrates this query, i.e. that it shows customer with no orders) SELECT * FROM HYPERAV_CUSTOMER LEFT OUTER JOIN HYPERAV_CUSTOMER_ORDER ON HYPERAV_CUSTOMER.CUST_ID =HYPERAV_CUSTOMER_ORDER.CUST_ID ORDER BY CUST_ORDER_DATE; This Query shows all the customers and the orders placed by them. This Database didn’t have a customer without orders because it was assumed that all the customers would fill the form on the first purchase but it was created a “Test” customer, ID 21 to show that the code is working. 20 | P a g e
  • 21. QUERY PLAN 21 | P a g e
  • 22. SECTION C (APPLICATION BUILDER) a) Forms for inputting customer and customer order details CUSTOMER FORM (Blank) - To become a customer and be inserted in the system; 22 | P a g e
  • 23. CUSTOMER ORDER FORM (blank) - To place an order; 23 | P a g e
  • 24. b) A report on the products sold by the company, including an analysis page which show a pie chart of the different types of products. Products sold by the company and report of turnover by product (value obtained). The Chart cannot be shown in the actual report because it is necessary a SVG viewer and the actual computers cannot download it (no administrator permission in computers in University) but it is available on the Oracle Platform. 24 | P a g e
  • 25. Conclusion This report is expected to fulfil all the tasks from section A, B and C for this assignment and to explain the strategy plan for this company (just about the database). It correspond to the use of queries, input forms and reports but more utilities from an Oracle Platform can be used such as SQL Queries, Application Builders and in a forward stage, connect databases with MYSQL and PHP or to create Retail Databases more developed. 25 | P a g e
  • 26. Conclusion This report is expected to fulfil all the tasks from section A, B and C for this assignment and to explain the strategy plan for this company (just about the database). It correspond to the use of queries, input forms and reports but more utilities from an Oracle Platform can be used such as SQL Queries, Application Builders and in a forward stage, connect databases with MYSQL and PHP or to create Retail Databases more developed. 25 | P a g e
  • 27. Conclusion This report is expected to fulfil all the tasks from section A, B and C for this assignment and to explain the strategy plan for this company (just about the database). It correspond to the use of queries, input forms and reports but more utilities from an Oracle Platform can be used such as SQL Queries, Application Builders and in a forward stage, connect databases with MYSQL and PHP or to create Retail Databases more developed. 25 | P a g e