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.