Write an sql select statement that would re-organize result

Assignment Help PL-SQL Programming
Reference no: EM13929822

Section 1: Logic and Algorithms

This section evaluates your ability to understand and work through a problem logically. Please use flow-diagrams or pseudo-code to answer these questions, do not use any specific language or tool. For example, Question 1 could be answered using a very simple SQL statement, but that is not the purpose of this section.

Question 1:

Given an alphabetically sorted list of 500,000 people's names and telephone numbers, describe an algorithm that you could implement that would allow you to find a given person's telephone number in the shortest amount of time.

Question 2:

Given a list containing Province, CustomerName and SalesValue (sorted by Province and CustomerName), describe an algorithm you could use that would output each CustomerName and SalesValue with the total SalesValue per Province.

Question 3:

You have been given a large list of people's names and have been asked to highlight all duplicates where the exact same name appears more than once, as well as highlight any possible duplicates where there may be misspellings of the same name. Describe an algorithm you could use that would produce the required output.

Question 4:

You are required to use a single integer value to store multiple values. Describe how you would achieve this.

Section 2: Programming

This section evaluates your technical capabilities and allows us to determine your knowledge of the tools as well as your style.

Question 1:

Given the table from Fig.1, write an SOL Select statement that would re-organize the results to look like Fig.2

Region

Contact

Cape Town

Fred

Cape Town

Joe

Cape Town

Anna

Durban

John

Durban

Mary

Johannesburg

Frank

Fig. 1

Region

Contact

Durban

John

Durban

Mary

Johannesburg

Frank

Cape Town

Anna

Cape Town

Fred

Cape Town

Joe

Fig. 2

Question 2:

Write a program in the language of your choice to input a sentence from the user and then output the sentence in reverse. For example, if the user types in The Rain in Spain", then the output should be "Spain in Rain The".

Question 3:

If we list all the natural (integer) numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

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.

Question 4:

By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.

Write a program in the language of your choice to output the 10001st prime number. Include the source code and the value in your answer.

Question 5:

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:

1, 2, 3, 5, 8, 13, 21, 34, 55, 89,...

Write a program in the language of your choice to consider the terms in the Fibonacci sequence whose values do not exceed four million and find the sum of the even-valued terms. Include the source code and the calculated value in your answer.

Section 3: Database

This section evaluates your technical capabilities and allows us to determine your knowledge of the tools as well as your style.

Please use the below to tables for answering the questions in this section.

Table Name: Employee

ID

Name

Suname

I Posion

1

Scrooge

McDuck

Manager

2

Daisy

Duck

Manager

3

Donald

Duck

Support

4

Mlmy

Mouse

Support

5

Micky

Mouse

Support

6

Goofy

 

Stipport

7

Pluto

 

Support

8

Huey

Duck

Support

9

Dewey

Duck

Support

10

Louie

Duck

Support

Table Name: Employee

EmplID ManID
3 1
7 1
6 2
4 2
2 1
1 2
5 2

Question 1:

List which fields are primary keys and foreign keys?

Question 2:

Write a SQL statement that will Output the following result:

ID Name Surname Position
2 Daizy Duck Manager
9 Dewey Duck Support
3 Donald Duck Support
6 Goofy
Support
8 Huey Duck Support
10 Louie Duck Support
5 Micky Mouse Support
4 Minrry Mouse Support
7 Pluto
Support
1 Scrooge McDudck Manager

Question 3:

Write a SQL statement that will Output the following result:

Name Surname Position  ManagerName ManagerPosition 
Donald Duck Support Scrooge Manager
Pluto 
Support  Scrooge Manager
Goofy
Support Daizy Manager
Minny Mouse Support Daizy Manager
Daizy Duck Manager Scrooge Manager
Scrooge McDuck Manager Daizy Manager
Micky Mouse Support Daizy Manager

Question 4:

Write a SQL statement that will Output the following result:

Name Surname Position  ManagerName ManagerPosition 
Scrooge McDuck Manager Daizy Manager
Daizy Duck Manager Scrooge Manager
Donald Duck Support Scrooge Manager
Minny Mouse Support Daizy Manager
Micky Mouse Support Daizy Manager
Goofy
Support Daizy Manager
Pluto
Support Scrooge Manager
Huey Duck Support NULL NULL
Dewey Duck Support NULL NULL
Louie Duck Support NULL NULL

Question 5:

Write a SQL statement that will Output the following result:

StaffCount Name
4 Daizy
3 Scrooge

Section 4: Problem Solving Style

The section is designed to evaluate your overall problem-solving approach.

Question 1:

Why are computer monitors and TV sets rectangular?

Question 2:

You have written a program that takes several hours to run. The program sometimes fails, but usually only after a few hours of running and only when running on the production server. What steps would you take to identify the problem?

Question 3:

You have designed a system that accesses and updates a database. When you first install the database and system at the customer, the system runs with good performance. However 3 months later, the Customer phones and says that it is taking a long time to search for information from the database. What would you do to diagnose and correct this problem?

Question 4:

You are working on a project for a very important customer and are at least three weeks from being able to complete the project. Suddenly your customer informs you that due to circumstances beyond their control the system must be implemented in one week. What would you do?

Question 5:

A drawer contains 10 black and 10 brown socks that are all mixed up. What is the fewest number of socks you can take from the drawer without looking and be sure to get 2 of the same colour.

Reference no: EM13929822

Questions Cloud

Evaluate various capital investment alternatives : Explain CVP analysis in detail with suitable example. Evaluate various capital investment alternatives. Describe the planning-and-control cycle and the five key dimensions of budgeting. Calculate costs using activity-based costing method with suitabl..
Discuss the key facts and critical issues presented in case : What were the elements that led to him so successfully wooing some of the wealthiest and most intelligent clients? Why do you think the SEC was unable to uncover his fraud?
Double the amount that can pass transfer tax free : John and Mary are interested in passing the maximum amount to their grandchildren upon their deaths. Can they utilize portability for GST purposes to double the amount that can pass transfer tax free?
Initial cost and salvage value projections : Consider a project to supply Detroit with 40,000 tons of machine screws annually for automobile production. You will need an initial $1,440,000 investment in threading equipment to get the project started; the project will last for 7 years. Suppose y..
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.
Calculate total cost of ordering and carrying inventories : Start with the partial model Ch 28 P3 Build a Model.Xls from the textbook's website. The following inventory data have been established for the Adler Corporation: (1). Orders must be placed of 100 Units. (2). Annual Sales are 338,000 Units. Calculate..
What is the projects net present value if the required rate : A project is expected to create operating cash flows of $33,000 a year for three years. The initial cost of the fixed assets is $68,000. These assets will be worthless at the end of the project. An additional $4,500 of net working capital will be req..
Discuss the key facts and critical issues presented in case : In a globally competitive environment, why would Coca Cola engage in questionable conduct such as channel stuffing, falsifying marketing research, anti-trust issues or racial discrimination?
Write a sql expression to display the status : Write a SQL statement to display the Major of students with no duplications. Do not display student names.

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Produce a diagram showing schema

Produce a diagram showing schema and the partial and transitive dependencies in your 1NF. b. Produce a diagram showing table schema and any transitive dependencies in your 2NF

  Write sql statement which creates stored procedure

Write SQL statement which creates stored procedure with one int input parameter. Stored procedure selects supplierId field and total of all Count field values for each group of supplierId's from Part table.

  Querries related to sql programming

Create a parameter query based on the Customer tablethat prompts for customers in a specific state. Do not just make a select query. A parameter is different. Display the CustomerNum, CustomerName, City, and State fields.

  Gathering requirements to develop sql queries

Describe some techniques for gathering requirements to develop SQL queries. Provide an example using a business case.

  Use the provided appbdbcreatesql sql script to create the

use the provided appbdbcreate.sql sql script to create the database to be used when working on this assignment.question

  Calculate the total shopper spending

Create a host variable named G_TAX to hold the value returned by the procedure and invoke the procedure using the values of "VA" for the state and $100 for the subtotal.

  Write statement which creates table named part

Write the statement which creates table named Part, with Id field as an int idendity PK, a SupplierId int field, a Description string field of size 25, a Count int field, a Class string field

  Display account number and balance for all customers

This assessment item is designed to test your understanding of arrays/arraylists, objects, classes, methods, sorting and searching.

  Addressed using the perl scripting language

addressed using the Perl Scripting Language.

  Prior to the adoption of sql

What factors influenced your decision - Explain a situation where you would consider using the other option.

  Write a program that does simplified bgp route advertising

Additionally, it will periodically check the modification time of the routing table file and if it detects that it has changed, it will re-read it and send BGP UPDATEs reflecting the changes to all connected peers. This functionality is described i..

  Explain entity integrity and referential integrity rules

Explain entity integrity and referential integrity rules in relational model.show how these aer realized in sql

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