SQL Assignment for Governors General and Leaders of the Opposition | Desklib
Added on -2019-09-21
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.
| 11 pages
| 1448 words
| 316 views
Trusted by 2+ million users, 1000+ happy students everyday
Student 3 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 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
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
Found this document preview useful?
You are reading a preview Upload your documents to download or Become a Desklib member to get accesss