
Explanation:

In relational database systems such as Microsoft SQL Server or Azure SQL Database, the following definitions apply:
Stored Procedure:
A stored procedure is a precompiled block of Transact-SQL (T-SQL) code stored in the database. It can contain control-of-flow statements, queries, and business logic. When executed, it runs as a single unit within the database engine. This matches the definition of " a block of code that runs in a database. " Table:
A table is a structured set of rows and columns used to store data, not a block of executable code.
View:
A view is a virtual table based on the result of a SQL query. It is used for abstraction and simplification of queries, not for executing code blocks.
Index:
An index is a database structure that improves the speed of data retrieval. It is not executable code.
Thus, the only option that correctly describes " a block of code that runs in a database " is a stored procedure.
The answer: A stored procedure
Microsoft References
Stored Procedures (Database Engine)
Azure SQL Database - Stored procedures overview
SQL Server Views
SQL Server Tables
SQL Server Indexes