0% found this document useful (0 votes)
20 views3 pages

Queries

Uploaded by

bint e zainab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views3 pages

Queries

Uploaded by

bint e zainab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Department

INSERT INTO department( dept_name,dept_no,min_salary,max_salary)

VALUES("Finance",10,12000,18000);

INSERT INTO department( dept_name,dept_no,min_salary,max_salary)

VALUES("IT",20,15000,25000);

INSERT INTO department( dept_name,dept_no,min_salary,max_salary)

VALUES("R&D",30,14000,20000);

INSERT INTO department( dept_name,dept_no,min_salary,max_salary)

VALUES("Marketing",40,11000,15000);

INSERT INTO department( dept_name,dept_no,min_salary,max_salary)

VALUES("Management",50,10000,18000);

employee

INSERT INTO
employee(eid,fname,lname,emp_comm,emp_salary,start_date,today_date,dept_no,grade)

VALUES (11,"Akram","ali",10000,40000," February 1998","Feb 2021",1122,14);

INSERT INTO
employee(eid,fname,lname,emp_comm,emp_salary,start_date,today_date,dept_no,grade)

VALUES (22,"Asif","ali",8000,35000,"April 1998","Feb 2021",1133,14);

INSERT INTO
employee(eid,fname,lname,emp_comm,emp_salary,start_date,today_date,dept_no,grade)

VALUES (33,"Ahmed","Raza",0,25000,"March 1998"," Feb 2021",1144,"NULL");

INSERT INTO
employee(eid,fname,lname,emp_comm,emp_salary,start_date,today_date,dept_no,grade)

VALUES (44,"Sadia","aalam",12000,44000,"Oct 2018"," Feb 2021",1155,15);

INSERT INTO
employee(eid,fname,lname,emp_comm,emp_salary,start_date,today_date,dept_no,grade)

VALUES (55,"Hafsa","iqbal",15000,47000,"May 1998"," Feb 2021",1166,16);


SELECT fname,lname

FROM employee

WHERE start_date-today_date

SELECT fname,lname,dept_name FROM employee,department WHERE lname LIKE 'a%'

SELECT LAST_NAME,ROUND(MONTHS_BETWEEN(SYSDATE,HIRE_DATE)) AS "MONTHS_WORKED" FROM


EMPLOYEES ORDER BY MONTHS_WORKED;

#1

SELECT fname,lname,salary,emp_comm

FROM employee

WHERE emp_comm!=0

ORDER BY salary,emp_comm DESC;

SELECT *

FROM student

WHERE std_name LIKE '__d%' OR std_name LIKE '__b%' OR std_name LIKE '__c%'

SELECT fname,lname,eid,start_date

FROM employee
WHERE start_date BETWEEN " Feb " AND "May "

ORDER BY start_date ASC;

May 1998

You might also like