P. 1
Database Fundamentals

Database Fundamentals

|Views: 72|Likes:
Published by mmmaheshwari
DB2 database
DB2 database

More info:

Published by: mmmaheshwari on Mar 02, 2013
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

04/07/2015

pdf

text

original

1. Create an SQL PL stored procedure using IBM Data Studio. Using the DB2
SAMPLE database, the procedure should take an employee ID as input parameter
and retrieve all the columns for the employee with this employee ID from the
EMPLOYEE table.

2. Create a UDF for the same requirement as in exercise (1).

3. Create a SQL function which does not accept any input parameters and returns a
day name as string (like Monday, Tuesday and so on) by picking the system’s
current date as the source date.

4. Create a SQL function which accepts a date as an input parameter and returns a
day name as a string (like Monday, Tuesday and so on) of the input date.

5. Create a procedure which does not accept any input parameters and returns the
number of tables in the database.

6. Create a procedure which accepts one table name as an input parameter and
returns the number of rows in that table.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->