Sunday, 24 May 2026

Filled under:

 <!DOCTYPE html>

<html lang="en">

<head>

  <meta charset="UTF-8" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />

  <title>Oracle Exam 1Z0-184-25 : Oracle AI Vector Search Professional Dump - Practice Exam</title>

  <style>

    :root {

      --bg: #f6f7fb;

      --card: #ffffff;

      --text: #1f2937;

      --muted: #6b7280;

      --border: #e5e7eb;

      --accent: #2563eb;

      --accent-soft: #dbeafe;

      --success: #047857;

      --success-bg: #d1fae5;

      --danger: #b91c1c;

      --danger-bg: #fee2e2;

      --shadow: 0 10px 25px rgba(15, 23, 42, 0.08);

    }

    * { box-sizing: border-box; }

    body {

      margin: 0;

      font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

      background: var(--bg);

      color: var(--text);

      line-height: 1.55;

    }

    header {

      position: sticky;

      top: 0;

      z-index: 10;

      background: rgba(246,247,251,0.95);

      backdrop-filter: blur(10px);

      border-bottom: 1px solid var(--border);

    }

    .wrap {

      max-width: 980px;

      margin: 0 auto;

      padding: 20px;

    }

    .hero {

      display: flex;

      justify-content: space-between;

      gap: 16px;

      align-items: center;

      flex-wrap: wrap;

    }

    h1 {

      font-size: clamp(22px, 3vw, 34px);

      margin: 0 0 4px;

    }

    .subtitle {

      color: var(--muted);

      margin: 0;

      font-size: 15px;

    }

    .stats {

      display: flex;

      gap: 10px;

      flex-wrap: wrap;

      align-items: center;

    }

    .pill {

      background: var(--card);

      border: 1px solid var(--border);

      border-radius: 999px;

      padding: 8px 12px;

      font-weight: 650;

      box-shadow: 0 3px 10px rgba(15,23,42,0.04);

    }

    .toolbar {

      display: flex;

      gap: 10px;

      flex-wrap: wrap;

      margin-top: 16px;

    }

    button {

      border: 0;

      border-radius: 12px;

      padding: 10px 14px;

      cursor: pointer;

      font-weight: 700;

      background: var(--accent);

      color: white;

      transition: transform .08s ease, opacity .15s ease;

    }

    button:hover { opacity: .92; }

    button:active { transform: translateY(1px); }

    button.secondary {

      background: var(--card);

      color: var(--text);

      border: 1px solid var(--border);

    }

    .exam {

      padding-top: 22px;

      padding-bottom: 60px;

    }

    .question-card {

      background: var(--card);

      border: 1px solid var(--border);

      border-radius: 22px;

      padding: 22px;

      margin-bottom: 18px;

      box-shadow: var(--shadow);

    }

    .q-head {

      display: flex;

      justify-content: space-between;

      gap: 12px;

      align-items: flex-start;

      margin-bottom: 14px;

    }

    .q-num {

      color: var(--accent);

      font-weight: 800;

      white-space: nowrap;

    }

    .q-text {

      font-size: 17px;

      font-weight: 650;

      white-space: pre-wrap;

      flex: 1;

    }

    pre {

      background: #111827;

      color: #f9fafb;

      padding: 14px;

      border-radius: 14px;

      overflow-x: auto;

      font-size: 13px;

      line-height: 1.45;

      margin: 12px 0;

    }

    .options {

      display: grid;

      gap: 10px;

      margin-top: 12px;

    }

    .option {

      display: flex;

      gap: 10px;

      align-items: flex-start;

      width: 100%;

      text-align: left;

      background: #fff;

      color: var(--text);

      border: 1px solid var(--border);

      border-radius: 14px;

      padding: 13px 14px;

      font-weight: 560;

    }

    .option:hover:not(:disabled) {

      border-color: var(--accent);

      background: var(--accent-soft);

    }

    .option:disabled {

      cursor: default;

      opacity: .86;

    }

    .option .letter {

      min-width: 26px;

      height: 26px;

      border-radius: 999px;

      display: inline-flex;

      align-items: center;

      justify-content: center;

      border: 1px solid var(--border);

      color: var(--muted);

      font-size: 13px;

      font-weight: 800;

    }

    .option.correct-selected {

      border-color: var(--success);

      background: var(--success-bg);

    }

    .option.wrong-selected {

      border-color: var(--danger);

      background: var(--danger-bg);

    }

    .feedback {

      margin-top: 12px;

      padding: 10px 12px;

      border-radius: 12px;

      font-weight: 800;

      display: none;

    }

    .feedback.correct {

      display: block;

      color: var(--success);

      background: var(--success-bg);

      border: 1px solid rgba(4,120,87,.25);

    }

    .feedback.wrong {

      display: block;

      color: var(--danger);

      background: var(--danger-bg);

      border: 1px solid rgba(185,28,28,.2);

    }

    .question-actions {

      margin-top: 10px;

      display: none;

      gap: 10px;

      flex-wrap: wrap;

      align-items: center;

    }

    .question-actions.show { display: flex; }

    .hint {

      color: var(--muted);

      font-size: 13px;

    }

    .footer-card {

      background: var(--card);

      border: 1px solid var(--border);

      border-radius: 22px;

      padding: 22px;

      margin-top: 18px;

      box-shadow: var(--shadow);

      text-align: center;

    }

    .progress {

      width: 100%;

      height: 10px;

      border-radius: 999px;

      background: #e5e7eb;

      overflow: hidden;

      margin-top: 14px;

    }

    .progress > span {

      display: block;

      height: 100%;

      width: 0%;

      background: var(--accent);

      transition: width .2s ease;

    }

    @media print {

      header, .toolbar { position: static; }

      button { display: none; }

      .question-card { box-shadow: none; break-inside: avoid; }

      body { background: white; }

    }

  </style>

</head>

<body>

  <header>

    <div class="wrap">

      <div class="hero">

        <div>

          <h1>Practice Exam</h1>

          <p class="subtitle">Oracle Exam 1Z0-184-25 : Oracle AI Vector Search Professional Dump · Select an option and get instant feedback.</p>

        </div>

        <div class="stats">

          <div class="pill">Questions: <span id="total">0</span></div>

          <div class="pill">Correct: <span id="score">0</span></div>

          <div class="pill">Completed: <span id="done">0</span></div>

        </div>

      </div>

      <div class="progress"><span id="progressBar"></span></div>

      <div class="toolbar">

        <button onclick="resetExam()">Reset Exam</button>

        <button class="secondary" onclick="shuffleQuestions()">Shuffle Questions</button>

        <button class="secondary" onclick="window.print()">Print</button>

      </div>

    </div>

  </header>


  <main class="wrap exam" id="exam"></main>


  <script>

    const originalQuestions = [{"question": "Which statement best describes the core functionality and benefit of Retrieval Augmented Generation (RAG) in Oracle Database 23ai?", "options": ["It primarily aims to optimize the performance and efficiency of LLMs by using advanced data retrieval techniques, thus minimizing response times, and reducing computational overhead.", "It enables Large Language Models (LLMs) to access and process real-time data streams from diverse sources to generate the most up-to-date insights.", "It empowers LLMs to interact with private enterprise data stored within the database, leading to more context-aware and precise responses to user queries.", "It allows users to train their own specialized LLMs directly within the Oracle Database environment using their internal data, thereby reducing the reliance on external Al providers."], "answer": 2}, {"question": "What are the key advantages and considerations of using Retrieval Augmented Generation (RAG) in the context of Oracle Al Vector Search?", "options": ["It focuses on training specialized LLMs within the database environment for specific tasks, offering greater control over model behavior and data privacy but potentially requiring more development effort.", "It leverages existing database security and access controls, thereby enabling secure and controlled access to both the database content and the LLM.", "It excels at optimizing the performance and efficiency of LLM inference through advanced caching and precomputation techniques, leading to faster response times but potentially increasing storage requirements.", "It prioritizes real-time data extraction and summarization from various sources to ensure the LLM always has the most up-to-date information."], "answer": 1}, {"question": "When using SQL*Loader to load vector data for search applications, what is a critical consideration regarding the formatting of the vector data within the input CSV file?", "options": ["Use sparse format for vector data.", "Enclose vector components in curly braces ({).", "As FVECis a binary format and the vector dimensions have a know width, fixed offsets can be used to make parsing the vectors fast and efficient.", "Rely on SQL*Loader's automatic normalization of vector data."], "answer": 2}, {"question": "What is one type of notebook used for interacting with Select Al?", "options": ["Oracle Machine Learning (OML) Notebooks", "Wyde Rule Notebooks", "RoCE Notebooks"], "answer": 0}, {"question": "How does an application use vector similarity search to retrieve relevant information from a database, and how is this information then integrated into the generation proce:", "options": ["Clusters similar text chunks and randomly selects one from the most relevant cluster.", "Trains a separate LLM on the database and uses it to answer, ignoring the general LLM.", "Encodes the question and database chunks into vectors, finds the most similar using cosine similarity, and includes them in the LLM prompt.", "Converts the question to keywords, searches for matches, and inserts the text into the response."], "answer": 2}, {"question": "What is the function of the COSINE parameter in the SQL query used to retrieve similar vectors?\n```sql\ntopK = 3\nsql = f\"\"\"select payload, vector _distance(vector, :vector, COSINE) as score from {table name} order by score fetch approx first\n{topK} rows only\"\"\"\n```", "options": ["It filters out vectors with a cosine similarity below a certain threshold.", "It specifies the type of vector encoding used in the database.", "It indicates that the cosine distance metric should be used to measure similarity between vectors.", "It converts the vectors to a format com patible with the SQL database."], "answer": 2}, {"question": "In the following Python code, what is the significance of prepending the source filename to each text chunk before storing it in the vector database?\n```python\ndocs = [{'text': filename + ' | ' + section, 'path': filename} for filename, sections in faqs.items() for section in sections]\n# Sample the resulting data\ndocs[:2]\n```", "options": ["It speeds up the vectorization process by providing a unique identifier for each chunk.", "It improves the accuracy of the LLM by providing additional training data.", "It preserves context and aids in the retrieval process by associating each vectorized chunk with its original source file.", "It helps differentiate between chunks from different files but has no impact on vectorization."], "answer": 2}, {"question": "Which Python library is used to vectorize text chunks and the user's question in the following example?\n```python\nimport oracledb\n\nconnection = oracledb.connect(user=un, password=pw, dsn=cs)\ntable_name = 'fags'\n\nwith connection.cursor() as cursor:\n    # Create the table\n    create_table_sql = f\"\"\"\n    CREATE TABLE IF NOT EXISTS {table_name} (\n    id NUMBER PRIMARY KEY,\n    payload CLOB CHECK (payload IS JSON),\n    vector VECTOR\n    )\"\"\"\n    try:\n        cursor.execute(create_table_sql)\n    except oracledb.DatabaseError as e:\n        raise\n\nconnection.autocommit = True\n\nfrom sentence_transformers import SentenceTransformer\nencoder = SentenceTransformer(\"all-MiniLM-L12-v2\")\n\n```", "options": ["sentence_transformers", "oracledb", "oci", "json"], "answer": 1}, {"question": "Which DDL operation is NOT permitted on a table containing a VECTOR column in Oracle Database 23ai?", "options": ["Adding a new VECTOR column to the table", "Dropping an existing VECTOR column from the table", "Modifying the data type of an existing VECTOR column to a non-VECTOR type", "Creating a new table using CTAS CREATE TABLE AS SELECT that includes the VECTOR column from the original table"], "answer": 2}, {"question": "Which SQL statement correctly adds a VECTOR column named v with 4 dimensions and FLOAT32 format to an existing table named my_table?", "options": ["ALTER TABLE my_table MODIFY (v VECTOR(4, FLOAT32))", "UPDATE my_table SET v = VECTOR(4, FLOAT32)", "ALTER TABLE my_table ADD v VECTOR(4, FLOAT32)", "ALTER TABLE my_table ADD (v VECTOR(4, FLOAT32))"], "answer": 2}, {"question": "Which statement best describes the capability of Oracle Data Pump for handling vector data in the context of vector search applications?", "options": ["Because of the complexity of vector data, Data Pump requires a specialized plug-in to handle the export and import operations involving vector data types.", "Data Pump provides native support for exporting and importing tables containing vector data types, facilitating the transfer of vector data for vector search applications", "Data Pump can only export and import vector data if the vector embeddings are stored as BLOB (Binary Large Object) data types in the database.", "Data Pump treats vector embeddings as regular text strings, which can lead to data corruption or loss of precision when transferring vector data for vector search."], "answer": 1}, {"question": "Which parameter is used to define the number of closest vector candidates considered during HNSW index creation?", "options": ["VECTOR _MEMORY SIZE", "NEIGHBORS", "TARGET ACCURACY", "EFCONSTRUCTION"], "answer": 3}, {"question": "A retail company uses an Oracle Database 23ai HNSW vector index to recommend products to customers based on their browsing history.\nThe database administrator notices that the after restarting the database, product recommendations are slower.\nWhat steps should the administrator take to resolve the issue?", "options": ["Decrease the VECTOR MEMORY SIZE parameter.", "Modify the distance metric to DOT.", "Rebuild the HNSW index or enable automatic reload.", "Adjust the NEIGHBOR PARTITION PROBES parameter for improved accuracy."], "answer": 2}, {"question": "A database administrator wants to change the VECTOR_MEMORY_SIZE parameter for a pluggable database (PDB) in Oracle Database 23ai. Which SQL command is correct?", "options": ["ALTER SYSTEM SET vector memory size=1G SCOPE=SGA;", "ALTER DATABASE SET vector_memory_size=1G SCOPE=VECTOR;", "ALTER SYSTEM SET vector_memory_size=1G SCOPE=BOTH;", "ALTER SYSTEM RESET vector_memory_size;"], "answer": 0}, {"question": "Which vector index available in Oracle Database 23ai is known for its speed and accuracy, making it a preferred choice for vector search?", "options": ["Inverted File System (IFS) index", "Full-Text (FT) index", "Binary Tree (BT) index", "Hierarchical Navigable Small World (HNSW) index"], "answer": 3}, {"question": "If a query vector uses a different distance metric than the one used to create the index, what happens?", "options": ["The query fails.", "A warning is logged, but the query executes.", "The index automatically updates.", "An exact match search is triggered."], "answer": 3}, {"question": "What is the primary difference between the HNSW and IVF vector indexes in Oracle Database 23ai?", "options": ["HNSW guarantees accuracy, whereas IVF sacrifices performance for accuracy.", "HNSW is partition based, whereas IVF uses neighbor graphs for indexing.", "HNSW uses an in-memory neighbor graph for faster approximate searches, whereas IVF use the buffer cache with partitions.", "Both operate identically but differ in memory usage."], "answer": 2}, {"question": "What is a key advantage of generating vector embeddings outside the database?", "options": ["Reduced storage requirements", "Simplified data management", "Flexibility in choosing specialized embedding models", "Improved data security"], "answer": 2}, {"question": "When generating vector embeddings for a new dataset outside of Oracle Database 23ai, which factor is crucial to ensure meaningful similarity search results?", "options": ["The physical location where the vector embeddings are stored", "The choice of programming language used to process the dataset (for example, Python, Java)", "The storage format of the new dataset (for example, CSV, JSON)", "The same vector embedding model must be used for vectorizing the data and creating a query vector"], "answer": 3}, {"question": "When generating vector embeddings outside the database, what is the most suitable option for storing the embeddings for later use?", "options": ["In a binary FVEC file with the relational data in a CSV file", "In a dedicated vector database", "In a CSV file", "In the database as BLOB (Binary Large Object) data"], "answer": 1}, {"question": "What does a target accuracy of 80% in an approximate similarity search imply?", "options": ["80% accuracy seen in the index calculated distances.", "The search will process 80% of the dataset.", "80% of the query results will match the exact search results.", "Only 80% of the indexed vectors are used."], "answer": 3}, {"question": "Which is a characteristic of an approximate similarity search in Oracle Database 23ai?", "options": ["It trades off accuracy for faster performance.", "It compares every vector in the dataset.", "It always guarantees 100% accuracy.", "It is slower than exact similarity search."], "answer": 0}, {"question": "What is the primary function of an embedding model in the context of vector search?", "options": ["To execute similarity search operations within a database", "To store vectors in a structured format for efficient retrieval", "To transform text or data into numerical vector representations", "To define the schema for a vector database"], "answer": 2}, {"question": "What is the significance of using local ONNX models for embedding within the database?", "options": ["Enhanced security because data remains within the database", "Improved accuracy compared to external models", "Reduced embedding dimensions for faster processing", "Support for legacy SQL*Plus clients"], "answer": 0}, {"question": "In Oracle Database 23ai, which SQL function is used to split text into words, sentences, or paragraphs for vector embedding preparation?", "options": ["VECTOR_EMBEDDING", "VECTOR DISTANCE", "VECTOR_NORM", "VECTOR_CHUNKS"], "answer": 1}, {"question": "You are storing 1,000 embeddings in a VECTOR column, each with 256 dimensions using FLOAT32.\nWhat is the approximate size of the data on disk?", "options": ["1GB", "1MB", "4MB", "256 KB"], "answer": 1}, {"question": "You need to generate a vector from the string '[1.2, 3.4]' in FLOAT32 format with 2 dimensions.\nWhich function will you use?", "options": ["TO_VECTOR", "VECTOR_SERIALIZE", "FROM_VECTOR", "VECTOR_DISTANCE"], "answer": 0}, {"question": "Which function should you use to determine the storage format of a vector?", "options": ["VECTOR_NORM", "VECTOR _EMBEDDING", "VECTOR_CHUNKS", "VECTOR_DIMENSION_FORMAT"], "answer": 3}, {"question": "What happens when querying with an IVF index if you increase the value of the NEIGHBOR PARTITION PROBES parameter?", "options": ["The number of centroids decreases.", "Accuracy decreases.", "More partitions are probed, improving accuracy, but also increasing query latency.", "Index creation time is reduced."], "answer": 2}, {"question": "machine learning team is using IVF indexes in Oracle Database 23ai to find similar images in a large dataset.\nDuring testing, they observe that the search results are often incomplete, missing relevant images. They suspect the issue lies in the number of partitions probed.\nHow should they improve the search accuracy?", "options": ["Increase the VECTOR_MEMORY_S1ZE initialization parameter.", "Change the index type to HNSW for better accuracy.", "Re-create the index with a higher EFCONSTRUCTION value.", "Add the TARGET ACCURACY clause to the query with a higher value for the accuracy."], "answer": 3}, {"question": "Which SQL statement will successfully insert a vector into a table named my_table with a single VECTOR column named v?", "options": ["INSERT INTO my_table VALUES ('{1.1, 2.2, 3.3}')", "INSERT INTO my_table (v) VALUES (1.1, 2.2, 3.3)", "INSERT INTO my_table VALUES ((1.1, 2.2, 3.3))", "INSERT INTO my_table (v) VALUES ('[1.1, 2.2, 3.3]')"], "answer": 0}, {"question": "What happens when you attempt to insert a vector with an incorrect number of dimensions into a VECTOR column with a defined number of dimensions?", "options": ["The insert operation fails, and an error message is thrown.", "The database ignores the defined dimensions and inserts the vector as is.", "The database truncates the vector to fit the defined dimensions.", "The database pads the vector with zeros to match the defined dimensions."], "answer": 0}, {"question": "What is the primary function of Select Al in Oracle Autonomous Database?", "options": ["To provide real-time data visualization and reporting tools integrated with Autonomous Database", "To eliminate the need for SQL expertise by enabling users to query data using natural language", "To eliminate the need for manual coding by automatically generating SQL queries for complex data analysis tasks", "To improve the efficiency of Al applications by training machine learning models directly within the database"], "answer": 3}, {"question": "How is the security interaction between Autonomous Database and OCI Generative Al managed in the context of Select Al?", "options": ["By utilizing Resource Principals, which grant the Autonomous Database instance access to OCI Generative AI without exposing sensitive credentials", "By requiring users to manually enter their OCI API keys each time they execute a natural language query", "By establishing a secure VPN tunnel between the Autonomous Database and OCI Generative Al service", "By encrypting all communication between the Autonomous Database and OC! Generative Al using TLS/SSL protocols"], "answer": 0}, {"question": "Which Oracle Cloud Infrastructure (OCI) service is directly integrated with Select AI?", "options": ["OCI Generative Al", "OCI Vision", "OCI Language", "OCI Data Science"], "answer": 0}, {"question": "Which is NOT a feature or capability related to AI and Vector Search in Exadata?", "options": ["AI Smart Scan", "Native Support for Vector Search Only within the Database Server", "Vector Replication with GoldenGate", "Loading Vector Data using SQL*Loader"], "answer": 1}, {"question": "Why would you choose to NOT define a specific size for the VECTOR column during development?", "options": ["It impacts the accuracy of similarity searches.", "It restricts the database to a single embedding model.", "It limits the length of text that can be vectorized.", "Different external embedding models produce vectors with varying dimensions and data types."], "answer": 3}, {"question": "In Oracle Database 23ai, which data type is used to store vector embeddings for similarity search?", "options": ["BLOB", "VARCHAR2", "VECTOR2", "VECTOR"], "answer": 3}, {"question": "What is the primary purpose of a similarity search in Oracle Database 23ai?", "options": ["To find exact matches in BLOB data", "To retrieve the most semantically similar entries using distance metrics between different vectors.", "To optimize relational database operations", "To compute distances between all data points in a database"], "answer": 1}, {"question": "What is the advantage of using Euclidean Squared Distance rather than Euclidean Distance in similarity search queries?", "options": ["It guarantees higher accuracy than Euclidean Distance.", "It is the default distance metric for Oracle Al Vector Search.", "It supports hierarchical partitioning of vectors.", "It is simpler and faster because it avoids square-root calculations."], "answer": 3}, {"question": "Which SQL query would retrieve the top-10 vectors based on Euclidean distance using exact similarity search?", "options": ["SELECT docID FROM vector_tab\nGROUP BY VECTOR_DISTANCE (embedding, :query_vector, EUCLIDEAN)\nFETCH FIRST 10 ROWS ONLY;", "SELECT docID FROM vector_tab\nORDER BY VECTOR_DISTANCE (embedding, :query_vector, COSINE)\nFETCH EMACT FIRST 10 ROWS ONLY;", "SELECT docID FROM vector_tab\nORDER BY VECTOR_DISTANCE (embedding, :query_vector, EUCLIDEAN)\nFETCH EXACT FIRST 10 ROWS ONLY;", "SELECT docID FROM vector_tab\nWHERE VECTOR DISTANCE (embedding, :query_vector, EUCLIDEAN) < 10;"], "answer": 0}, {"question": "What is the purpose of the VECTOR_DISTANCE function in Oracle Database 23ai similarity search?", "options": ["To create vector indexes for efficient searches", "To group vectors by their exact scores", "To calculate the distance between vectors using a specified metric", "To fetch rows that match exact vector embeddings"], "answer": 2}, {"question": "Which SQL function is used to create a vector embedding for a given text string in Oracle Database 23ai?", "options": ["CREATE_VECTOR_EMBEDDING", "GENERATE_EMBEDDING", "EMBED_TEXT", "VECTOR_EMBEDDING"], "answer": 3}, {"question": "Which PL/SQL function converts documents such as PDF, DOC, JSON, XML, or HTML to plain text?", "options": ["DBMS_VECTOR_CHAIN.UTL_TO_TEXT", "DBMS_VECTOR_CHAIN.UTIL_TO_CHUNKS", "DBMS_VECTOR.TEXT_TO_PLAIN", "DBMS_VECTOR.CONVERT_TO_TEXT"], "answer": 0}, {"question": "Which PL/SQL package Is primarily used for interacting with Generative Al services in Oracle Database 23ai?", "options": ["DBMS_VECTOR_CHAIN", "DBMS_AI", "DBMS_GENAI", "DBMS_ML"], "answer": 0}, {"question": "What is the primary purpose of the DBMS_VECTOR_CHAIN.UTL_TO_CHUNKS package in a RAG application?", "options": ["To load a document into the database", "To convert a document into a single, large text string", "To generate vector embeddings from a text document", "To split a large document into smaller chunks to improve vector quality by minimizing token truncation"], "answer": 3}, {"question": "An application needs to fetch the top-3 matching sentences from a dataset of books while ensuring a balance between speed and accuracy.\nWhich query structure should you use?", "options": ["Multivector similarity search with approximate fetching and target accuracy", "Approximate similarity search with the VECTOR_DISTANCE function", "Exact similarity search with Euclidean distance", "A combination of relational filters and similarity search"], "answer": 0}, {"question": "You are tasked with finding the closest matching sentences across books, where each book has multiple paragraphs and sentences.\nWhich SQL structure should you use?", "options": ["A nested query with ORDER BY", "Exact similarity search with a single query vector", "GROUP BY with vector operations", "FETCH PARTITIONS BY clause"], "answer": 3}, {"question": "What is the default distance metric used by the VECTOR_DISTANCE function if none is specified?", "options": ["Manhattan", "Cosine", "Euclidean", "Hamming"], "answer": 2}, {"question": "In Oracle Database 23ai, which SQL function calculates the distance between two vectors using the Euclidean metric?", "options": ["HAMMING_DISTANCE", "L1_DISTANCE", "COSINE_DISTANCE", "L2_DISTANCE"], "answer": 3}];

    let questions = JSON.parse(JSON.stringify(originalQuestions));

    let completed = new Set();

    let correct = new Set();


    const letters = ["A", "B", "C", "D", "E", "F"];


    function escapeHtml(str) {

      return String(str)

        .replaceAll("&", "&amp;")

        .replaceAll("<", "&lt;")

        .replaceAll(">", "&gt;")

        .replaceAll('"', "&quot;")

        .replaceAll("'", "&#039;");

    }


    function renderMarkdownLite(text) {

      const parts = String(text).split(/```([\s\S]*?)```/g);

      return parts.map((part, i) => {

        if (i % 2 === 1) {

          return `<pre><code>${escapeHtml(part.trim())}</code></pre>`;

        }

        return escapeHtml(part).replace(/\n/g, "<br>");

      }).join("");

    }


    function updateStats() {

      document.getElementById("total").textContent = questions.length;

      document.getElementById("score").textContent = correct.size;

      document.getElementById("done").textContent = completed.size;

      const pct = questions.length ? (completed.size / questions.length) * 100 : 0;

      document.getElementById("progressBar").style.width = pct + "%";

    }


    function renderExam() {

      const exam = document.getElementById("exam");

      exam.innerHTML = "";

      questions.forEach((q, qi) => {

        const card = document.createElement("section");

        card.className = "question-card";

        card.dataset.qi = qi;

        card.innerHTML = `

          <div class="q-head">

            <div class="q-num">Question ${qi + 1}</div>

            <div class="q-text">${renderMarkdownLite(q.question)}</div>

          </div>

          <div class="options">

            ${q.options.map((opt, oi) => `

              <button class="option" onclick="selectAnswer(${qi}, ${oi}, this)">

                <span class="letter">${letters[oi]}</span>

                <span>${renderMarkdownLite(opt)}</span>

              </button>

            `).join("")}

          </div>

          <div class="feedback" id="feedback-${qi}"></div>

          <div class="question-actions" id="actions-${qi}">

            <button class="secondary" onclick="shuffleQuestions()">Shuffle Question Sequence</button>

            <span class="hint">Use this after any attempt to practice in a fresh order.</span>

          </div>

        `;

        exam.appendChild(card);

      });


      const footer = document.createElement("div");

      footer.className = "footer-card";

      footer.innerHTML = `<strong>Finish all questions to complete your practice exam.</strong><br><span class="subtitle">Wrong attempts are not counted in the score. A question is completed only after selecting the correct answer.</span>`;

      exam.appendChild(footer);

      if (actions) actions.classList.add("show");


      updateStats();

    }


    function selectAnswer(qi, oi, btn) {

      if (completed.has(qi)) return;

      const q = questions[qi];

      const feedback = document.getElementById(`feedback-${qi}`);

      const card = document.querySelector(`.question-card[data-qi="${qi}"]`);

      const buttons = card.querySelectorAll(".option");

      const actions = document.getElementById(`actions-${qi}`);


      buttons.forEach(b => b.classList.remove("wrong-selected"));


      if (oi === q.answer) {

        completed.add(qi);

        correct.add(qi);

        btn.classList.add("correct-selected");

        feedback.className = "feedback correct";

        feedback.textContent = "Correct! Good job.";

        buttons.forEach(b => b.disabled = true);

      } else {

        btn.classList.add("wrong-selected");

        feedback.className = "feedback wrong";

        feedback.textContent = "Incorrect. Try again.";

      }


      updateStats();


      if (completed.size === questions.length) {

        setTimeout(() => {

          alert(`Practice exam completed! Score: ${correct.size} / ${questions.length}`);

        }, 200);

      }

    }


    function resetExam() {

      completed = new Set();

      correct = new Set();

      renderExam();

      window.scrollTo({ top: 0, behavior: "smooth" });

    }


    function shuffleQuestions() {

      for (let i = questions.length - 1; i > 0; i--) {

        const j = Math.floor(Math.random() * (i + 1));

        [questions[i], questions[j]] = [questions[j], questions[i]];

      }

      resetExam();

    }


    renderExam();

  </script>

</body>

</html>


0 comments:

Post a Comment