logo

Assignment Title

   

Added on  2019-09-21

11 Pages1448 Words316 Views
 | 
 | 
 | 
Student 3 October, 2016SQL ASSIGNMENT
Assignment Title_1

ContentsPART 1...................................................................................................................................................2PART 2...................................................................................................................................................71 | P a g e
Assignment Title_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
Assignment Title_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
Assignment Title_4

End of preview

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