Submit the sql statement used to accomplish the task

Assignment Help PL-SQL Programming
Reference no: EM131160450

Lab: Advanced SQL

Objectives:

1. Explore more advanced SQL queries.
2. Answer the questions, copy the SQL code, create screenshots, and submit the results.

Submission requirements:

• For all text and image submissions, use MS Word, which is available to you within the Virtual Desktop Infrastructure (VDI).
• For all SQL code submissions, use MS Word, which is available to you within VDI.
• For all diagram submissions, use MS Visio, which is available to you within VDI.

o Note: If you need assistance on how to get started with this tool, go to the references section at the end of this document.

• If the submission is more than one file:

1. Name each item appropriately.

a. For example: LAB6-AdvSQL-yourName.vsd, LAB6-Questions-yourName.docx

2. Save each item in a single folder.

3. This folder should also be named appropriately.

a. For example: LAB5-yourName

4. Compress the folder.

5. Submit the compressed file in Blackboard.

Lab:

1. Write an SQL statement to get the average, maximum, and minimum quantity per order stored in table "Sales.SalesOrderDetail", column "SalesOrderID", for order numbers 43660, 43670, and 43672. This query should be written as a single SQL statement.

a. Fill out the following table:

Order number

Average

Maximum

Minimum

43660

 

 

 

43670

 

 

 

43672

 

 

 

b. Submit the SQL statement used to accomplish this task.

c. How many rows were affected?

d. Provide a screenshot of the result set.

2. When working in a normalized environment, chances are one will have to combine tables and get a result set into a table. To accomplish this task, the clause JOIN is used. Depending on what result is needed, different forms of this clause are used. They are:

• INNER JOIN
• OUTER JOIN (both LEFT and RIGHT)
• FULL JOIN
• CROSS JOIN

What all types of JOIN have in common is that they, based on a condition, match one record from one table to one or more records in another table. The result will be records that combine the data from both tables.

INNER JOINs are the most used type of JOIN. They return only the data for which matches were found.

SELECT *
FROM Person.Person
INNER JOIN HumanResources.Employee
ON Person.Person.BusinessEntityID =
HumanResources.Employee.BusinessEntityID

Using the example above, write an SQL query that returns all the information for all contacts stored in the Person.BusinessEntity table and only the jobTitle from the HumanResources.Employee table. Note that multiple rows may be returned.

a. Submit the SQL statement used to accomplish this task.
b. How many rows were affected?
c. Provide a screenshot of the result set.

Reference no: EM131160450

Questions Cloud

Behind the scenes affecting everyday life : When we study technology we should consider how technology is changing and how those changes affect the world around us. Considering how the world into which someone was born in 1955 was different in 2015 when that person would turn 65. What changes ..
Discuss the reaction rate of homogeneous reactions : Minus signmeans disappearance.In addition, rates of reaction of all materials are related by (-rA) / a = (-rB) / b = rR/ r = rS/ s.
What responsibility does a judge have : What responsibility does a Judge have to the victims of crime and their families? Summarize the events that took place surrounding the scandal. What ethical and moral implications does this scandal have for the criminal justice system
Sum of even numbers up : Prove by induction that the sum of even numbers up to n is equal to n(n+2)/4. In other words: 2 + 4 + 6 + ..+n = n(n+2)/4 Hint: Since these are even numbers, the next number from n is n + 2?
Submit the sql statement used to accomplish the task : Submit the SQL statement used to accomplish this task. What all types of JOIN have in common is that they, based on a condition, match one record from one table to one or more records in another table.
What would you advise john blake to do : Do you believe it would take courage for Blake to honestly reveal the timing and content of the scientific studies? What sources of courage might he call upon to help him make his decision?
What is the probability of not getting any hits in game : Buster Posey of the San Francisco Giants had the highest batting average in the 2012 Major League Baseball season. His average was .477. So assume the probability of getting a hit is .477 for each time he batted. In a particular game, assume he batte..
Playing a round-robin style tournament : A league of 20 teams is playing a "round-robin" style tournament, where each team plays every other team exactly once. How many games total need to be played?
Differentiate elementary andnon-elementary reactions : What are the various intermediates that can be formed in a non-elementary reaction?Free radicals, ions and polar substances, molecules, transition complexes are thevarious intermediates that can be formed ina non-elementary reaction

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Consider the relational schema of part of a firm database

consider the relational schema of part of a firm database below. write a sql query for each of the following

  Relational model and integrity constraints

Answer all questions with reference to the STUDENT, COURSE, and GRADE tables presented below for which the primary keys, foreign keys, and referential integrity constraints are specified.

  Script that creates and calls a function

Write a script that creates and calls a function named fnItemTotal that calculates the total amount of an item in the OrderItems table (discount price multiplied by quantity)

  Construct a query that will show the number of days

Imagine that you work for a finance industry-based organization. Your organization is looking to submit its database design documentation to an evaluation team in order to meet Sarbanes-Oxley (SOX) compliance.

  Design database for fictitious xyz-online cellphone store

Design a database for a fictitious XYZ-Online Cellphone Store. The system will allow customers to buy unlocked cellphones directly online (no contract is required). You will design the database, insert some sample data, and implement a set of r..

  Assignment related to sql programming

Define a one-to-many relationship between the Customer table and Orders table. Right click in the window and select Show table. Select the referential integrity option and both cascade options for the relationships. Save the relationship.

  Write an sql select statement that would re-organize result

Write a program in the language of your choice to calculate the sum of all the multiples of 3 or 5 below 1000. Include the source code and the calculated value in your answer.

  Assignments of sql programming

Question 1: Identify the potential sales and department store transactions that can be stored within the database. Question 2: Design a database solution and the potential business rules that could be used to house the sales transactions of the depa..

  Write sql statement to create user defined function

Write SQL statement which creates user defined function which returns int value. This int return value is obtained by deducting the lowest Count field value from the highest Count field value of Part table.

  Write a select statement that returns three columns

Write a SELECT statement that returns three columns: EmailAddress, OrderID, and the order total for each customer. To do this, you can group the result set by the EmailAddress and OrderID columns.

  Write a query to display the starting salary

Write a query to display the starting salary for each employee. The starting salary would be the entry in the salary history with the oldest salary start date for each employee. Sort the output by employee number.

  Illustrate the process of normalizing

Evaluate if the table shown above is normalized, if not describe and illustrate the process of normalizing the table shown above to third normal form. State any assumptions you make about the data shown in this table.

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