DMS Project (Execute Queries Using SELECT - Command With WHERE and HAVING Clause)
DMS Project (Execute Queries Using SELECT - Command With WHERE and HAVING Clause)
Annexure-II
Micro-Project
Team Members:
Om Ghugare (30)
Abhishek Chaudhari (31)
Suyash Nangare (32)
Rohan Khachane (33)
Micro-Project Proposal
Execute queries using SELECT command with WHERE and HAVING clause:
1.0 Rationale
Database Management Systems (DBMS) are vital components of modern information systems.
Database applications are pervasive and range in size from small in-memory databases to terra
bytes or even larger in various applications domains. The course focuses on the fundamentals of
knowledgebase and relational database management systems, and the current developments in
database theory and their practice.
A) SELECT COMMAND -
B) WHERE CLAUSE -
C) HAVING CLAUSE –
A) SELECT COMMAND -
Syntax:
Select *
from
Example:
{table_name}
order by {unique_key}
SELECT * FROM
( SELECT
ROW_NUMBER() OVER (ORDER BY sort_key ASC) AS row_number, columns
FROM tablename
) AS foo
WHERE row_number <= 11;
B) WHERE CLAUSE -
Syntax:
Example:
SELECT * FROM
Customer
WHERE customer_id = 101;
C) HAVING CLAUSE -
A HAVIN clause in SQL specifies that an SQL SELE statement should only return rows where
aggregate values meet the specified conditions. It was added to the SQL language because
the
WHE keyword could not be used with aggregate functions.
The
HAVIN clause filters the data on the group row but not on the individual row.
To view the present condition formed by the clause, the clause is used.
GROUP HAVIN
Syntax:
SELECT
column_name(s)
Example:
FROM {table_name}
WHERE condition
GROUP BY
SELECT column_name(s)
DeptID,
HAVING conditionFROM Sales
SUM(SaleAmount)
5.0 Actual Procedure Followed
WHERE SaleNumber = 8872
GROUP BY DeptID
1. Designed plans through which we can get ideology of executing queries.
2. Created two tables using >DML
HAVING SUM(SaleAmount) commands.
1000
3. Inserted values into those two tables.
4. Displayed the tables with their records with SELECT command.
5. Executed queries by using WHERE and HAVING clause with the help of SELECT
command to tackle and get output according to the conditions.
6. Tested the queries 4-5 times before the final confirmation.
7. Attached the output of project at the end.
8. Finalized report.
b. Displaying DEPARTMENT:
Select * from DEPARTMENT;
Executing QUERIES using WHERE and HAVING CLAUSE
2. Abhishek Chaudhari -
42