SQL Investigation

Lesson 2 of 6

The Employee Roster

Concept:

Using SELECT to retrieve specific columns from a table.
Detective Indecks: I need names. Every suspect, every witness, everyone who works at this company. That's where we start.
Database: The employees table has it all, detective. Names, emails, salaries, hire dates, departments. What do you need?
Detective Indecks: Just the basics for now. First name, last name. I don't need the whole file yet.
Database: That's what SELECT is for. You specify exactly which columns you want: `SELECT first_name, last_name FROM employees`. No clutter, no waste—just what you asked for.
Detective Indecks: What if I want to see their email addresses too?
Database: Add it to the list: `SELECT first_name, last_name, email FROM employees`. Comma-separated, clean and simple.
Detective Indecks: And if I want everything?
Database: Use the asterisk: `SELECT * FROM employees` gives you every column. But be careful—more data means more noise. Focused queries get better results.
Detective Indecks: Smart. Let's pull those names and see who we're dealing with.
Example Code:
SELECT first_name, last_name, email FROM employees;

Your Assignment

Retrieve a list of all employee names (first_name and last_name) from the employees table to begin your investigation.

Sql Console
sql>