Database Lab Task-02












Download All  Questions And SQL Files Import SQL To Your Database

Download Sql

Problem title: Design database schema and populate the database with appropriate
datasets.




Database Schema for a Employee-Pay scenario
employee(emp_id : integer, emp_name: string)
department(dept_id: integer, dept_name: string)
paydetails(emp_id : integer, dept_id: integer, basic: integer, deductions: integer, additions:
integer, DOJ: date)
payroll(emp_id : integer, pay_date: date)


For the above schema, perform the following—
1. Create the tables with the appropriate constraints.
2. List the employees working at the GIS department.
3. List all the employee names who joined after 1st January 2013
4. Give a names of the employees whose netsalary>10,000



Query-02

SELECT employee.e_id,e_name, dept_name FROM employee, department,paydetails WHERE 
employee.e_id=paydetails.e_id AND
department.dept_id=paydetails.dept_id
AND dept_name='GIS';


Query-03

SELECT e_name,doj FROM employee, department,paydetails WHERE 
employee.e_id=paydetails.e_id AND
department.dept_id=paydetails.dept_id

AND doj>='2013-01-01';

Query-04


SELECT e_name, basic+addition-deduction FROM employee,paydetails WHERE 

employee.e_id=paydetails.e_id 

AND basic+addition-deduction>10000;




Download Coding Interview Book and Get More Tutorials for Coding and Interview Solution: Click Here

Download System Design Interview Book and Get More Tutorials and Interview Solution: Click Here

Do you need more Guidance or Help? Then Book 1:1 Quick Call with Me: Click Here

Share on Google Plus

About Ashadullah Shawon

I am Ashadullah Shawon. I am a Software Engineer. I studied Computer Science and Engineering (CSE) at RUET. I Like To Share Knowledge. Learn More: Click Here
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment