0% found this document useful (0 votes)
8 views

Assignment db1

This document contains an assignment on the topic of Database II. It includes 7 questions related to SQL joins, null values, self-joins and the dual table. The questions range from 10-20 marks and require examples using tables like Employees and Department to demonstrate different types of joins, checking for null values, and using the dual table. The due date for the hard copy and softcopy submission is August 24, 2018.

Uploaded by

rasanjali2 789
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Assignment db1

This document contains an assignment on the topic of Database II. It includes 7 questions related to SQL joins, null values, self-joins and the dual table. The questions range from 10-20 marks and require examples using tables like Employees and Department to demonstrate different types of joins, checking for null values, and using the dual table. The due date for the hard copy and softcopy submission is August 24, 2018.

Uploaded by

rasanjali2 789
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

NVQ 5 in ICT 2018 Semester 02

Subject DB II
Covered Topics Topic 1
Assignment No Assignment 01
Issued Date 2018.08.10
Due Date 2018.08.24
Submission Hard Copy to instructor
Method Softcopy /scanned image to LMS

Q1. Alias can be used to preface the column name in order to clarify which table and column are
participating in the join. Also we can rename the columns in an output.

Confirm the above statement using example? (15 marks)

Q2. Display employee ID, last name, department ID, department name, and hire date for those
employees whose hire date was June 7, 1994.Assume the following table structure.

Employees

employee ID First name last name hire date department ID

Department

department ID department name

Give the answer for the above question using following methods of join

1) Assume data types are same for department ID column of both table. Write down answer
using natural join
2) Give the same output using ON clause
3) Give the same output using USING clause
4) Give the same output using equi join
(20 marks)

Q3. Explain self-join with example (15 marks)


Q4. Below is a selection from the "Customers" table:

CustomerID CustomerName ContactName Address City PostalCode Country


1 Alfreds Futterkiste Maria Anders Obere Str. 57 Berlin 12209 Germany

Ana Trujillo Avda. de la


México
2 Emparedados y Ana Trujillo Constitución 05021 Mexico
D.F.
helados 2222
Antonio Moreno Antonio México
3 Mataderos 2312 05023 Mexico
Taquería Moreno D.F.

And a selection from the "Orders" table:

OrderID CustomerID EmployeeID OrderDate ShipperID


10308 2 7 1996-09-18 3
10309 37 3 1996-09-19 1
10310 77 8 1996-09-20 2

Return all customers with orders (10 marks)

Q5. What is null value? Write down example for check a value for null using SQL Select statement.
(10 marks)

Q6. Explain the concept of joins using set oriented venn diagrams (20 marks)

Q7. Show an example to show the usage of dual table (10 marks)

You might also like