CREST Practitioner Security Analyst (CPSA) Practice 2025 - Free CPSA Practice Questions and Study Guide

Question: 1 / 485

Which command retrieves the top row of all tables in MS-SQL?

SELECT name FROM sysobjects

SELECT TOP 1 TABLE_NAME FROM INFORMATION_SCHEMA.TABLES

The command that retrieves the top row of all tables in MS-SQL is indeed the second option, as it effectively utilizes the INFORMATION_SCHEMA.TABLES view, which contains metadata about all the tables in the database. The inclusion of the "TOP 1" clause ensures that only one table name is returned, making it clear and concise for retrieving a sample entry from the entirety of the tables present.

Gathering metadata from the INFORMATION_SCHEMA views is a standard practice in SQL, as these views provide a standardized way to access database schema information that is compatible across different database systems. By focusing on retrieving the TABLE_NAME, it directly points to the names of tables, which is usually the first step analysts take when needing to explore the database structure or gather insights from it.

The other options present different types of queries that do not achieve the goal of retrieving the top row of all tables. Some queries look for specific objects or metadata unrelated to the core requirement of obtaining actual table data, which underscores the accuracy and relevance of the chosen command.

Get further explanation with Examzify DeepDiveBeta

SELECT * FROM INFORMATION_SCHEMA.COLUMNS

SELECT name FROM master..sysdatabases

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy