Database Concepts Explanation
Database Concepts Explanation
A view in Oracle is a virtual table based on the result of a SQL query. It does not store data itself but
Syntax:
FROM table_name
WHERE condition;
Example:
FROM employees
2. SQL Functions
SQL functions are built-in functions used to perform calculations or manipulate data. They can be
categorized as follows:
Example:
SELECT AVG(salary) FROM employees;
GROUP BY is used to group rows with the same values in specified columns, often used with
Syntax:
FROM table_name
GROUP BY column1
HAVING condition;
Example:
FROM employees
GROUP BY department
4. Oracle Operators
Operators in Oracle are used to perform operations on data. Some key types include:
- Arithmetic Operators: +, -, *, /
Example:
A cursor in PL/SQL is a pointer to the result set of a query. It is used to process each row returned
by the query.
Attributes:
Example:
DECLARE
BEGIN
OPEN emp_cursor;
CLOSE emp_cursor;
END;
6. SELECT Statement
The SELECT statement is used to retrieve data from one or more tables.
Syntax:
FROM table_name
WHERE condition;
Example:
7. Procedure Explanation
A procedure in PL/SQL is a named block of code that performs a specific task. Procedures can
Syntax:
AS
BEGIN
END;
Example:
AS
BEGIN
UPDATE employees
WHERE id = emp_id;
END;