0% found this document useful (0 votes)
14 views2 pages

Worksheet Week2

these are sql basic questions

Uploaded by

himansipowers
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views2 pages

Worksheet Week2

these are sql basic questions

Uploaded by

himansipowers
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

DBMS Lab Task

WEEK-2 SQL Logical Operators and Clauses


in, between, not, like, distinct, and , or
1. Create a table called Employee and Apply the following commands.(Ignore if already
created the table)
Name Type
Empno Number
Ename Varchar2(20)
Job Varchar2(20)
Mgr Number
Sal Number
a. Display Empno,Ename whose salary between 15000 to 20000.
b. Display Ename whose names start with ‘A’.
c. Display Ename whose names start with ‘P’ and ends with ‘S’
d. Display Ename whose names start with ‘J’ and must have 6 characters only.
e. Add Jdate Column to the table represents the joining data, give data type for the column as date.
f. Display Empno who joins between ’12-02-2020’ and ’15-03-2021’.
g. Display distinct Empnames whose name ends with ‘u’
h. Increment Employee Salary 1000/- who who joins between ’12-02-2020’ and ’15-03-2021’.
2. Create a table called department and Apply the following commands.(Ignore if already
created the table)
Name Type
Deptno Number
Deptname Varchar2(20)
location Varchar2(20)
a. Display the Deptno, Deptnames whose location in Hyderabad, Vizag, Vijayawada, Guntur.
b. Display Deptno which are located in Guntur and Vijayawada.
c. Display Deptno which are located in hyderabad or bangalore.

Dept. of CSE, NIT Andhra Pradesh 1


d. Display Deptnames which are not located in vizag and Vijayawada.
e. Display location whose deptname is ‘Biotechnology’ and deptno is 100.
f. Display deptnames whose name starts with ‘C’ and location is ‘Hyderabad.
g. Display Deptnos which are not located in Vizag .
h. Display locations which are not started with ‘h’.

ANY&ALL
3. Create a tables called student and teacher and Apply the following commands.(Ignore if
already created the table)
* student table
Name Type
sno int(10)
sname Varchar2(20)
sage int(10)
*teacher table
Name Type
tno int(10)
tname Varchar2(20)
tage int(10)
a. Display tno,tname whose teacher age is greater than any of the student age.
b. Display tno,tname whose teacher age is greater than All the student age.
c. Display younger teachers whose age is less than Any of the students age.
d. Display youngest teachers whose age is less than All of the students age.
e. Display youngest student names whose age >any teachers age.

Dept. of CSE, NIT Andhra Pradesh 2

You might also like