SQL PL SQL Answers
SQL PL SQL Answers
- UNION: Combines results from two or more queries, returning only unique rows.
- UNION ALL: Combines results from multiple queries, including duplicate rows.
- MINUS: Returns rows from the first query that aren't in the second.
- Enhanced Security: PL/SQL code is stored and executed on the database, hiding internal logic
from users.
BEGIN
END;
Creating a View:
FROM table_name
WHERE condition;
Updating a View:
FROM table_name
WHERE condition;
8. Syntax for Creating Synonyms with Example
Syntax:
Example:
SELECT name
FROM stud
SELECT name
FROM stud
3. Display count of students failed in sub2 (assuming passing marks are 40):
SELECT COUNT(*)
FROM stud
4. Display names of students whose names start with 'A' in ascending order of sub1 marks:
SELECT name
FROM stud
UPDATE stud
SET sub1 = 90
WHERE roll_no = 1;