Thursday, November 2, 2017

Lab 4: Functions in SQL part 1

Objectives:
Instructions:
  • This labs uses the students table with the data shown in Figure 1 below:
Figure 1: Table Students.
  • Update the information in Figure 1 into your students table using the SQL command you learnt previously.
  • Follow the instructions from the links in the lab objectives to understands the different functions in SQL commands.
  • Perform the operation below:
    • Retrieve the distinct list of intake year from the table students.
    • Sort the distinct list of intake year from the table in descending order.
    • retrieve a data from table students where the name of the student is Enson Liu and the year of intake is 2016.
    • Retrieve the data from table students where the name of the student is Enson Liu or the the year of intake is 2012.
    • List all the student in table students that are not from the year 2018.
    • Calculate the sum and average value for the student id in the table students.
    • show the largest year in the table students.
    • Show the smallest student id in the table students.
  • Screenshot all the operation exercise above and save it in a Microsoft Documents named "lab4-[matric no]". *each lab document will be different because your matric number is included in your table name. For example: 56788_students for student with matric number 56788.