Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask DBMS Expert


Home >> DBMS

Objectives:

To analyse and comprehend a provided ER diagram and Database Schema

To implement a database based on the provided ER diagram and Database Schema

To write required SQL statements to query the database

Project Specification

The management team now require a partial implementation of the design made in Assignment 1. In order to keep consistency between the assignments, database specification containing the ER diagram and the schema is provided in this document. You should create your database according to this documentation. Please make sure that your implementation is consistent with this design. This means that your table names (upper case), field names (mixed case, no spaces) and data types have to be according to the specifications provided in this document. The implementation phase includeswriting SQL statements to create a database and its tables, populating the tables with data, writing a number of queries to create reports that can be used by the management team.  Your database should contain sufficient data in each table (5 - 10 records in each table) to demonstrate that your queries work.

Implementation of the Database

To implement the database system, you are required to

a) provide SQL commands to create the database, its tables, the relationships of the tables

b) Create a text file called YourStudentId-Create.sql (format xxxxxxx-Create.sql) for example 2225991-Create.sql that will provide SQL commands to:

 i. create a database called WareMart[YourStudentID] (egWareMart30011111)

 ii. create all of the required tables for the database including their primary keys, foreign keys and the relationships of tables. 

c) Create a text file called YourStudentId-Insert.sql (format xxxxxxx-Insert.sql) for example 2225991-Insert.sql that willprovide SQL commands to:

 i. insert sufficient data into each table you have created to test the queries(at least 5 records in each table).

 ii. You are required to include our full name as one of the clients; but you can provide fake details for your address.

d) Create a text file called YourStudentId-Queries.sql (format xxxxxxx-Queries.sql - for example 2225991-Queries.sql) that contains all of the queries to display the following reports:

  1. An alphabetically sorted list of all clients. Only client number and name are required.
  2. List of names and complete address of all employees sorted by their salary.
  3. The date on which the most recent stock request has been made. The date itself will suffice.
  4. List of all the client names and their  residentialaddresses.
  5. A list of all clients that have not placed a stock request yet. Displaying client number will be sufficient.
  6. A list containing the name (surname and first name) of any employee that has picked any product(s) for a stock request.
  7. A list containing the total quantity on hand for each product (product no and description) regardless of warehouses and location.
  8. A list showing each product requested on each client stock request. Show client name, product number and quantity requested. sorted by client name and then product number.
  9. A list of employees (surname and first name are sufficient) and their salary for all employees whose salary is less than or equal to average salary.
  10. A list of employees as in question 9, but show their salary with a 7.5% increase.

1415_Implement a database based on the provided ER diagram.png

2. Relational Database Schema

WAREHOUSE

Column name

Data type

Comments

warehouseID

VARCHAR(3)

Primary key

street

VARCHAR(20)

 

city

VARCHAR(15)

 

state

VARCHAR(3)

Examples - VIC, NSW, QLD

postcode

VARCHAR(4)

Examples - 3350, 2001, 3001

managerID

INT

FK - References MPLOYEE.StaffID

EMPLOYEE

Column name

Data type

Comments

staffID

INT A_I

Primary key

surname

VARCHAR(20)

 

firstName

VARCHAR(15)

 

dob

Date

Short date - Example 06/09/1982

street

VARCHAR(20)

 

city

VARCHAR(15)

 

state

VARCHAR(3)

Examples - VIC, NSW, QLD, TAS

postcode

VARCHAR(4)

Examples - 3350, 3355, 2001, 3001

salary

Decimal(19,4)

 

warehouseID

VARCHAR(3)

FK - References AREHOUSE.warehouseID

supervisedBy

INT

FK - References MPLOYEE.StaffID

LOCATION

Column name

Data type

Comments

warehouseID

VARCHAR(3)

Primary key  - Examples W01, W02

FK - References WAREHOUSE. warehouseID

locationID

VARCHAR(3)

Primary key -Examples L01, L02

Aisle

INT

 

Shelf

INT

 

Bin

INT

 

capacity

Double

Capacity in cubic meters

PROD_LOCATION

Column name

Data type

Comments

warehouseID

VARCHAR(3)

Primary key

FK - References WAREHOUSE. warehouseID

locationID

VARCHAR(3)

Primary key

FK - References LOCATION. locationID

productNum

INT

Primary key

FK - References PRODUCT. productNum

quantityOnHand

INT

 

PRODUCT

Column name

Data type

Comments

productNum

INT A_I

Primary key

description

VARCHAR(30)

 

packSize

INT

 

Price

dptNumber

 

 

Decimal (10,2)

INT

 

FK - References DEPARTMENT.dptNumber

DEPARTMENT

Column name

Data type

Comments

dptNumber

INT A_I

Primary key

dptName

VARCHAR(20)

 

CLIENT

Column name

Data type

Comments

clientNum

INT A_I

Primary key

clientName

VARCHAR(40)

 

CLIENT_ADDRESS

Column name

Data type

Comments

clientNum

INT A_I

Primary key

FK - References CLIENT.clientNum

addressType

VARCHAR(1)

Primary key. Expected examples 'R' for residential, 'M' for main and 'P' for postal

street

VARCHAR(20)

 

city

VARCHAR(15)

 

state

VARCHAR(3)

Examples - VIC, NSW, QLD

postcode

VARCHAR(4)

Examples - 3350, 2001, 3001

STOCK_REQUEST

Column name

Data type

Comments

requestNum

INT A_I

Primary key

requestDate

Date

Short date - Example 06/09/2012

clientNum

INT

FK - References CLIENT.clientNum

REQUEST_LIST

Column name

Data type

Comments

requestNum

INT

Primary key

FK - References STOCK_REQUEST.requestNum

productNum

INT

Primary key

FK - References

PRODUCT.productNum

qtyRequested

INT

 

PICKING_LIST

Column name

Data type

Comments

warehouseID

VARCHAR(3)

Primary key.

FK - References WAREHOUSE. warehouseID

locationID

VARCHAR(3)

Primary key.

FK - References LOCATION. locationID

productNum

INT

Primary key.

FK - References PRODUCT. productNum

requestNum

INT

Primary key.

FK - References STOCK_REQUEST.requestNum

quantityPicked

INT

 

datePicked

Date

Short date - Example 06/09/2014

pickerStaffID

INT

Foreign Key - References EMPLOYEE.staffID

 

DBMS, Programming

  • Category:- DBMS
  • Reference No.:- M9744793

Have any Question?


Related Questions in DBMS

Database design and development assignment -assessment task

Database Design and Development Assignment - Assessment task - 1. Normalization a) Map the ERD, from the sample solution, into a set of relations in at least Third Normal Form (3NF). You must ensure that your relations m ...

Analytic reportpurpose the purpose of this task is to

Analytic Report: Purpose: The purpose of this task is to provide students with practical experience in working in teams to write a Data Analytical report to provide useful insights, pattern and trends in the chosen/given ...

Sql injection on a searchthe way search performs its task

SQL injection on a search The way Search performs its task is by executing the following query (in a php script):          $var=stripslashes($_POST['search']);          $query = "SELECT username from lab1_login where use ...

You are responsible for keeping track of meal expenses for

You are responsible for keeping track of meal expenses for ten employees while at a business lunch to which your employer has invited you to attend. Write an algorithm that inputs the lunch costs for each the ten employe ...

We can represent a data set as a collection of object nodes

We can represent a data set as a collection of object nodes and a collection of attribute nodes, where there is a link between each object and each attribute, and where the weight of that link is the value of the object ...

Sql transactions exercisesconsider table itemnameprice

SQL Transactions Exercises Consider table Item(name,price) where name is a key, and the following two concurrent transactions. T1: Begin Transaction; Update Item Set price = 2*price Where name = 'pencil'; Insert Into Ite ...

Database and information retrieval assignment - data

Database and Information Retrieval Assignment - Data Privacy Essay Task - Write an essay (aim for 750 words) that addresses issues associated with data proivacy. Use the Australian Privacy Principles - discussed in class ...

Assignmenta restaurant is designing a database to keep

Assignment A restaurant is designing a database to keep track of customer services. A customer is defined as a customer ID, name, address and a telephone number. Customers are served by employees. Each employee is define ...

Assignmenta restaurant is designing a database to keep

Assignment A restaurant is designing a database to keep track of customer services. A customer is defined as a customer ID, name, address and a telephone number. Customers are served by employees. Each employee is define ...

Backgrounda new training organization called abc

Background A new training organization called ABC TechTraining is opening soon and they have approached you to help design their new database. They have just completed the refurbishment of the premises and are now lookin ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As