ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalCOMP3146Database Programming S…
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    COMP3146

    Advance Database Management Systems

    Progress0 / 18 done
    Topics18
    1Introduction to advance data models such as object relational, object oriented2File organizations concepts3Transactional processing4Concurrency control techniques5Recovery techniques6Query processing and optimization7Database Programming (PL/SQL)8Database Programming (T-SQL)9Database Programming (similar technology)10Integrity and security11Database Administration (Role management)12Database Administration (managing database access)13Database Administration (views)14Physical database design and tuning15Distributed database systems16Emerging research trends in database systems17MONGO DB18NO SQL (or similar technologies)
    2 min read
    Topic 9 of 18
    Topic Study Note Illustration
    09

    Database Programming (similar technology)

    Example:

    💻 Database Programming: Similar Technologies


    1. PL/pgSQL (PostgreSQL)

    • Procedural language for PostgreSQL (an open-source RDBMS).
    • Very similar to Oracle’s PL/SQL.
    • Supports control structures, loops, variables, exception handling.
    • Used for writing stored procedures, functions, and triggers.

    Example:

    CREATE FUNCTION increase_salary(emp_id INT, increment NUMERIC) RETURNS VOID AS $$
    BEGIN
      UPDATE employees SET salary = salary + increment WHERE employee_id = emp_id;
    END;
    $$ LANGUAGE plpgsql;
    

    2. SQL/PSM (Persistent Stored Modules)

    • An ISO/ANSI SQL standard procedural extension.
    • Defines syntax and semantics for stored procedures and triggers.
    • Supported (to varying degrees) by some DBMS like MySQL, IBM DB2, and others.

    3. Java Stored Procedures

    • Supported by many DBMS (Oracle, SQL Server, DB2).
    • Allows writing stored procedures in Java.
    • Useful when business logic requires advanced programming features.

    4. Embedded SQL

    • SQL statements embedded in a host programming language like C, C++, Java, or Python.

    • Uses host variables to pass data between SQL and the host program.

    • Examples:

      • Pro*C (Embedded SQL in C for Oracle)
      • JDBC (Java Database Connectivity)
      • ODBC (Open Database Connectivity)

    5. PL/SQL-like Languages in NoSQL Databases

    Some NoSQL and NewSQL databases provide scripting or procedural logic:

    • MongoDB uses JavaScript for stored procedures or server-side logic.
    • Cassandra supports CQL (Cassandra Query Language) with limited procedural features.
    • Redis supports Lua scripting for atomic operations.

    6. User-Defined Functions (UDFs)

    • Available in many DBMS for extending SQL capabilities.
    • Can be written in various languages (SQL, procedural languages, or external languages like C or Python).
    • Example: Writing a Python UDF in Amazon Redshift or SQL Server.

    7. Summary Table

    Technology Database System(s) Key Features
    PL/pgSQL PostgreSQL Procedural language, similar to PL/SQL
    SQL/PSM MySQL, DB2, others Standardized procedural SQL extension
    Java Stored Procs Oracle, SQL Server, DB2 Java-based stored procedures
    Embedded SQL Multiple (C, Java, Python) SQL embedded in host languages
    JavaScript (NoSQL) MongoDB Server-side scripting in JS
    Lua Scripting Redis Atomic operations with Lua scripts
    UDFs Many DBMS Extend SQL with custom functions

    ← Previous topic 8
    Database Programming (T-SQL)
    Next topic 10 →
    Integrity and security

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    2mremaining
    321words
    Beginnerlevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Advance Database Management Systems