DBMS Ia2
DBMS Ia2
3. Explain the relational algebra operation for set theory with examples.
6 Explain with examples, the basic constraints that can be specified when a
database table is created in SQL.
iv) List total sales amount, total items, average sale amount of all items.
DEPT(DNum,Dname,MgrSSN,Dno)
DEPT_LOC(Dnum,Dlocation)
DEPENDENT(ESSN,Dep_name,Sex)
WORKS_ON(ESSN,Pno,Hours) PROJECT(Pname,Pnumber,Plocation,Dnum)
(i)Retrieve the name, address, salary of employees who work for the
Research Department.
(ii) find the names of employees who work on all projects controlled by
department Number4.
Works(Pname,Cname,salary)
Lives(Pname,Street,City)
Manager(Pname,Mgrname)
i) Find the names of all persons who live in the city Bangalore.
ii) Retrieve the names of all person of “Infosys” whose salary is
between Rs .50000
iii)Find the names of all persons who lives and work in the same city
iv)List the names of the people who work for “Tech M” along with the
cities they live in.
(i) SELECT
(ii) ALTER
(iii) UPDATE
i) List the names of the people who work for the Company ‘Wipro’
along with the cities they live in.
ii) Find the names of the persons who do not work for ‘Infosys’.
iii) Find the people whose salaries are more than that of all the ‘Oracle’
employees.
iv) Find the persons who work and live in the same
City.
iv) Find the names of the companies that are located in every city
where the Company Infosys is located.
Company(company_name, city)
Manages(employee_name, manager_name)
i) Find the names, street address, and cities of residence for all
employees who work for ‘First Bank Corporation’ and earn more
than $10,000.
ii) Find the names of all employees in the database who do not
work for ‘First Bank Corporation’. Assume that all people work for
exactly one company.
iii) Find the names of all employees in the database who earn more
than every employee of ‘Small Bank Corporation’. Assume that
all people work for at most one company.
iv) Find the name of the company that has the smallest payroll.
iv) Find the names of all employees in the database who live in the
same cities and on the same streets as do their managers.
Emp (Fname, Lname, SSN, bdate, address, gender, salary, superSSN, dno)
i) Retrieve the name and address of all employees who work for
‘sports’ department.
ii) Retrieve each department number, number of employees and their
average salary.
iii) List the project number, controlling department number and
department manager’s last name, address and birthdate.
iv) List female employees from dno = 20 earning more than 50000.
Module:3
3 What are assertions and triggers in SQL? Write a SQL program to create an
assertion to specify the constraint that the salary of an employee must not
be greater than the salary of the department. The employee works for in the
COMPANY database.
4 Explain cursors and its properties in embedded SQL with suitable example.
9 How do you create a view in SQL? Give examples. Can you update a view
table? If yes, how? If not, why not? Discuss.
i) JDBC
ii) Correlated queries
iii) Stored Procedure
iv) Schema change statements in SQL.
i) Nested queries
ii) Aggregate functions
iii) Triggers
iv) Views and their updability
v) Schema change statements
13 Draw and explain 3-tier Architecture and technology relevant to each tier.
Write the Advantages of 3- tier architecture.
i) JDBC
ii) Correlated nested queries
iii) Stored Procedures
iv) Schema change statements in SQL
17 Create an HTML form to collect user ID and password fields and it also has
to have two buttons: one for reset and another for login.
19 Describe the six clauses in the syntax of an SQL retrieval query. Show
what type of constructs can be specified in each of the six clauses. Which of
the six clauses are required and which are optional?
Find all loan numbers for loans made at Cantonment branch with loan amounts greater
than 20,000.
Find the names of all customers whose street address includes 'Main'.
Find the average balance for each branch, if the average balance is greater than 12,000.
Find the names of all customers who have an account at all the branches located in
"Mysore".
Find all customers who do not have a loan at the bank, but do have an account.
21 Illustrate aggregate functions in SQL.
22 Define Database stored procedure. Explain creating and calling stored
procedure with example.