Share

Search Database SQL / Scripts


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





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

 Sample 1. Oracle - Add New Date Column to a Table

ALTER TABLE TABLE_NAME
ADD NEW_COLUMN DATE;

   Like      Feedback     DDL  alter table  add a column   add a new column  sql


 Sample 2. Count number of records / rows in a table

select count(*) from TABLE_NAME

   Like      Feedback     count number of rows  count rows  count(*)  SQL


 Sample 3. Join Tables

select * from TABLE1 join TABLE2 on COLUMN_TABLE1 = COLUMN_TABLE2 where OTHER_COLUMN_TABLE1 is not null

   Like      Feedback     join tables  sql  query


 Sample 4. SQL With Clause

with employee_dept_marketing as (

select * from EMPLOYEE

join DEPT on EMP_DEPT_ID = DEPT_ID

where DEPT_NAME = 'Marketing'

)

select PROFILE_NAME from PROFILE p

join employee_dept_marketing on PROFILE_ID = p.ID

where p.REQUIRED_EXPERIENCE > 10;

   Like      Feedback     sql with clause  with as


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 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 6. 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



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



comments powered by Disqus