Who were barons at the time of their appointment

Assignment Help Database Management System
Reference no: EM13803201

Create and query databases using SQL

Part A: 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.

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

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. (1 marks)

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

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. (2.5 marks)

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. (2.5 marks)

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.

Part B. Create Tables using SQL DDL

The following questions are based on the Bicycle Rental ERD as shown below:

Tasks:

1. Write the SQL DDL to create the database that contains each of the relations shown in the above ERD. You will need to provide:

a. Your DDL code for each table that you create; (20 marks)

b. A screenshot showing each table that is created. (10 marks)

Write and execute SQL definition commands for each of the following queries:

Add the attributes Email, Comments and Send Newsletter to the Renters table. Give those attributes an appropriate size and data type.

a. Change the attribute Renters.renterDOB from type Varchar(15) to type DATE. (2 marks)

Write and execute SQL commands for the following:

Add the following customers to the Renters table.

a. Write a command that will remove the Jones that lives in Orange from the Renters table.

Attachment:- primeminister.zip

Reference no: EM13803201

Questions Cloud

Find the acceleration of the car : Find the acceleration of the car and the tension of the string and the accelerations of the three blocks
Write an essay about global positioning system : Write an essay about Global Positioning System (GPS).
Describe a creative episode : Consider your past experiences either as a student, early child care professional, or teacher. Describe a creative episode similar to the two boys who found a frog in the text
Romantic view of nature and enlightenment view : What are some of the differences between the Romantic view of Nature and the Enlightenment view of Nature? (How did each view the principles of Nature, how did they view the function of Nature, how did Nature lead each to understanding of divinity..
Who were barons at the time of their appointment : 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
Write a one page paper about zine magazine : Write a one page paper about Zine magazine.
Assignment on positions in society : Positions in Society
Write an essay about impromptu speaking : Write an essay about Impromptu Speaking.
Write bibliography about recycling of plastic waste products : Write an Annotated Bibliography about Recycling Of Plastic Waste Products.

Reviews

Write a Review

Database Management System Questions & Answers

  What type of entertainment events are the most popular

What type of entertainment events are the most popular? Has this always been the case or has there been a shift in recent years - Which area of venues used for organizing events is most popular in past 10 years?

  What is the output when the following script is executed

Determine the answer (expected result) based on your reading of from text book: -  Just show the expected output when you run the syntax.

  Create a database design specification

Create a database design specification (Enhanced Entity Relationship Diagram (EERD) and Relational Data Model (RDM)) from the given business description. The RDM must be in 3rd Normal Form.

  Implement a database of courses and students for a school

Implement a database of courses and students for a school.

  Specify your physical design by identifying the attributes

List the names, ages, and salaries of managers of a user-speci?ed sex (male or female) working in a given department. You can assume that, while there are many departments, each department contains very few project managers.

  Products under the traditional costing system

Determine the unit product cost of each of the company's two products under the traditional costing system

  Optimizing database design

Optimal database design recognizes proper organization of table structures and relationships. Suggest at least two methods that can be used to improve the design of a database system

  Create a tree that models of the scenario

Create a tree that models the following scenario. A player decides to play a maximum of 4 times, betting on red each time. The player will quit after losing twice. In the tree, any possible last plays will be an ending point of the tree.

  Discussed and implemented the mvc design pattern

Find another design pattern which could be used for web based development and write a synopsis on it, pointing out whether it would be applicable for use within your project or not. Comment as applicable on design patterns that other class members..

  Apply and consolidate skills acquired in the requirement

Develop a domain model for the car park system. Express your model with a class diagram, showing any inheritance and compositional relationships.

  Revise table that is to be used as data source in mail merge

In the following project, you will revise a table that is to be used as a data source in a mail merge. As the business manager for Sports Medicine Clinic, you will send letters of welcome to three newly hired physical therapists

  1 construct a scenario leading to the worst-case

1. construct a scenario leading to the worst-case performance of the fifo buffer replacement policy.2. is it possible

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