Works - On Database: 1. Create The Following Table As It Is: Using Basic Structured Query Language Try 1 LO2:-lo3

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

WDDBA

UC
Module Title LO2 :-.Write SQL statements that use aggregation and filtering
Using Basic
lo3:-Write SQL statements that use functions
Structured
Query Language
Try 1

Works_On Database:
1. Create the following table as it is

emp (eno, ename, bdate, title, salary, dno)


proj (pno, pname, budget, dno)
dept (dno, dname, mgreno)
workson (eno, pno, resp, hours)

2. Write an SQL query that returns the project number and name for projects with a
budget greater than $100,000.

3. Write an SQL query that returns all works on records where hours worked is less than 10
and the responsibility is 'Manager'.

4. Write an SQL query that returns the employees (name only) in department 'Dno'
ordered by decreasing salary.

5. Write an SQL query that returns the departments (all fields) ordered by ascending
department name.

6. Write an SQL query that returns the project name, hours worked, and project number for
all works on records where hours > 10.

7. Write an SQL query that returns the project name, department name, and budget for all
projects with a budget < $50,000.

8. Write an SQL query that returns the employee numbers and salaries of all employees in
the 'Consulting' department ordered by descending salary.
1) Create table examination and insert the following data.

RegNo Name CC Phy Che Mat Cs sum City


101 Abdu C1 98 100 97 99 394 Hawasa
102 Banu C2 38 50 37 49 174 Hawsa
103 Chale C2 100 100 97 99 396 Mysuru
104 John C3 78 80 67 79 304 Arsi
105 Klem C1 88 80 91 79 338 hawasa
106 Rahel C2 100 98 97 79 374 Hawasa
107 Sisay C3 47 60 56 78 241 Arsi
108 Tilahun C3 33 34 77 28 172 Arasikere
109 Umar C2 100 98 97 79 374 Hassan
110 Vensia C3 47 60 56 78 241 Belur

1. COUNT(RegNo FROM EXAMINATION


2. Calculate AVG of (CS) FROM EXAMINATION
3. Calculate SUM of (Phy) FROM EXAMINATION
4. Calculate MAX (Phy) FROM EXAMINATION
5. Calculate MIN (Phy) FROM EXAMINATION

You might also like