Welcome to SQL Task 1 of my Elevate Labs internship! This project demonstrates my ability to set up a SQL environment and perform fundamental database operations, including schema definition and data manipulation.
The primary goal of this task is to:
- Initialize: Create and configure a local SQL database.
- Define Schema: Design a robust table structure for student data.
- Populate: Insert sample records to ensure data integrity.
- Query: Perform basic CRUD-style operations to retrieve and filter information.
To successfully run the scripts in this project, ensure you have the following:
- SQL Server: MySQL, MariaDB, or any compatible SQL engine.
- SQL Client: A command-line interface (CLI) or a graphical tool like MySQL Workbench.
The project focuses on a centralized students table designed to store essential academic information.
| Column Name | Data Type | Description |
|---|---|---|
π id |
INT |
Primary Key, Auto-incremented |
π€ name |
VARCHAR(50) |
Full name of the student |
π§ email |
VARCHAR(100) |
Unique email address of the student |
π
age |
INT |
Age of the student |
Follow these steps to initialize and test the database:
- Start Server: Ensure your SQL server instance is running.
- Connect: Use your preferred SQL client to connect to the server.
- Execute Script: Open and run the
task1.sqlfile.source path/to/task1.sql;
- Verify: Check the output to ensure the
task1database andstudentstable are correctly created and populated.
The task1.sql script includes several essential SQL operations:
CREATE DATABASE task1;
USE task1;CREATE TABLE students (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(50),
email VARCHAR(100),
age INT
);- All Data:
SELECT * FROM students; - Specific Columns:
SELECT name, email FROM students; - Conditional Search:
SELECT * FROM students WHERE age > 20;
Tip
Always ensure you are using the correct database context (USE task1;) before running subsequent queries to avoid errors.
Submitted by: Vijayapandian T | Elevate Labs SQL Internship Task 1