Anda di halaman 1dari 4

/*******************************************************************************

*************************************/
/*
*/
/*
Assignment
# 1
*/
/*
Dated
20-May-2014
*/
/*
Submission Date 25-May-2014
*/
/*
*/
/*******************************************************************************
*************************************/
General Instruction
a)
b)
c)
d)
Q1.

spool result of every query as <Student Name>-SQL-Q?.txt


make sure resulted row(s) should be in one line.
spool file should be created with query
spool file should be generated even no rows selected.

Create SQL statment to retrieve following information


a)
b)
c)
d)

Employee Name.
Hire date
Salary
Employee Number

Conditions
a) Only those rows selected where salary less then 500
Q2.

Create SQL statment to retrieve following information


a)
b)
c)
d)

Employee Name.
Hire date
Salary
Employee Number

Conditions
a) Only those rows selected where salary less then 1000 and grea
ter then equal to 500
Instructions
i. use "BETWEEN" clause
Q3.

Create SQL statment to retrieve following information


a)
b)
c)
d)

Employee Name.
Hire date
Salary
Employee Number

Conditions
a) Only those rows selected where salary less then 1000 and grea
ter then equal to 500
Instructions
i. use "AND" or "OR" operator
Q4.

Create SQL statment to retrieve following information


a)
b)
c)
d)

Employee Name.
Hire date
Salary
Employee Number

Conditions
a) Only those rows selected where length of Employee name is 4
digits.
Instructions
i. use "LIKE" operator

Q5.

Create SQL statment to retrieve following information


a)
b)
c)
d)

Employee Name.
Hire date
Salary
Employee Number

Conditions
a) Only those rows selected where Employee name having alphabet
"O" and after that only three
more alphabets in his name. (for example "ALLOVER")
Instructions
i. use "LIKE" operator
Q6.

Create SQL statment to retrieve following information


a)
b)
c)
d)

Employee Name.
Hire date
Salary
Employee Number

Conditions
a) Only those rows selected where third letter of Employee name
should be "L"
and fifth letter should be "N".
Q7.

Create SQL statment to retrieve following information


a) Employee Name.

b)
c)
d)
e)

Hire date
Salary
Employee Number
Department Number

Conditions
a) Only those rows selected where department number 10 or 20
Instructions
i. use "IN" Operator
Q8.

Create SQL statment to retrieve following information


a)
b)
c)
d)
e)
f)
g)

Conditions
a)
b)
c)
d)
ssion amount.
Q9.

Employee Name.
Hire date
Salary
Employee Number
Department Number
Commission
Salary and commission

Only those rows selected where department number 10


Salary greater then 1000
Commission should not be null
"Salary and commission" Column should sum of Salary and commi

Create SQL statment to retrieve following information


a)
b)
c)
d)
e)
f)
g)

Employee Name.
Hire date
Salary
Employee Number
Department Number
Commission
Salary and commission

Conditions
a) All rows selected excluding department number 10
b) Salary greater then 1000
c) "Salary and commission" Column should sum of Salary and commi
ssion amount.
d) First letter of Employee name should be in upper case while o
ther letters in small case.
Q10.

Create SQL statment to retrieve following information


a)
b)
c)
d)
e)
f)
g)

Employee Name.
Hire date
Salary
Employee Number
Department Number
Commission
Salary and commission

Conditions
a) All rows selected where employee name is "ALLEN"
b) Department number 10 or 20
c) Salary greater then 1000

Anda mungkin juga menyukai