Project Overview
Welcome to the SQL Alien Invasion Challenge: Defend Earth! As Earth’s data analyst, you are at the forefront of humanity’s defense against an imminent alien invasion. Your mission is to analyze and manage crucial data related to alien activities, Earth’s defenses, resource allocations, and population safety. Through strategic SQL queries, you’ll uncover patterns, optimize defenses, and ensure the survival of humanity.
Embark on this thrilling adventure to apply your SQL skills in a high-stakes, intergalactic scenario!
Objective
By completing this project, you will:
- Understand Complex Database Structures: Navigate relationships between various entities involved in Earth’s defense.
- Execute Advanced SQL Queries: Perform data manipulation and analysis to support strategic decision-making.
- Optimize Resource Allocation: Ensure efficient distribution of limited resources to bolster Earth’s defenses.
- Monitor Alien Activities: Analyze patterns in alien movements and attacks to anticipate future threats.
- Ensure Population Safety: Manage and analyze data to protect Earth’s population from alien incursions.
Watch your training video below:
Tasks
Embark on the following tasks to defend Earth against the alien invasion. Each task is designed to guide you through critical data analysis scenarios using SQL. After completing each task, you can check your answers using the provided sample queries.
Schema Overview
Below is a detailed schema of the database you will be working with in the exercises. The schema provides the structure for the tables, including their column names, data types, and a description of the purpose of each column. Familiarize yourself with this schema before starting the tasks, as it will help you write accurate SQL queries and understand the relationships between the tables.
Each table schema is collapsible for better navigation. Click on a table name to view its columns and details.
Schema Information
Column Name | Data Type | Description |
---|---|---|
artifact_id | INTEGER | Unique identifier for each artifact |
artifact_name | TEXT | Name of the artifact |
artifact_value | INTEGER | Estimated value of the artifact |
current_location | TEXT | Current location of the artifact |
Column Name | Data Type | Description |
---|---|---|
log_id | INTEGER | Unique identifier for each log entry |
artifact_id | INTEGER | Identifier of the artifact |
action | TEXT | Action performed (e.g., 'checked_out', 'returned') |
timestamp | DATETIME | Date and time of the action |
staff_id | INTEGER | Staff involved in the action |
Column Name | Data Type | Description |
---|---|---|
log_id | INTEGER | Unique identifier for each security log |
person_id | INTEGER | Identifier of the person (staff/visitor) |
person_type | TEXT | Type of person ('staff' or 'visitor') |
location | TEXT | Location accessed |
timestamp | DATETIME | Time of access |
Column Name | Data Type | Description |
---|---|---|
movement_id | INTEGER | Unique identifier for each movement log |
artifact_id | INTEGER | Identifier of the artifact |
from_location | TEXT | Location artifact was moved from |
to_location | TEXT | Location artifact was moved to |
timestamp | DATETIME | Date and time of the movement |
Column Name | Data Type | Description |
---|---|---|
interaction_id | INTEGER | Unique identifier for each interaction |
visitor_id | INTEGER | Identifier of the visitor |
staff_id | INTEGER | Identifier of the staff |
location | TEXT | Location of the interaction |
timestamp | DATETIME | Time of the interaction |
Introduction for the SQL Tasks
Welcome to the SQL Tasks section! These exercises are designed to enhance your SQL skills through practical, real-world scenarios. Each task focuses on a specific objective, helping you build expertise in querying and analyzing data.
For each task, you will find:
- Task Description: A clear objective explaining what data you need to retrieve and the exact columns required in the output.
- Expected Output: The structure and sample rows of the expected result to guide you in writing your query.
To complete a task:
- Write your SQL query in the provided editor.
- Click “Run” to execute your query and see the output.
- Use the “Check Answer” button to compare your output with the expected result. This step provides instant feedback to ensure your query is correct.
If you need to start over, click “Reset” to clear your query and output. These tasks are designed to be engaging and progressively challenging, so take your time and enjoy the process of learning SQL!