Design and implement relational database systems

Assignment Help PL-SQL Programming
Reference no: EM133127249

SIT772 Database and Information Retrieval - Deakin University

SQL Query Practice and Implementation

Learning Outcome 1: Design and implement relational database systems through the use of SQL

GLO 1: Discipline-specific knowledge and Capabilities
GLO 2: Communication
GLO 4: Critical thinking
GLO 5: Problem solving

Purpose

This task requires students to apply their understanding and ability to use Relational Database Management Systems (RDBMS) as well as use SQL in the modelling of the physical world. Students will be provided with a set of business scenarios and are required to design a database and provide related SQL queries.

Question 1: Understanding an example database and write basic SQL queries

We provide you with an Oracle sample database which is based on a global fictitious company that sells computer hardware including storage, motherboard, RAM, video card, and CPU.

The company maintains the product information such as name, description standard cost, list price, and product line. It also tracks the inventory information for all products including warehouses where products are available. Because the company operates globally, it has warehouses in various locations around the world.

The company records all customer information including name, address, and website. Each customer has at least one contact person with detailed information including name, email, and phone. The company also places a credit limit on each customer to limit the amount that customer can owe.

Whenever a customer issues a purchase order, a sales order is created in the database with the pending status. When the company ships the order, the order status becomes shipped. In case the customer cancels an order, the order status becomes canceled.

In addition to the sales information, the employee data is recorded with some basic information such as name, email, phone, job title, manager, and hire date.

The following illustrates the sample database diagram:

To do the following tasks, it needs to execute schema.sql to build the database schema, i.e., create the tables, and then run data.sql to insert the data into the created tables. We have provided the training and practice at the workshop session of Week 2.

Task 1.1: Write one SQL query to list the region names and the number of countries for each region from the above database.

Task 1.2: Write one SQL query to find all customers who have made orders before 2016. List must include the customer ID, customer name, and ordered by their ID values in descending.

Task 1.3: Write one SQL query to list all customers who have the sequential letters ‘co' in the customer name where the condition ‘co' is case-insensitive, i.e., ‘CO', ‘Co', ... can also be retrieved. List must include the customers' ID, names and ordered by their names in ascending.

Task 1.4: Write one SQL query to list all products' ID, Name and price where the products haven't been purchased by any customer in the database. The list must be ordered by the product price.

Task 1.5: Write one SQL query to list the employees and the number of orders that each employee processed in the database. The output list must include employee ID, name, and the number of orders. The list must be sorted by the number of orders in the descending order.

Task 1.6: Write one SQL query to list all the warehouses and the revenue of each warehouse. Here, given a product, the revenue of the product is calculated by the sold quantity of the product and its List_Price. The list must be ordered by the revenue value in the descending.

Question 2: Understanding and practice of normalization

Below provides a list of sample transactions in a database. It provides the full information about the transactions, products, the companies of the products, customers' names, the shop information of the sold items, and the sold prices of items for some shops and customers.

Task 2.1: Normalize the table to ensure all generated tables are in 3NF. Present all tables generated from the normalization and present the results step by step from 1NF to 3NF. You are required to specify the primary keys in your generated tables.
(Marking Rubric: 2 marks if all tables confirm from 1NF to 3NF with correct keys specified; 1 mark if all tables confirm to 1NF-3NF but keys are incorrect; otherwise, 0 mark will be given.)

Task 2.2: Write a set of SQL queries to create your normalized tables for building the database schema. Each table must declare the primary keys, foreign keys if applicable.
(Marking Rubric: 1 mark if there is no mistake to create the tables or only has one mistake; otherwise, 0 mark will be given.)

Task 2.3: Write a set of SQL queries to add data into the database implemented in Task 2.2. The database must include all the provided information. If need, you can add unique identifiers or ids for tables.

Attachment:- Database and Information Retrieval.rar

Reference no: EM133127249

Questions Cloud

Recommend to address or fix the failure : Identify one or two market failures you observe in the world around you (you can't use general ones like rent control, drugs, minimum wage). How would you class
How would you classify the failure : How would you classify the failure? What policy or strategy would you recommend to address or fix the failure? What trade-offs does your proposed policy entail
How large an object is when viewed with a microscope : A) describes how large an object is when viewed with a microscope
Weighted moving average technique : The sales of Regiferators at the Walmart stores have grown steadily during the past six years as shown in the table below.
Design and implement relational database systems : Design and implement relational database systems through the use of SQL - Write a set of SQL queries to create your normalized tables for building the database
Developing and emerging-market economies peg : When developing and emerging-market economies peg their currencies, what risks do they face to find themselves eventually in a currency crisis? What have they t
Unethical situations in our personal and professional lives : This class is all about ethics. We have all encountered unethical situations in our personal and professional lives.
Developing and emerging-market economies : When developing and emerging-market economies peg their currencies, what risks do they face to find themselves eventually in a currency crisis? What have they t
What is expected to happen in the short-term : A near-term forecast for real GDP, inflation, and unemployment: what is expected to happen in the short-term(US economy) ?(use data for leading indicators and

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Create a database model

Create a database model and Submit the table creation statements for the Database Model.

  Write pl-sql procedures and functions

Write PL/SQL procedures and functions to populate and query that database

  Sql questions

Write a query to display using the employees table the EMPLOYEE_ID, FIRST_NAME, LAST_NAME and HIRE_DATE of every employee who was hired after to 1 January, 1995.

  Run the lab_03_01.sql script

Run the lab_03_01.sql script in the attached file to create the SAL_HISTORY table. Display the structure of the SAL_HISTORY table.

  Write sql queries

Write a query to display the last name, department number, and salary of any employee whose department number and salary both match the department number and salary of any employee who earns a commission.

  Explaining sql insert statement to insert new row in cds

Write down a SQL insert statement to insert new row in "CDS" table.

  Write down name of actors in ascending order

Write down actors (or actress, your choice, but not both) who have won at least two (2) Academy Awards for best actor/actress. Provide the actor name, movie title & year. Order the result by actor name."

  What is an sql injection attack

What is an SQL injection attack? Explain how it works, and what precautions must be taken to prevent SQL injection attacks.What are two advantages of encrypting data stored in the database?

  Determine resonant frequency in series rlc resonant circuit

Given the series RLC resonant circuit in the figure, operating at variable frequency, determine: The resonant frequency ω o ,  The circuit’s quality factor Q , The cut-off frequencies, f 1  & f 2  and the bandwidth BW

  Query that uses cube operator to return lineitemsum

Write summary query which uses CUBE operator to return LineItemSum (which is the sum of InvoiceLineItemAmount) group by Account(an alias for AccountDesciption).

  Query to show customers were missing for existing orders

As DBA, your manager called a meeting and asked why there are so many orders for customers that don't exist in the customer table. Write query which would shows which customers were missing for existing orders. Use a join or a subquery.

  Sql query into a relational algebra statement

Turn this SQL query into a relational algebra statement? SELECT Request.reqfor, Ordering.invamt, Ordering.invnbr, Ordering.invdat

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd