Search Database SQL / Scripts


  Help us in improving the repository. Add new Queries/Scripts through 'Submit Database SQL / Scripts ' link.





Database SQL / Scripts for '#Select' - 6 Query/Script(s) found

 Sample 1. Get all records that were created in last 10 days

Select * from TABLE_NAME where CREATED_DATE_COLUMN >= SYSDATE - 10

   Like      Feedback     select  SQL  SYSDATE  Date greater than


 Sample 2. Get count of Employees having salary greater than 1000

Select count(*) from EMPLOYEE e where e.salary > 1000 

   Like      Feedback     count   count of employees having salary greater than   select   query   sql


 Sample 3. Get all records having date since a particular date

select * from EMPLOYEE where JOINING_DATE between to_date('01-MAY-14', 'DD-MON-YY') and SYSDATE

   Like      Feedback     select  query  to_date  sysdate  get records between 2 dates  get records for last 2 years


 Sample 4. Display pairs of Department Names where first dept name has lesser employees than later

Select D1.name , D2.name from Dept D1, Dept D2 where D1.employee_count < D2.employee_count 

   Like      Feedback     Display pairs of Department Names where first dept name has lesser employees than later   self join  select statement   example of self join


Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner
 Sample 5. Get all Departments having no employees, Usage of not in

Select DEPT_NAME from DEPT where DEPT_ID not in ( Select distinct DEPT_ID from EMPLOYEE ) 

   Like      Feedback     Not in   Select


 Sample 6. Select Employee names having salary between 2000 to 3000 USD

Select EMPLOYEE_NAME from EMPLOYEE where SALARY between 2000 and 3000

   Like      Feedback     between  select



Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner