Ask a question from expert

Ask now

SQL Assignment for Governors General and Leaders of the Opposition | Desklib

11 Pages1448 Words316 Views
   

Added on  2019-09-21

About This Document

This SQL assignment covers queries related to Governors General and Leaders of the Opposition in Australia. It includes finding certain Governors General, Leaders of the Opposition, and their wives' names and dates of marriage. It also covers improving the Prime_Ministers database design and implementing new integrity constraints. The subject is SQL and the course code is not mentioned. The college/university is not mentioned.

SQL Assignment for Governors General and Leaders of the Opposition | Desklib

   Added on 2019-09-21

BookmarkShareRelated Documents
Student 3 October, 2016SQL ASSIGNMENT
SQL Assignment for Governors General and Leaders of the Opposition | Desklib_1
ContentsPART 1...................................................................................................................................................2PART 2...................................................................................................................................................71 | P a g e
SQL Assignment for Governors General and Leaders of the Opposition | Desklib_2
PART 1A. Find certain Governors General of Australia.a.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. (5 marks)SQL: SELECT GG_Title as Title, GG_name as name, GG_Begin as appointment_date from governor_general where GG_Title like '%Baron%' order by GG_Begin;OUTPUT:b.Now, 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. (5 Marks)SQL: SELECT GG_Title as Title, GG_name as name, CONCAT(DAYNAME(GG_Begin) , ' , ' , DAYOFMONTH(GG_Begin), ' ', MONTHNAME(GG_Begin) , ' , ' , YEAR(GG_Begin) ) AS APPOINTMENT_DATE from governor_general where GG_Title like '%Baron%' order by GG_Begin;OUTPUT:2 | P a g e
SQL Assignment for Governors General and Leaders of the Opposition | Desklib_3
B.Find certain Leaders of the Opposition.a.Find all Leaders of the Opposition and their date of appointment, who assumed their position after 01/01/1980. (5 marks)SQL: SELECT OP_LDR_NAME AS LEADER_NAME, OP_LDR_BEGIN AS APPOINT_DATE FROM OPPOSITION WHERE OP_LDR_BEGIN > '1980-01-01';OUTPUT:b.For each Leader of the Opposition listed, add their wife’s name and their date of marriage. (5 Marks)3 | P a g e
SQL Assignment for Governors General and Leaders of the Opposition | Desklib_4

End of preview

Want to access all the pages? Upload your documents or become a member.