Preview:
1) ER Diagram for Library Management System:

Entities: Book, Author, Publisher, Member, Loan, Reservation, Genre
Relationships:
Member borrows Book (many-to-many)
Book is written by Author (many-to-many)
Book is published by Publisher (many-to-one)
Reservation is placed by Member (one-to-many)

2) PL/SQL Function to Calculate Area of Rectangle:
CREATE OR REPLACE FUNCTION calculate_rectangle_area(
    length IN NUMBER,
    width IN NUMBER
) RETURN NUMBER IS
    area NUMBER;
BEGIN
    area := length * width;
    RETURN area;
END;

3) SQL Queries:
A) SELECT * FROM Employees;
B) SELECT salary FROM Employees;
C) SELECT DISTINCT designation FROM Employees;
D) SELECT emp_name, salary * 1.15 AS increased_salary FROM Employees;
E) SELECT emp_id, salary, dept_id FROM Employees;
F) SELECT * FROM Employees WHERE YEAR(join_date) < 1991;
G) SELECT AVG(salary) AS average_salary FROM Employees WHERE designation = 'ANALYST';
H)CREATE VIEW EmployeesWithThirdLetterA AS
  SELECT * FROM Employees 
  WHERE SUBSTRING(name, 3, 1) = 'A' AND salary BETWEEN 2600 AND 3200;
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter