Complete the code to declare a B-tree index on the column 'name' in SQL.
CREATE INDEX idx_name ON employees ([1]);The B-tree index is created on the 'name' column to speed up searches based on employee names.
Complete the SQL query to find all employees with names starting with 'A' using the B-tree index.
SELECT * FROM employees WHERE name [1] 'A%';
The LIKE operator is used with '%' as a wildcard to find names starting with 'A'.
Fix the error in the SQL statement to create a B-tree index explicitly.
CREATE INDEX idx_salary ON employees (salary) USING [1];The B-tree index type is specified by 'btree' to create a balanced tree index.
Fill both blanks to complete the B-tree node split condition in pseudocode.
if (node.[1] > [2]) { splitNode(node); }
The node splits when the number of keys exceeds the maximum allowed keys in a B-tree node.
Fill all three blanks to complete the B-tree search pseudocode for a key.
function search(node, key) {
let i = 0;
while (i < node.[1] && key > node.keys[[2]]) {
i = i + 1;
}
if (i < node.[3] && key == node.keys[i]) {
return node.values[i];
}
if (node.isLeaf) {
return null;
} else {
return search(node.children[i], key);
}
}The search loops while 'i' is less than the number of keys and the key is greater than the current key. Then it checks if the key matches at position 'i'.