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

dbms Assign

Uploaded by

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

dbms Assign

Uploaded by

surykant4102
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 75

ASSIGNMENT- 01

Q.1 Using the following database:-


1. Colleges (cname , city , address , phone , afdate )
2. Staffs (sid , sname , saddress , contacts )
3. StaffJoins (sid , cname , dept ,DOJ , post ,salary)
4. Teachings (sid , class , papered , fsession ,tsession)
5. Subjects (paperid, subject ,paperno , papername )

SQL statement for the following-

Part-I

a.Create the above tables with the given specifications and


constraints.

[1]
[2]
b.Insert about 10 rows as are appropriate to solve the following
queries.

[3]
Output:-

[4]
Output:-

[5]
Output :-

[6]
Output:-

[7]
Output:-

c. List the names of the teachers teaching computer subjects.

d.List the names and cities of all staffs working in your college.

[8]
e. List the names and cities of all staffs working in your college who earn
more than 15000.

f. Find the staffs whose names start with ‘K’ or ‘R’ and ends with ‘A’
and/or 7 characters long.

g. Find the staffs whose date of joining is 2005.

[9]
h. Modify the database so that staff N1 now works in C2 college.

i. List the names of subjects , which TI teaches in this session.

j. Find the classes that TI do not teach at present session.

[10]
PART-II
a. Find the Colleges who have most number off staffs.

b. Find the staffs that earn a higher salary who earn greater than average
salary of their college.

c. Find the colleges whose average salary is more than average salary of
C2.

d. Find the college that has the smallest payroll.

[11]
e. Find the colleges where the total salary is greater than the average
salary of all colleges.

f. List the maximum, average, minimum salary of each college.

[12]
PART III
a. List the names of the teachers, departments teachings in more than
one department.

b. Acquire details of staffs by name in college or each college.


1.Details of staffs by name in a college.

2. Details of staffs by name each college.

[13]
d.Give all Principals a 10% rise in salary unless their salary becomes
greater than 20,000 in such case give 5% rise.

e.Find all staffs that do not work in same cities as the colleges they
work.

f.List names of employees in ascending order according to salary who


are working in your college

or all colleges.

[14]
Part-IV
a. Create a view having fields sname ,cname , dept , DOJ, and post.

b. Create a view consisting of cname, average salary and total salary of all
staff in that college.

[15]
c. List the staff names of a department using above views.

AUTHOR NAME:- SURYKANT DEWANGAN

DATE:- 01-10-2021

PATH :-C:\ORACLE\SQL\ASSING1

[16]
ASSIGNMENT NO -02

Q.2 Create the following database:-

1. Enrollment(enrollno ,name ,gender , DOB ,


address ,phone)
2. Admission(admno ,enrollno ,course
yearsem ,date ,cname)
3. Colleges(cname ,city ,address ,phone ,afdate)
4. FeeStructure(course yearsem ,fee)
5. Payment(billno ,admno ,amount ,pdate ,purpose)

SQL statements for the following:-

Part-I
a. Create the above tables with the given specifications
and constraints.

[17]
[18]
b. Insert about 10 rows as are appropriate to solve the
following queries.

Output:-

[19]
Output:-

[20]
Output:-

[21]
Output:-

[22]
[23]
Output:-

c. Get full detail of all students who took admission this year
class wise.

d. Get detail of students who took admission in Bhilai colleges.

[24]
e. Calculate the total amount of fees collected in this session:
i) By your college

[25]
ii) By each college

iii) By all colleges

PART-II
a. List the students who have not payed full fee:-
i) in your college

ii) in all colleges

[26]
b. List the number of admissions in your class in every year.

c. List the students in the session who are not in the colleges in
the same city as they live in.

d. List the students in colleges in your city and also live in your
city.

AUTHOR NAME:-SURYKANT DEWANGAN

DATE:-07-10-2021

PATH :-C:\ORACLE\SQL\ASSING2

[27]
ASSIGNMENT NO - 03

Q.3.Create the following database:-

1. Subject(paperid ,subject ,paper ,papername)


2. Test(paperid ,date ,time ,max ,min)
3. Score(rollno ,paperid ,marks ,attendence)
4. Students(admno ,rollno ,class ,yearsem)

SQL statements for the following:-

a. Create the above tables with the given specifications


and constraints.

[28]
b. Insert about 10 rows as are appropriate to solve the
following queries.

[29]
Output:-

[30]
Output:-

[31]
Output:-

[32]
Output:-

C. List the students who were present in a paper of


subject.

[33]
d. List all roll numbers who have passed in first division.

e. List all students in BCA-II who have scored higher


than average in every college.

[34]
f .List the highest score, average and minimum score in
BCA-II in your college.

AUTHOR NAME:- SURYKANT DEWANGAN

DATE:- 11-10-2021

PATH :-C:\ORACLE\SQL\ASSING3

[35]
ASSIGNMENT NO - 04

Q.4. Using the following database

1. Colleges (cname, city ,address ,phone ,afdate)


2. Staffs (sid ,sname ,saddress ,contacts)
3. StaffJoins(sid ,cname, dept ,DOJ ,post ,salary)
4. Teachings (sid, class ,paperid , fsession ,tsession)
5. Subjects (paperid ,subject , paperno, papername)

SQL statements for the following:-

a. Create the above tables with the given specifications


and constraints.

[36]
[37]
b. Insert about 10 rows as are appropriate to solve the
following queries.

[38]
Output:-

[39]
Output:-

[40]
Output:-

[41]
Output:-

[42]
Output:-

c. List the names of the teachers teaching computer


subjects.

d. List the names and cities of all staff working in your


college.

[43]
e. List the names and cities of all staff working in your
college who earn more than 15,000.

AUTHOR NAME:- SURYKANT DEWANGAN

DATE:- 13-10-2021

PATH :-C:\ORACLE\SQL\ASSING4

ASSIGNMENT NO - 05

Q.5. Using the following database

1. Colleges (cname, city ,address ,phone ,afdate)


2. Staffs (sid ,sname ,saddress ,contacts)
3. StaffJoins(sid ,cname, dept ,DOJ ,post ,salary)
4. Teachings (sid, class ,paperid , fsession ,tsession)
5. Subjects (paperid ,subject , paperno, papername)

SQL statements for the following:-

a.Find the staffs whose name start with ‘K’ or ‘R’ and ends
with ‘A’ and/or 7 characters long.

[44]
b. Find the staffs whose date of joining is 2005.

c. Modify the database so that staff N1 now works in


C2 college.

d. List the names of subjects which TI teaches in this


session or all session.

[45]
AUTHOR NAME:- SURYKANT DEWANGAN

DATE:- 18-10-2021

PATH:-C:\ORACLE\SQL\ASSING5

ASSIGNMENT NO - 06

Q.6. Using the following database

1. Colleges (cname, city ,address ,phone ,afdate)


2. Staffs (sid ,sname ,saddress ,contacts)
3. StaffJoins(sid ,cname, dept ,DOJ ,post ,salary)
4. Teachings (sid, class ,paperid , fsession ,tsession)
5. Subjects (paperid ,subject , paperno, papername)

SQL statements for the following:-

a. Find the classes that T1 do not teach at present


session.

[46]
b. Find the college who have most number of staffs.

c. Find the staffs who earn a higher salary who earn


greater than average salary of their college.

d. Find the colleges whose average salary is more than


average salary of C2.

e.
e. Find the college that has the smallest payroll.

[47]
f. Find the colleges where the total salary is greater
than the average salary of all colleges.

g. List maximum , average , minimum salary of each


college.

[48]
AUTHOR NAME:- SURYKANT DEWANGAN

DATE:- 21-10-2021

PATH :-C:\ORACLE\SQL\ASSING6

ASSIGNMENT NO - 07

Q.7.Using the following database -

1. Colleges (cname, city ,address ,phone ,afdate)


2. Staffs (sid ,sname ,saddress ,contacts)
3. StaffJoins(sid ,cname, dept ,DOJ ,post ,salary)
4. Teachings (sid, class ,paperid , fsession ,tsession)
5. Subjects (paperid ,subject , paperno, papername)

SQL statements for the following:-

a. Find the classes that T1 do not teach at present


session.

[49]
b. List the names of the teachers , departments teaching
in more than on departments.

c. Acquire details of staffs by name in a college or


each college.
1. Details of staffs by name in a college.

2. Details of staffs by name each college.

[50]
d. Give all principals a 10% rise in salary unless their
salary becomes greater than 20,000 in such case give
5% rise.

f. find all staff who donot work in same cities as the


college they work.

[51]
g. List name of employees in ascending order
according to salary who are working in your college
or all colleges.

AUTHOR NAME:- SURYKANT DEWANGAN

DATE:- 25-10-2021

PATH :- C:\ORACLE\SQL\ASSING7

ASSIGNMENT NO.-08

Q.8. Using the following database

1. Colleges (cname, city ,address ,phone ,afdate)


2. Staffs (sid ,sname ,saddress ,contacts)
3. StaffJoins(sid ,cname, dept ,DOJ ,post ,salary)
4. Teachings (sid, class ,paperid , fsession ,tsession)
5. Subjects (paperid ,subject , paperno, papername)

[52]
SQL statements for the following:-

A. Find the classes that T1 do not teach at present


session.

B. Create a view having fields sname ,cname , dept , DOJ


and post .

C. create a view having fields sname,cname,dept,doj and


post.

[53]
D.Create a view consisting of cname, average salary
and total salary of all staffs in that college.

E. List the staffs names of a department using the


above views.
[54]
AUTHOR NAME:- SURYKANT DEWANGAN

DATE:- 28-10-2021

PATH :-C:\ORACLE\SQL\ASSING8

ASSIGNMENT NO - 09

[55]
Q.9. Create the following database:-

1. Enrollment(enrollno ,name ,gender , DOB ,


address ,phone)
2. Admission(admno ,enrollno ,course
yearsem ,date ,cname)
3. Colleges(cname ,city ,address ,phone ,afdate)
4. FeeStructure(course yearsem ,fee)
5. Payment(billno ,admno ,amount ,pdate ,purpose)

SQL statements for the following:-

a. Create the above tables with the given


specifications and constraints.

[56]
[57]
b. Insert about 10 rows as are appropriate to solve
the following queries.

Output:-

[58]
Output:-

[59]
Output:-

[60]
Output:-

[61]
Output:-

c. Get full detail of all students who took admission


this year class wise.

[62]
d. Get detail of students who took admission in Bhilai
colleges.

e. Calculate the total amount of fees collected in this


session:

i) By your college

ii) By each college

[63]
iii) By all colleges

AUTHOR NAME:- SURYKANT DEWANGAN

DATE:- 08-11-2021

PATH :-C:\ORACLE\SQL\ASSING9

[64]
ASSIGNMENT NO - 10

Q.10. Create the following database:-

1. Enrollment(enrollno ,name ,gender , DOB ,


address ,phone)
2. Admission(admno ,enrollno ,course
yearsem ,date ,cname)
3. Colleges(cname ,city ,address ,phone ,afdate)
4. FeeStructure(course yearsem ,fee)
5. Payment(billno ,admno ,amount ,pdate ,purpose)

SQL statements for the following:-

a. List the students who have not payed full fee:-


i) in your college

ii) in all colleges

[65]
b. List the number of admissions in your class in every
year.

c. List the students in the session who are not in the


colleges in the same city as they live in.

d. List the students in colleges in your city and also


live in your city.

[66]
e. list the students in colleges in your city and also
live in your city.

f. list the students in colleges in your city and also


live in your city.

AUTHOR NAME:- SURYKANT DEWANGAN


[67]
DATE:- 12-11-2021

PATH :-C:\ORACLE\SQL\ASSING10
ASSIGNMENT NO - 11

Q. 11.Create the following database:-

1. Subject(paperid ,subject ,paper ,papername)


2. Test(paperid ,date ,time ,max ,min)
3. Score(rollno ,paperid ,marks ,attendence)
4. Students(admno ,rollno ,class ,yearsem)

SQL statements for the following:-

a. Create the above tables with the given specifications


and constraints.

[68]
b. Insert about 10 rows as are appropriate to solve the
following queries.

[69]
Output:-

[70]
Output:-

[71]
Output:-

[72]
Output:-

c. List the students who were present in a paper of


subject.

d. List all roll numbers who have passed in first


division.

[73]
e. List all students in MCA-II who have scored higher
than average :-
i) in your college.

ii) in every college

f. List the highest score, average and minimum score in


MCA-II
i) in your college

[74]
ii) in every college

AUTHOR NAME:-SURYKANT DEWANGAN

DATE:- 16-11-2021

PATH :-C:\ORACLE\SQL\ASSINGQ11

[75]

You might also like