CompTIA DataSys+ (DS0-001)Database FundamentalsEasy

A data analyst needs to retrieve specific customer names and their email addresses from a large `Customers` table. The analyst wants to avoid fetching other sensitive information like `SocialSecurityNumber` or `CreditCardDetails` that are also in the table. Which SQL command should the analyst use to achieve this?

  1. AUPDATE
  2. BSELECT
  3. CDELETE
  4. DINSERT
Show answer & explanation

Correct answer: B. SELECT

The SELECT statement is used to query the database and retrieve data. By specifying the desired column names (e.g., `CustomerName`, `EmailAddress`), the analyst can control which information is fetched.

Why the other options are wrong

  • A. UPDATE is used to modify existing data in a table.
  • C. DELETE is used to remove rows of data from a table.
  • D. INSERT is used to add new rows of data into a table.

SQL DML (Data Manipulation Language)

A subset of SQL statements used for managing data within schema objects, such as retrieving, inserting, updating, and deleting data.

  • Includes SELECT, INSERT, UPDATE, DELETE.
  • Operates on the data content of tables.
  • Distinct from DDL (Data Definition Language) which manages schema.

Memory trick: DML is about data: Select, Insert, Update, Delete.

More Database Fundamentals questions