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

DBMS - Assignment/Question/course - Stu - Regis - Assign

The document describes database tables for courses, students, and student registrations. It includes sample data and queries to retrieve information from the tables. The tables track course details like ID, name, duration and fees. Student details include ID, name, address and date of birth. Registrations link students to courses with the date joined. Queries demonstrate retrieving, updating, aggregating and joining data between the tables.

Uploaded by

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

DBMS - Assignment/Question/course - Stu - Regis - Assign

The document describes database tables for courses, students, and student registrations. It includes sample data and queries to retrieve information from the tables. The tables track course details like ID, name, duration and fees. Student details include ID, name, address and date of birth. Registrations link students to courses with the date joined. Queries demonstrate retrieving, updating, aggregating and joining data between the tables.

Uploaded by

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

Sheet1

Table Structure: COURSE

CourseID Number(4) – Primary Key


CourseNameVarchar2(20)
Duration Number
Fees Number(7,2)

Table Structure: STUDENT

StudId Number(4) – Primary Key


FirstName Varchar2(20)
LastName Varchar2(20)
Street Varchar2(20)
City Varchar2(20)
DOB Date

Table Structure:REGISTRATION

CourseID Number(4) – Foreign Key


StudId Number(4) – Foreign Key
DOJ Date

COURSE:
CourseId CourseName Duration Fees

1001 Java 4 5000


1002 C++ 2 4000
1003 Linux and C 3 4000
1004 Oracle 2 3000
1005 C Sharp 6 10000

STUDENT:
StudId FirstName LastName Street City DOB
3001 Dileep Kumar Jai Nagar Bangalore March 10, 1989
3002 Anand Kumar Indiranagar Bangalore January 19, 1988
3003 Bala Krishnan Annanagar Chennai January 3, 1990
3004 Gowri Shankar Gandhipuram Coimbatore December 22, 1987
3005 Priya Menon JPNagar Cochin February 12, 1990
3006 Prem Kumar Ramnagar Coimbatore May 17, 1987
3007 Rahul Dravid KKNagar Chennai October 8, 1987
3008 John David Mylapore Chennai September 15, 1990
3009 Abdul Rahman HAL Bangalore January 19, 1988

Page 1
Sheet1
REGISTRATION:
CourseId StudId DOJ
1001 3004 March 10, 2011
1001 3005 March 10, 2011
1002 3002 April 18, 2011
1002 3003 April 18, 2011
1002 3008 April 18, 2011
1003 3001 June 6, 2011
1003 3004 June 6, 2011
1003 3006 June 6, 2011
1004 3005 March 10, 2011
1004 3007 March 10, 2011
1004 3008 March 10, 2011
1005 3004 May 25, 2011
1005 3005 May 25, 2011

1 Add a field – Age Number(2) to the student table.


2 Add a constraint in course table to check the fees entered is greater than zero.
3 Calculate the value of the age field using the DOB Field.
4 Decrease the fees by Rs.500/- whose duration is lesser than or equal to 3 months
5 Delete the student record whose last name is David and the city is Chennai
6 Display firstname, lastname and concatenate them to display as fullname from student table.
7 Display the details of course C++ from the course table.
8 Display the details from the course table which has a fees of more than 4000.
9 Display the details from the course table which has a duration of 2 to 4 months.
10 Display the student details whose birthday lies in the months between apr and sep
11 Display course details, which has duration of 2 months and has a fees of more than 3000.
12 Display the details of the students whose Ids are 3002, 3004 and 3005 from student table.
13 Display the details from the student table who has lastname as Kumar
14 Display the details from student table whose firstname starts with A
15 Display the details from the student who come from bangalore and lastname as kumar
16 Display the details from the student whose street name ends with nagar.
17 Display the details of students Dileep and Abdul from the student table.
18 Display the details of eldest student.
19 Display the details of students whose id is other than 3004 and 3006 from student table.
20 Display maximum, minimum and average fees from course table.
21 Display the total number of students from student table.
22 Display the cities from student table and each city should be displayed only once.
23 Display all the student tdetails in the order of their dob is descending order.
24 Display total number of students who joined on 10-mar-2011.
25 Display first name in uppercase, lastname is lower case, city in initcap.
26 Display total number of students for each course.
27 Display student ids, who have joined for more than one course.
28 Display all students whose firstname is of 4 characters length.

Page 2
Sheet1
SUBQUERIES AND JOINS:

1 Display the course details whose fees is lesser than the maximum fees
2 Display the students who are elder than 'Balakrishnan'
3 Calculate the total fees collected from the student who are coming from city bangalore
4 Display the student firstname and the coursename for each student
5 Find the courses which has same duration
6 Display the completing date of each course using DOJ and duration
7 Display the second maximum fees
8 Display the studentid and the total fees paid by each student
9 Display the courseid, coursename and total fees collected from each course.

Page 3
Sheet1

Page 4
Sheet1

om student table.

ore than 3000.


student table.

Page 5
Sheet1

Page 6

You might also like