Prime Minister Database Solution

Use the Prime Minister database (Prime_Minister_2013.sql) available from the Interact site. Answer the following queries using that database.

You are required to submit:

1.The appropriate SQL statements, which should be copied from your SQL code inMySQL, and pasted into your submission file; and

2.Screenshots of the resultant tables which are to be pasted into your assignment file immediately after the SQL code. Typing or manually drawing the results is NOT acceptable.

Write SQL SELECT statements to retrieve the following information from the Prime Minister database.

1.List the name, year commenced service as Prime Minister, party, state represented and the name of the Deputy Prime Minister for each Prime Minister that served for less than 3 years. Order by the year they commenced service as Prime Minister in descending order (5 marks)

2.List thename, party, recreation(s), name of theirspouse and number of children of each Prime Minister of a Labor government whohad four or more children and enjoyed outdoor sports. (5 marks)

3.List the name, the year that they commenced service as Prime Minister, theparty they ledand the year in which they left office ofeach Prime Minister of a Labor government. Order by the year they commenced service and the Prime Minister’s name. (5 marks)

4.Did any Deputy Prime Minister(s) subsequently become Prime Minister? List the Deputy Prime Ministers name, the year that he/she commenced as Deputy Prime Minister, the year he/she commenced as Prime Minister and the party that they led. Order the list by name, year commencing as Prime Minister and Party in descending order.(5 marks)

Leave a Reply

Your email address will not be published. Required fields are marked *

  • File format: .docx
  • No of Pages: 10
  • Figures Included: Yes
  • Database Used: mySQL