0% found this document useful (0 votes)
12 views8 pages

Dbmsfile Final1

Uploaded by

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

Dbmsfile Final1

Uploaded by

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

Week 9

Create the Student table, Register table and Program table. Student table (Roll no. as primary key,
Name as not null, city) Program table (Program ID as primary key, Program Name as not null,
Program Fee not less than 10000, Department) Register table (Program ID and Roll no. as primary
composite key)

Display the details of students who are registered in the "MCA" program.

.Display the list of all students, who are registered in at least one program.

Display the details of programs that have fees greater than the average fee.

Ansh Raj Roll No. 11 Sec- G1


Display the names of students who are registered in a program having fees less than 30000.

Display the details of students who have not registered in any course

Display the names of programs in which a maximum number of students are registered

Display the names of programs in which a minimum number of students are registered.

Ansh Raj Roll no.11 Sec-G1


Find out the second minimum salary of an employee.

Find out the second minimum salary of an employee without using limit, dense range, and order by
clause.

Find out the third maximum salary of an employee.

Find out the third maximum salary of an employee without using limit, dense range, and order by
clause.

Display the names and salaries of employees who earn more than the average salary of their
department.

Ansh Raj Roll no. 23 Sec- G1


Fetch the list of the employee who belongs to the same department but eams less than the
second employee

Display the names of employees who are older than their colleagues in the same department.

Ansh Raj Roll no. 23 Sec- G1


Create the table to keep track of customer records and their order. Customer table (Name as Not
null, Customer_id as primary key. Age, Address)

Order table (Customer_id, order_id, date).

Display the name of the city as "destination" for customers who have placed orders.

Apply the cross join and check the results.

Ansh Raj Roll no. 11 Sec -G1


Display the customer names and order IDs for customers who have placed orders from the same
city.

Ansh Raj Roll no. 11 Sec -G1


WEEK- 7
 Create two tables named as employee and department with the given constraints and
attributes: Employee table-( (Employee Id. (Primary key), Department ID, Name, Age
(check>18), Salary, City)
 Department table (Department Id, and Department name)

 Display the details of employees along with their corresponding department names.

 Print the names of employees who are not assigned to any department.

Ansh Raj Roll no . 11 Sec -G1


 Print the employee names and department names for employees whose salary is greater
than 25,000. (Using left join).

 Display the names of employees along with their department names for those who
are not assigned to any department.

 Print the employee names and their corresponding department names for employees
with a salary greater than 25,000. (Using right join).

 Display the names of departments along with the names of employees who are older
than 30 years.

Ansh Raj Roll no. 23 Sec -G1

You might also like