Who are the opposition leaders

Assignment Help PL-SQL Programming
Reference no: EM13338725

SQL Queries

Use the prime_minister database (prime_minister.sql) from the Interact Resources site. Answer the following queries from that database.

You are required to submit:

1. The appropriate SQL statements for each query, which should be copied from your SQL code in MySQL and pasted into your submission file;

2. Your SQL script, which is either for each question--one-step solution, or for the two sub-questions of each question-- two-step solution; and

3. Screenshots of the resultant tables which are to be pasted into your submission file immediately after the SQL code for that query. Typing or manually drawing the results is NOT acceptable.

NOTE:

1. Your SQL code should be correct for any data, not just any sample data that you create.
2. If your query results are contradict with the fact, please still present your answers based on the given prime_minister database.
3. The final query results by either one-step solution or two-step solution for each question should be the same.

Write SQL SELECT statements to retrieve the following information from the prime_minister database: Answer all questions

1. Find all Governors General of Australia who were Barons at the time of their appointment. List them by Title and name and date that they were appointed to the position. Order the list by ascending date of appointment. You can choose to answer this question in two steps:

a. Restrict your query to Governors General who were Barons at the time of their appointment

b. Then format the date of appointment as day of the week, day of the month, month and year; eg. Monday, 01 January, 1901. Order the list by ascending date of appointment.

2. Find all the Leaders of the Opposition and their date of appointment who gained their position after 01/01/1980, their wife's name and their date of marriage. Order the list by ascending date of appointment.

You can choose to answer this question in two steps:

a. list those who were the Leaders of the Opposition and their date of appointment who gained their position after 01/01/1980.

b. For each Leader of the Opposition listed as above, add their wife's name and their date of marriage. 

3. Who are the Leaders of the Opposition who were not members of a Labor party and who gained their position after 01/01/1980. List their name, date of election in the format month, day of week and year, eg: January 1st, 1980, spouse's name and their year of marriage. Order the list by ascending date of appointment.

You can choose to answer this question in two steps:

a. List whose who are the Leaders of the Opposition who were not members of a Labor party. Order the list by ascending date of appointment

b. Based on the result of Q.3a, list whose who gained their position after 01/01/1980. Order the list by ascending date of appointment 

4. List the title, name, date of appointment for Governors General of Australia who were appointed between 01 January 1930 and 01 January 1960, together with the Prime Ministers who appointed them and all Leaders of the Opposition who served during their appointment. The date is to be formatted in dd/mm/yyyy format. Order by ascending date of appointment.

You can choose to answer this question in two steps:

a. List the title, name, date of appointment for Governors General of Australia who were appointed between 01 January 1930 and 01 January 1960. Order by ascending date of appointment.

b. Together with the result of Q.4a, list the Prime Ministers who appointed them and all Leaders of the Opposition who served during their appointment. Order by ascending date of appointment. 

5. Who are the Opposition Leaders who subsequently became Prime Minister after 1930 ? List their name, the date they were elected Opposition Leader and the date they were elected Prime Minister and their Deputy Prime Minister's name and the party that they led. The dates must be formatted as day of the week, day of the month, month in digits and year in four digits; eg. Monday, 01/01/1901. Order the list by ascending date of appointment as Opposition Leader. 

6.. Who are the Prime Ministers who led a non-ALP party before 1930? List the Prime Ministers name, the year they commenced as Prime Minister, their party, their Deputy Prime Minister, the number of times that they were elected as Prime Minister and the title and name of the Governor General at the time they commenced office.

Reference no: EM13338725

Questions Cloud

What is the output : Suppose that x and y are int variables, z is a double variable, and ch is a char variable. Suppose the input statement is.
Calculate the total rotational kinetic energy of two hands : Big Ben, the Parliament tower clock in London, has an hour hand 2.70 m long with a mass of 300 kg, Calculate the total rotational kinetic energy of the two hands about the axis of rotation
What is the equilibrium risk premium : What is the equilibrium risk premium
What is the initial angular acceleration of the bridge : A uniform drawbridge must be held at a 35.0?angle above the horizontal to allow ships to pass underneath. what is the initial angular acceleration of the bridge
Who are the opposition leaders : Write SQL SELECT statements to retrieve the following information from the prime_minister database.
An investor be indifferent between these two bonds : 1)Corporate Bonds issued by ABC Corporation currently issued 12.1%. Municipal Bonds of equal risk currently yield 7.7%. At what tax rate would an investor be indifferent between these two bonds?
What are the other energy levels : A certain system emits electromagnetic radiation of wavelengths 'lambda'1=310nm, 'lambda'2=207nm and 'lambda'3=124nm. what are the other energy levels
How quickly is the water accelerating : When you put water in a kitchen blender, it begins to travel in a 3-cm-radius circle at a speed of 1 m/s. How quickly is the water accelerating
What is the acceleration of the three boxes : Three boxes are being accelerated on a horizontal table with a 60-N force applied to box 1 at an angle 35o below the horizontal. What is the acceleration of the three boxes

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  F does not logically imply

Given R = (J,K,L ) and the set F of FDs J -> K and L -> K , show that F does NOT logically

  Script that creates and calls a stored

Write a script that creates and calls a stored procedure named spInsertProduct that inserts a row into the Products table. This stored procedure should accept five parameters

  Write a pl/sql block and declare a variable v_sal

Write a PL/SQL block and declare a variable  v_sal  of the type NUMBER. Include the following statement in the Execution section:

  Create qrycustomersm that selects all customers

Write the SQL below that would display all Customers whose first name begins with the letter J. Your query should display the FirstName, LastName, Phone, and MembershipStatus fields from the tblMember table.

  Indicate the changes

Indicate the changes (using the shorthand representation) that you would need to make to the original Premiere Products database design to support the following requirements. There is no relationship between customers and sales reps.  When a custo..

  Convert requirement to logic and then to sql

Prepare the SQL query for each of given requirements. Convert requirement to logic, then to SQL. Illustrate the names of all products which have been sold.

  Description of vulnerability, exploit and attack software

Describe the vulnerability that the attack exploits, including how or why the vulnerability exists; what versions of software are vulnerable.

  Write an update statement that modifies the row

Write an UPDATE statement that modifies the row you just added to the Categories table. This statement should change the ProductName column to "Woodwinds", and it should use the CategoryID column to identify the row.

  Write sql statement to create view

Write a SQL Statement to create a View called vwEmployeeTerritories that will do the following: Return all Employees and their Territories (use INNER JOIN).

  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)

  Create a database model

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

  Write sql create table statement to create pet table

Write an SQL CREATE TABLE statement to create the PET table without referential integrity constraint on OwnerID in PET.

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