Professional Documents
Culture Documents
Set1 DBT Lab Paper
Set1 DBT Lab Paper
Set1 DBT Lab Paper
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:
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
cccccccc
Page 1 of 1