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

Dbmspartbanswers

1. The document discusses relational algebra operations and provides examples. It also discusses distributed and client/server databases with examples. 2. It provides SQL queries for various questions involving employee, works, and company relations. 3. The document discusses triggers with examples and functions/procedures with examples from an attached PDF. It also provides SQL queries for additional questions on employee relations.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
146 views2 pages

Dbmspartbanswers

1. The document discusses relational algebra operations and provides examples. It also discusses distributed and client/server databases with examples. 2. It provides SQL queries for various questions involving employee, works, and company relations. 3. The document discusses triggers with examples and functions/procedures with examples from an attached PDF. It also provides SQL queries for additional questions on employee relations.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 2

1. With relevant examples discuss the various operations in Relational Algebra. (10) Refer book pageno- 89 to 98 2.

Explain Distributed and Client/Server database. (5) Refer book chapter 18.1.2,19 3. Consider the following relational database employee (employee-name, street, city) works ( employee-name, company-name, salary) company (company-name, city) manages (employee-name, manager-name) Give an expression in SQL to express each of the following queries : 1. Find the names and cities of residence of all employees who work for XYZ Bank. 2. Find the names, street address, and cities of residence of all employees who work for XYZ Bank and earn more than Rs. 10,000 per annum. 3. Find the names of all employees in this database who live in the same city as the company for which they work. 4. Find the names of all employees who live in the same city and on the same street as do their managers. (3+4+4+4 ) ANSWERS: 1. select e.employee-name,e.city from from employee e,works w where e.employeename=w.employee-name and w.company-name=XYZ; 2. select e.employee-name,e.street,e.city from employee e,works w where e.employeename=w.employee-name and w.company-name =XYZ and w.salary > =10000; 3. select e.employee name from employee e, works w, company c where e.employee name = w.employee name and e.city = c.city and w.company name = c.company name; 4. select P.employee name from employee P, employee R, manages M where P.employee name = M.employee name and M.manager name = R.employee name and P.street = R.street and P.city = R.city; 4. Explain with example Trigger.(7) Refer book chapter 6.4 5. Discuss in detail about functions and procedure with example.(8) Refer the Advanced sql pdf attached. 6. Consider the relational database employee (empname, street, city) works (empname, companyname, salary) company (companyname, city) manages (empname, managername). Give the SQL queries for each request. 1. Find the names of all employees who work for first bank Corporation. 2. Find the names, street addresses and cities of residence of all employees who work for first Bank Corporation and earn more than 200000 per annum. 3. Find the names of all employees in this database who live in the same city as the

company for which they work. 4. Find the names of all employees who earn more than every Employees of small Bank Corporation. (3+4+4+4) ANSWERS: 1. select e.employee-name from employee e ,works w where where e.employeename=w.employee-name and `company name = first bank Corporation; 2. same as 3rd ques->2 3. same as 3rd ques->3 4. select employee-name from works where salary >all (select salary from works where company-name =Small Bank Corporation) 5. What are nested queries? Explain with example. (7) Refer the sql pdf attached.

You might also like