If You Are From The 09 Batch Then Read This >>

This Site is created for the Bharati Vidyapeeth's BCA 09 Batch..and hence everyone from you are requested to send your email ID at abhilash238650@gmail.com..Owner will send you a request to your Email-ID and after accepting it even you can post your views, day to day experiences and class works on this blog.
Visit owner's blog at
www.bloggerabhilash.info

Tuesday, May 8, 2012

ORACLE

Average:-



SELECT Customer FROM Orders
WHERE OrderPrice>(SELECT AVG(OrderPrice) FROM Orders

Between Query:



select Empid,Empname from employee1
 where date between '
2008-12-23'and '2008-12-25';

Count Query:



SELECT COUNT(student) AS studentSAM FROM Orders
WHERE Customer='stud'

Having:



SELECT department, MAX(salary) as "Highest salary"
FROM employees
GROUP BY department
HAVING MAX(salary) < 50000;

Join Tables:-




join 3 tables with the following variables


table1 : ssn, name
table2: ssn, fav_color
table3: ssn, fav_food


SELECT table1.name, table2.fav_color, table3.fav_food
FROM table1, table2, table3
WHERE table1.ssn = table2.ssn
and table2.ssn = table3.ssn;


LIKE QUERY:


SELECT * FROM student WHERE name LIKE 's%'

Maximum:


SELECT MAX(marks) AS maximumMarks FROM Stud;

Minimum:-


SELECT MIN(OrderPrice) AS SmallestOrderPrice FROM Orders

SUM:-


SELECT SUM(OrderPrice) AS OrderTotal FROM Orders;

VIEW:-


CREATE VIEW [Products Above Average Price] AS
SELECT ProductName,UnitPrice
FROM Products
WHERE UnitPrice>(SELECT AVG(UnitPrice) FROM Products);






No comments:

Post a Comment

You can ask your queries here and we will try to get back to you as soon as we will be done working with that..

Note: Only a member of this blog may post a comment.

Just Type The Keyword To Search Your Answer -- >>