The Corporate Files
Concept:
Introduction to SQL and database schema exploration.
Detective Indecks:
Another late night. Another case. This time it's corporate fraud at TechCorp. The evidence is buried somewhere in their employee database.
Database:
Welcome, Detective. I'm the company database—SQLite. I hold all the records: employees, departments, projects, everything.
Detective Indecks:
SQLite, huh? Never worked with you before. How do I know what you've got?
Database:
Simple. Every database has a master catalog. Query `sqlite_master` with SELECT name FROM sqlite_master WHERE type='table' and you'll see every table I'm storing.
Detective Indecks:
So tables are like file cabinets? Each one holds different types of records?
Database:
Exactly. This database has four tables: departments, employees, projects, and employee_projects. Each one tells part of the story. Your job is to query them and find the truth.
Detective Indecks:
Alright, let's see what we're working with. Show me those tables.
Example Code:
SELECT name FROM sqlite_master WHERE type='table';
Your Assignment
Connect to the database and list all available tables to understand the data structure.
Sql Console
sql>