Student. 3 October, 2016. sql assignment. Student. 3 Oc

Added on - 21 Sep 2019

  • 11

    Pages

  • 1448

    Words

  • 135

    Views

  • 0

    Downloads

Trusted by +2 million users,
1000+ happy students everyday
Showing pages 1 to 4 of 11 pages
Student3 October, 2016SQL ASSIGNMENT
ContentsPART 1...................................................................................................................................................2PART 2...................................................................................................................................................71|P a g e
PART 1A.Find certain Governors General of Australia.a.Find all Governors General of Australia who were Barons at the time of theirappointment. List them by Title and name and date that they were appointed to theposition. Order the list by ascending date of appointment. (5 marks)SQL: SELECT GG_Title as Title, GG_name as name, GG_Begin asappointment_date from governor_general where GG_Title like '%Baron%' order byGG_Begin;OUTPUT:b.Now, format the date of appointment as day of the week, day of the month, monthand year; eg. Monday, 01 January, 1901. Order the list by ascending date ofappointment. (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_DATEfrom governor_general where GG_Title like '%Baron%' order by GG_Begin;OUTPUT:2|P a g e
B.Find certain Leaders of the Opposition.a.Find all Leaders of the Opposition and their date of appointment, who assumed theirposition after 01/01/1980. (5 marks)SQL: SELECT OP_LDR_NAME AS LEADER_NAME, OP_LDR_BEGIN ASAPPOINT_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 ofmarriage. (5 Marks)3|P a g e
desklib-logo
You’re reading a preview
Preview Documents

To View Complete Document

Click the button to download
Subscribe to our plans

Download This Document