Database Fundamentals

111 views 8:47 am 0 Comments June 30, 2023
ITDA1001
Database Fundamentals
Tutorial – 8
March 2022

ITDA1001 Lab Tutorial 8
Task 1: Using Northwind Database, write SQL statements for the
following data retrieval operations.
Note: You may need to refer to the schema for the exact field names while framing the queries to the following
questions. While framing the question, the words ‘code’, ‘number’ or ‘ID’ may have been synonymously used. For
instance, ‘Customer Number’ when used may refer to a field called CustomerID. Similarly, wherever the word ‘name’
is used, appropriate interpretation may be needed based on the schema – for instance if ‘customer name’ is required
to be printed, you may need to retrieve CompanyName field from the Customers Table; likewise, when ‘employee
name’ is required (without any further qualification, you may retrieve the lastname field of Employees table.
Excercise
8.1 Retrieve the first three letters of the employees’ last names.
8.2 Retrieve the last two characters from the employees’ last names.
8.3 Retrieve five characters from the employees’ last names, starting at the second character.
8.4 Retrieve the firstname and lastname of employee. Output should be in the form of full
name (firstname + ““ + lastname) having first character in upper case for both firstname
and lastname, and other characters in lower case.
8.5 Retrieve maximum, minimum and average of unitprice column from order details table.
8.6 Check whether each value in the PostalCode column of the Customers table are numeric
or not.
8.7 Display the Day, Month and Year separetly of today’s date.
8.8 Display day of year, day, week, weekday, hours, minutes and seconds of current day.
8.9 Display the dates respectively after adding 4 years, 2 months and 25 days to the current.
8.10 Display the day differences from Orders table between following:
a. Order date and required date.
b. Order date and shipped date.
c. Shipped date and required date.
Copyright © 2022 VIT, All Rights Reserved. 2

Tags: , , , , , , , , , ,