CREST Practitioner Security Analyst (CPSA) Practice

Disable ads (and more) with a membership for a one time $2.99 payment

Master the CREST Practitioner Security Analyst Exam. Prepare with quizzes and comprehensive study guides that include tips and explanations. Excel in your certification journey!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


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

  1. SELECT name FROM sysobjects

  2. SELECT TOP 1 TABLE_NAME FROM INFORMATION_SCHEMA.TABLES

  3. SELECT * FROM INFORMATION_SCHEMA.COLUMNS

  4. SELECT name FROM master..sysdatabases

The correct answer is: 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.