Set1 DBT Lab Paper

You might also like

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

CENTRE FOR DEVELOPMENT OF ADVANCED COMPUTING

Advanced Computing Training School

Course Name: E Diploma in Advanced Computing


Batch: May2021
Module Name: Database technologies Date: _____________
Student Name: _____________________________ Max Marks: 40 Marks
PRN No: ___________________________________ Duration: 2 Hours
_________________________________________________________________________________

SET 1
Section 1:
1. Write a query to fetch ALTERNATE records from a EMP table. (EVEN Numbered Record).
2. Find the employee details who have 3rd highest salary
3. Select all employee records whose name starts with 'S' and its length of name is 6 char.
4. Write a query to display all employees who are hired in the year 1981.
5. Print the date, One month and 15 days after today’s date.
6. Display the Name, Employee Number, Designation and Salary of those Employees who earn a monthly
salary of not less than 1000 and not more than 2000.
7. Display the employee Name, Job and department name of all the Employees who either work in
Department 30 or in Department 40.
8. Count the employees whose names start with ‘A’ or ‘M’.
9. Display employee name and his phone number in this format ******4228.
10. Display all employees who does not have any type of cards. (Use emp and emp_cards table)

Section 2:
 Create a LOGIN table (username, password, and email). Write a procedure (named addUser) to pass the
username, password, and email-ID through the procedure and store the data in the LOGIN table, if the
username is already present in the table display a message “Use already present”.

 Create a LOG table having following columns (id (auto_increment), curr_date, curr_time, and message).
Write a procedure (named checkUser) to pass the email-ID as an input, check whether passed email-ID is
available in LOGIN table or not available. If the email-ID is available then display the username and his
password. If the email-ID is not available then, insert (curr_date, curr_time, and

Marks distribution
Section-1 each Q is for 2 marks Total 20 marks
Section-2 each Q is for 10 marks Total 20 marks

SET 2
Section 1:

1. Display employee information in ascending order of year.


2. Write a query to fetch ALTERNATE records from a EMP table. (ODD Numbered Record).
3. Calculate the avg, min and max salary of those groups of employees having the job as CLERK or
MANAGER.
4. Display the name of job where least number or persons are working.
5. Write an SQL command that displays 2nd lowest salary paid.
6. Write a query to display ename, job, sal and comm, if the comm is null then display “No commission”.
7. Find department-wise average salary where more than three employees are working.
8. Display all employees whose salary is more than 'BLAKE' salary.
9. Display all employees whose salary > lowest salary and sal < highest salary of all employees.
10. Display in which year max employee have joined.

Section 2:
 Write a procedure the print all employee details using cursors.

 Create a new table called STUDENT having following columns (studentID, namefirst, namelast, DOB, and
emailID). Write a function names myAutoNumber to return auto generate number and use that number as
studentID and insert the value in studentID column. Check if namefirst and namelast is already present in
the table, then display a message “Student exists”.

Marks distribution
Section-1 each Q is for 2 marks Total 20 marks
Section-2 each Q is for 10 marks Total 20 marks

Evaluation of Lab Exam should be based on the following criteria

Criteria Max Marks


Marks Obtain
Algorithm Documentation of Algorithm and Flowchart 2
Program adheres to the algorithm and flowchart 2
Efficiency Program is using only the required number of variables 2
/conditions/loops/pointers etc and is optimal
Correctness The program produces desired output for a given input 25
The program handles all valid and Invalid inputs 5
Software The program has meaning variable/function names 2
Engineering The program is commented properly (At least 20% of the
Principles code should be commented) 2
Total  Marks 40

cccccccc

_____________________ _________________________ __________________


Signature of Student Signature of Evaluator Signature of Coordinator

Page 1 of 1

You might also like