0% found this document useful (0 votes)
42 views37 pages

Pawan

Uploaded by

bmaan8665
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views37 pages

Pawan

Uploaded by

bmaan8665
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

1

INDUSTRIAL TRAINING INTERNSHIP


REPORT
TOPIC
SQL DOMAIN
2 nd June 2025 - 3 rd Aug 2024

Under the Guidance of: Submitted By:


Ms. PRERNA​ Pawan Manghnani
A21704823006
Submitted To:​ BCA(AIIT)
Prof Rizwan Alam

AMITY INSTITUTE OF INFORMATION TECHNOLOGY


2

CONTENTS

●​ Declaration​

●​ Acknowledgement​

●​ Internship Certificate​

●​ Abstract​

●​ Introduction​

●​ Objectives of the Internship​

●​ Roles and Responsibilities​

●​ Task Descriptions​

●​ Tools and Platforms Used​

●​ Challenges Faced and Solutions​

●​ Learning Outcomes​

●​ Key Contributions​

●​ Team Collaboration and Communication​

●​ Reflections and Professional Growth​

●​ Conclusion
3

DECLARATION

I, Pawan Manghnani, Enrolment Number – A21704823006, student of Bachelor of Computer


Applications (BCA) at Amity University Rajasthan, hereby declare that this internship report
titled “SQL-Based Data Querying and Optimization Internship” is an original and authentic
account of the work I have undertaken during the internship period from 3rd June 2024 to 28th
July 2024.

This internship was carried out as part of my academic curriculum under the esteemed guidance
of Ms. Prerna, and it provided me with hands-on experience in the domain of Structured Query
Language (SQL). The report outlines the various tasks I completed, which included solving
real-world SQL problems, writing optimized queries, working with relational database schemas,
and understanding the principles of data retrieval and manipulation.

Throughout the internship, I worked on a series of structured tasks and a capstone project that
enabled me to apply theoretical knowledge in practical scenarios, enhancing both my technical
skills and logical reasoning capabilities. This experience also strengthened my foundation in
database concepts and query performance optimization.

Date: ________________
Place: ____________________
4

Acknowledgement

I would like to express my heartfelt gratitude to Celebal Technologies for providing me with the
invaluable opportunity to complete my internship in the field of SQL and Database Management.
This internship has played a significant role in enhancing my technical capabilities and
understanding of real-world database systems.

I am especially thankful to my mentor, Ms. Prerna, for her consistent support, encouragement,
and expert guidance throughout the internship. Her mentorship helped me deepen my knowledge
of SQL, write more efficient queries, and develop a structured approach to solving
database-related problems.

I would also like to extend my sincere thanks to my faculty members and the Amity Institute of
Information Technology (AIIT), Amity University Rajasthan, for their unwavering support and
for facilitating this enriching internship opportunity. Their academic guidance laid the strong
foundation upon which I could build my technical experience.

This internship has significantly contributed to my growth as a student and as an aspiring data
professional. It has not only strengthened my skills in SQL, relational databases, and data analysis
but also helped me develop discipline, independence, and a professional work ethic.

I am truly grateful for the lessons learned and the confidence gained during this journey, which I
believe will serve as a stepping stone in my future career.

With Sincere Regards


Pawan Manghnani
5
6
7

Abstract

This report presents a comprehensive overview of my internship experience at Celebal


Technologies, where I worked in the domain of SQL-based data querying and optimization. The
internship provided me with a practical platform to apply the concepts of database management,
structured query language, and data analysis in a real-world setting.

Throughout the internship period, I focused on solving SQL problems involving data retrieval,
filtering, aggregation, subqueries, joins, and performance optimization. I worked on a structured
series of tasks, each designed to enhance specific technical skills such as writing efficient queries,
understanding relational database schemas, and applying logical problem-solving techniques.
These tasks simulated real business scenarios and helped me understand how data is handled and
processed in professional environments.

In addition to the individual tasks, I also developed a capstone SQL project that consolidated the
skills I acquired. This project involved designing a clean database schema, writing complex
queries, and hosting the entire solution on GitHub for collaborative and academic review.

The tools and technologies I used included MySQL, PostgreSQL, and GitHub, along with basic
command-line and IDE support. The experience significantly improved my fluency in SQL
syntax, logical reasoning, and understanding of how efficient querying plays a crucial role in
data-centric industries.

This internship was not only a technical learning experience but also a step forward in developing
professionalism, self-discipline, and accountability. It gave me valuable insight into the
workflows, expectations, and best practices followed in the industry and further fueled my
interest in data and backend development.
8

Introduction

In the digital age, data has become one of the most valuable assets, and the ability to efficiently
store, retrieve, and analyze this data is critical for any organization. At the core of this process lies
Structured Query Language (SQL) — the industry-standard language for interacting with
relational databases. Mastery of SQL is essential for developers, analysts, and data professionals
across various domains.

As part of my academic curriculum at Amity University Rajasthan, I had the opportunity to


undertake an internship at Celebal Technologies, a leading IT solutions company known for its
work in enterprise data management, cloud computing, and AI-driven platforms. The internship
was focused on building strong foundational skills in SQL-based data querying, optimization, and
real-world problem solving.

The primary goal of this internship was to bridge the gap between academic knowledge and
practical industry requirements by working on real-time SQL challenges and tasks. I was given
the chance to explore SQL operations in depth — including SELECT, JOIN, GROUP BY, nested
subqueries, data filtering, and performance tuning — while understanding how these apply in the
context of professional data workflows.

In addition to solving structured SQL problems, I also designed and implemented a mini-project
that allowed me to integrate everything I learned into a single, cohesive application. This
experience helped me improve my logical thinking, code structuring, and query optimization
skills.

This report details my learning journey during the internship, the tasks I performed, tools I used,
and the skills I developed. It also includes a description of the project I completed, which served
as a capstone to my experience and growth in the SQL domain.
9

About the Company – Celebal Technologies

Celebal Technologies is a leading Indian IT services company specializing in enterprise cloud,


data, and AI-driven solutions. Headquartered in Jaipur, Rajasthan, the company has rapidly
emerged as a global player, delivering cutting-edge digital transformation services to clients
across multiple industries such as healthcare, finance, manufacturing, and retail.

Celebal Technologies is known for its expertise in:

●​ Data Engineering​

●​ Artificial Intelligence and Machine Learning​

●​ Cloud Computing (Azure, AWS, GCP)​

●​ Big Data Solutions​

●​ Business Intelligence and Analytics​

With a strong focus on innovation, Celebal has built several AI-powered products and platforms
that help businesses leverage their data for smarter decisions. The company is also a Microsoft
Gold Partner, demonstrating its excellence in delivering Microsoft-based enterprise solutions.

During my internship at Celebal Technologies, I experienced a professional and collaborative


environment where learning and experimentation were highly encouraged. The mentors and team
members were extremely knowledgeable, and I was given ample opportunities to apply and
expand my skills in SQL, database optimization, and data querying. My time here gave me an
inside look at how enterprise data problems are approached and solved with precision and scale.
10

The internship was designed to achieve the following specific goals:


The internship was designed to give Tarun hands-on exposure to frontend web development in a
team-oriented project. The following were the main objectives:

1.​ To Strengthen Practical SQL Skills​


Develop hands-on experience in writing efficient and optimized SQL queries using
real-world scenarios and datasets.​

2.​ To Understand Relational Database Concepts​


Gain a deeper understanding of relational databases, including table relationships,
normalization, schema design, and indexing.​

3.​ To Solve Real-World Data Problems​


Apply SQL to solve structured problems involving data retrieval, filtering, aggregation,
joins, subqueries, and analytical queries.​

4.​ To Learn Query Optimization Techniques​


Focus on improving query performance through indexing, query structuring, and
understanding execution flow.​

5.​ To Work with Industry Tools and Platforms​


Get exposure to tools such as MySQL, PostgreSQL, and GitHub — commonly used in
professional environments for database development and version control.​

6.​ To Build a Mini SQL Project for Practical Application​


Design and implement a complete SQL-based solution that demonstrates understanding
of schema creation, query formulation, and result interpretation.​

7.​ To Enhance Logical and Analytical Thinking​


Sharpen problem-solving abilities by approaching each SQL task with a structured and
analytical mindset.​

8.​ To Prepare for Industry-Level Expectations​


Develop self-discipline, time management, and attention to detail through regular task
submissions and code reviews aligned with industry practices.
11

Role and Responsibilities Overview


During my internship at Celebal Technologies, I worked in the capacity of an SQL Intern,
where my primary focus was to strengthen my understanding of relational databases and enhance
my skills in writing optimized SQL queries for real-world data problems.

My responsibilities were structured around learning and applying the core principles of
Structured Query Language (SQL) through hands-on tasks, research, and independent
problem-solving. I was expected to complete technical assignments, develop clean and efficient
query logic, and follow best practices in database handling and data retrieval.

Key Responsibilities Included:

1.​ Solving SQL-Based Tasks​


Tackling a series of structured SQL exercises ranging from basic data selection to
complex joins, nested subqueries, and aggregation functions.​

2.​ Working with Relational Databases​


Interacting with real and simulated datasets to understand schema design, foreign key
relationships, normalization, and table structuring.​

3.​ Optimizing SQL Queries​


Writing queries not just for accuracy but also for performance — using indexing,
minimizing redundancy, and structuring queries for efficiency.​

4.​ Documenting Solutions and Workflow​


Maintaining clean, well-commented code for each task in a GitHub repository, and
documenting query logic and expected outcomes for academic and peer reference.​

5.​ Project Execution​


Designing and implementing a mini SQL project as a culmination of the tasks,
demonstrating end-to-end understanding of a practical data querying solution.​

6.​ Following Professional Work Standards​


Meeting task deadlines, adhering to formatting and submission guidelines, and
communicating progress clearly when needed.
12

TASK DESCRIPTION

Task 1: SQL Assignment Documentation on AdventureWorksDW2014


Objective:​
The objective of this task was to explore and query the AdventureWorksDW2014 data
warehouse database using Structured Query Language (SQL). The goal was to solve
business-oriented problems and perform data analysis by writing queries that extract meaningful
insights from a large, relational data warehouse schema.

This task focused on improving proficiency in SQL for business intelligence, including filtering,
joining tables, performing aggregations, applying grouping, and handling schema-specific
constraints.

Overview:​
This task consisted of solving 42 SQL questions based on the AdventureWorksDW2014
database — a Microsoft-provided sample data warehouse used for analytics and reporting
practice. The queries addressed real-world business scenarios, such as customer analysis, sales
trends, product performance, and regional revenue distribution.

Notes and Assumptions:

●​ The project used the AdventureWorksDW2014 schema, which differs from the
transactional (OLTP) version.​

●​ Certain columns available in the OLTP version (e.g., FaxNumber in DimCustomer) were
not present in the DW schema. In such cases, assumptions were made, or alternate fields
were used.​

●​ The queries were designed to work specifically within the data warehouse context,
focusing on dimensions and fact tables.​

How to Perform:

1.​ Set up the SQL Server environment and restore the AdventureWorksDW2014
database.​

2.​ Explore the schema, understand key tables such as FactResellerSales, DimCustomer,
DimProduct, DimGeography, and others.​

3.​ Write SQL queries to answer 42 predefined business questions.​


13

4.​ Use advanced SQL operations such as:​

○​ JOIN, GROUP BY, HAVING​

○​ Window functions (e.g., RANK(), ROW_NUMBER())​

○​ Aggregations (SUM, AVG, MAX, COUNT)​

○​ Filters using WHERE and CASE WHEN​

Tools Used:

●​ Microsoft SQL Server​

●​ SSMS (SQL Server Management Studio) for query execution​

●​ GitHub for documentation and version control​

Outcome:​
Successfully wrote and documented 42 queries that cover various business analytics scenarios.
This task improved my skills in querying large schemas, handling real-world data warehouse
design, and using SQL as a data reporting tool.
14

Task 2: Level B – SQL Assignment on AdventureWorksDW2014

Objective:​
The objective of this task was to solve intermediate-level SQL problems focused on real-world
analytics using the AdventureWorksDW2014 data warehouse. This task aimed to strengthen my
ability to perform business reporting and draw insights using SQL functions like aggregation,
filtering, joins, and grouping.

Overview:​
As part of this task, I wrote 9 SQL queries to address various data reporting and analytical
questions, such as identifying top customers, unsold products, customer demographics, and
revenue-based ranking. These queries simulated practical use cases that a data analyst might
encounter in a business intelligence environment.

Questions Covered:

1.​ List the names and emails of all customers who purchased more than 5 products in a
single order.​

2.​ List the names and emails of customers who have placed more than 3 orders.​

3.​ List customers who have placed orders in the year 2010.​

4.​ List the top 5 customers with the highest total purchase amount.​

5.​ List products which were never sold.​

6.​ List the total quantity sold for each product.​

7.​ List product name and revenue generated from it.​

8.​ List countries and the number of customers from each country.​

9.​ List orders with total quantity greater than 100.​

How to Perform:

1.​ Load the AdventureWorksDW2014 database in SQL Server Management Studio


(SSMS).​

2.​ Explore relevant dimension and fact tables such as:​

○​ DimCustomer, DimProduct, DimGeography, FactInternetSales​


15

3.​ Write SQL queries using key operations:​

○​ INNER JOIN, GROUP BY, HAVING, COUNT, SUM​

○​ Date filtering with YEAR() function​

○​ TOP, ORDER BY, and NOT IN subqueries​

4.​ Test each query on the dataset and validate outputs.​

5.​ Document the queries with comments for clarity and version control via GitHub.​

Tools Used:

●​ SQL Server Management Studio (SSMS)​

●​ AdventureWorksDW2014.bak (Data Warehouse schema)​

●​ GitHub for code documentation and repository management​

Outcome:​
Completed 9 analytical SQL queries that solved reporting-based use cases. This task significantly
improved my understanding of intermediate SQL logic, data aggregation, and practical business
analysis using structured queries.
16

Task 3: Advanced SQL Challenges and Real-World Scenarios


Objective:​
The goal of this task was to solve a set of 20 advanced SQL problems, each simulating
real-world business, technical, or data analytics scenarios. These tasks pushed my understanding
of SQL to an advanced level, covering topics such as aggregation, set operations, pivoting,
recursive relationships, data cleansing, security, and system-level operations.

Overview:​
Each SQL problem was crafted to represent a unique challenge frequently encountered in
real-world enterprise databases. From salary analysis and binary trees to user creation and cost
distribution, the diversity of queries tested my ability to think analytically and code efficiently
without relying on basic techniques like ORDER BY or joins in some cases.

Key Tasks Covered:

1.​ Departmental Average Salary Analysis – Find departments with above-average salaries.​

2.​ Top Earners by Department – Retrieve the highest-paid employee in each department.​

3.​ Employees Without Projects – Identify employees not working on any project.​

4.​ Duplicate Emails Detection – Detect repeated email addresses in employee records.​

5.​ Hackers Contest Statistics – Daily participant count and top submitters.​

6.​ Manhattan Distance Calculation – Calculate city-block distance between coordinates.​

7.​ Prime Numbers Up to 1000 – Print all primes ≤1000 separated by &.​

8.​ Occupation Pivot Table – Transform row data into columns grouped by occupation.​

9.​ Binary Tree Node Type – Classify nodes as Root, Inner, or Leaf.​

10.​Company Hierarchy Report – Display company hierarchy and count of roles.​

11.​Best Friend Salary Comparison – Students whose best friends got higher offers.​

12.​Cost Distribution: India vs International – Compare job family costs across locations.​

13.​BU Cost vs Revenue Ratio – Show month-wise cost-to-revenue ratio by BU.​


17

14.​Sub-band Headcount Percentage – Headcount by sub-band with percentages (no


JOINs).​

15.​Top 5 Salaries (No ORDER BY) – Retrieve top salaries without ORDER BY.​

16.​Swap Two Columns Without Temp Variable – Arithmetic/bitwise swap of column


values.​

17.​Create User and Assign DB Owner Role – SQL user creation and permission
assignment.​

18.​Weighted Average Cost – Monthly weighted cost per Business Unit.​

19.​Salary Miscalculation (Zeroes Removed) – Correct average salary excluding 0s.​

20.​Copy New Data Without Identifiers – Transfer only new records between tables without
using unique indicators.​

How to Perform:

1.​ Set up SQL environment (SQL Server / PostgreSQL / MySQL).​

2.​ Create mock or use sample datasets (where applicable).​

3.​ Break down each problem into logical components before coding.​

4.​ Apply advanced SQL techniques:​

○​ Window functions, CTEs, case statements​

○​ Pivot/Unpivot, Groupings, Bitwise operations​

○​ User creation, permissions, and system procedures.​

5.​ Optimize query performance and validate accuracy with sample inputs.​

Tools Used:

●​ SQL Server Management Studio (SSMS)​


18

●​ Mock Datasets & Views​

●​ GitHub for version control and documentation​

Outcome:​
Completed 20 high-level SQL problems spanning analytics, admin operations, and database
logic. These challenges significantly improved my fluency in writing advanced queries and taught
me how to think beyond traditional SQL patterns.
19

Task 4: Subject Allotment System using Stored Procedures


Objective:


The objective of this task was to create an automated subject allotment system using a stored
procedure in SQL. The system simulates a real-world use case where students are allotted
subjects based on their preferences and academic performance (GPA), while considering seat
availability constraints. This task enhanced my understanding of stored procedures, control flow
logic, cursors, and dynamic decision-making in SQL.

Problem Statement:​
Each student selects five preferred subjects, ranked in order.​
Each subject has a limited number of available seats.​
Students must be allotted a subject based on the following rules:

●​ Allotment is based on GPA in descending order (highest first).​

●​ The system checks the student's preferences from 1 to 5.​

●​ The first available subject from their preference list is allotted.​

●​ If no preferred subject is available, the student is added to an unallotted list.​

Database Design:

Table Name Description

StudentDetails Stores student info along with GPA.

SubjectDetails Holds subject names and available seats.

StudentPreference Records 5 subject preferences per student.

Allotments Output table storing final student-subject mapping.

UnallottedStudents Students who didn’t receive any subject.

Stored Procedure: AllocateSubjects


20

This procedure implements the allotment logic:

●​ Uses a cursor to iterate over students sorted by descending GPA.​

●​ For each student:​

○​ Checks their subject preferences one by one (Preference 1 to 5).​

○​ Allots the first subject with available seats.​

○​ Updates the seat count in SubjectDetails.​

○​ Records the allotment in either Allotments or UnallottedStudents table.​

Execution Steps:

1.​ Create Tables:​

○​ StudentDetails, SubjectDetails, StudentPreference, Allotments, UnallottedStudents​

2.​ Insert Sample Data:​


Add dummy data for students, subjects, and preferences.​

Outcome:​
Successfully implemented a functional and intelligent subject allotment system in SQL. The
task demonstrated the power of stored procedures and logic-driven SQL operations in solving
real-world automation problems involving conditional allocation and resource limits.
21

Task 5: SQL Subject Allotment System

Objective:​
The objective of this task was to design and implement a subject allotment system in SQL that
automatically assigns students to their preferred open elective subjects based on their GPA and
seat availability. The task involved developing a stored procedure to replicate a realistic scenario
where limited resources must be fairly distributed according to academic merit and preference
hierarchy.

Problem Statement:​
Each student submits five subject preferences. The system must allot subjects using the
following logic:

●​ Students with higher GPA are prioritized.​

●​ Each subject has a limited number of available seats.​

●​ A student is allotted the first subject from their preferences that still has remaining
seats.​

●​ If none of the five preferred subjects are available, the student is added to an unallotted
list

Stored Procedure: AllocateSubjects

This procedure performs the automated allocation by:

●​ Sorting all students in descending order of GPA.​

●​ Iterating through each student using a cursor.​

●​ Checking preferences from 1 to 5 in order.​

●​ Allotting the first subject with available seats.​

●​ Updating the RemainingSeats count in SubjectDetails.​

●​ Inserting the result into either the Allotments or UnallottedStudents table.​


22

Outcome:​
This task successfully simulated a real-world allocation problem using SQL. It deepened my
understanding of stored procedures, cursor control flow, seat management logic, and data integrity
handling within multi-step transactions. The project also tested my ability to design clean
database schemas aligned with business logic.
23

Task 6: LeetCode SQL Practice Assignment – Core SQL Concepts


Objective:​
The goal of this task was to strengthen core SQL skills by solving a curated set of 15 easy-level
SQL problems from LeetCode. These problems were selected as part of the Week-6 training
module (Pivot) during my internship at Celebal Technologies. The assignment focused on
reinforcing concepts through practical implementation and logical reasoning in SQL.

Overview:​
This assignment consisted of solving diverse SQL problems covering a range of foundational
topics such as SELECT, WHERE, JOINs, GROUP BY, aggregations, subqueries, and CASE
statements. Each query was written using standard SQL syntax, properly commented, and
successfully tested on LeetCode’s platform..

Outcome:​
Successfully solved 15 real-world inspired SQL problems, which helped improve my ability to
write clean, readable, and logical SQL queries. This task significantly enhanced my confidence in
core SQL operations and served as valuable practice for both interviews and real-time backend
problem-solving.
24

Task 7: Stored Procedures for Slowly Changing Dimensions (SCD Types)


Objective:​
The aim of this task was to implement Stored Procedures that handle various types of Slowly
Changing Dimensions (SCDs), a key concept in data warehousing and dimensional modeling.
These procedures are used to manage and track changes in dimensional data over time using
different strategies (SCD Types 0, 1, 2, 3, 4, and 6). This task was part of the SQL001 module
during my internship at Celebal Technologies.

Table Structure Assumptions:

●​ Source Table: stg_customer​

●​ Target Dimension Table: dim_customer​

●​ History Table (SCD Type 4): hist_customer​

●​ Primary Key: customer_id​

●​ Tracked Attribute: email​

●​ Versioning Columns: start_date, end_date, current_flag, version, prev_email​

Outcome:​
This task provided deep insight into enterprise-level data warehouse maintenance, especially how
to manage historical data effectively using different SCD strategies. It also reinforced my ability
to write reusable, logic-driven stored procedures for scalable ETL and reporting systems.
25

Task 8: Time Dimension Stored Procedure

Objective:​
The objective of this task was to develop a Stored Procedure in MySQL that dynamically
populates a Time Dimension table for an entire year based on a single input date. This task is
crucial in the context of data warehousing where a fully populated and richly attributed date
dimension is used in reporting, dashboards, and analytical models.

Task Description:​
When a user passes any date (e.g., '2020-07-14') to the stored procedure, it extracts the year
(2020) and populates all 366 dates (including leap year logic) with complete date-related
attributes.

This includes calendar details (day, month, quarter), fiscal information, ordinal suffixes, and
week details — making the Time Dimension a complete reference dataset.

Implementation Breakdown:

1. Script: create_time_dimension_table.sql​
Defines the schema of the TimeDimension table using appropriate data types, with Date or
INT fields depending on column meaning. SKDate is set as the Primary Key.

2. Script: populate_time_dimension_procedure.sql​
Contains the stored procedure:

Outcome:​
Successfully created a reusable, dynamic Time Dimension builder using only one efficient insert
query and rich SQL logic. This task enhanced my skills in dimensional modeling, date-based
analytics, and procedure-driven automation — which are key skills in modern data engineering
and reporting.
26
27

Minor Project
Departmental Average Salary Analysis with Threshold Comparison

Objective:​
The purpose of this project was to analyze and compare department-wise average salaries
against the overall company-wide average salary using SQL. The goal was to identify
departments that maintain higher salary standards than the organizational average, which can help
in workforce planning, budgeting, and retention strategies.

Overview:​
This project demonstrates how SQL can be used not just for data retrieval, but also for analytical
comparison and threshold-based filtering. Using aggregation and filtering techniques, I
retrieved departments whose average employee salary exceeds the overall company average.
The final output includes:

●​ Department Name​

●​ Average Salary​

●​ Number of Employees​

Sample Data:

●​ Departments include: Development, Marketing, Sales​

●​ Employee distribution across departments includes a total of 8 employees with varying


salary levels.​

SQL Logic Applied:

●​ Step 1: Calculate overall average salary across all employees.​

●​ Step 2: Group employees by department and compute:​

○​ Average salary​

○​ Employee count​
28

●​ Step 3: Filter departments where departmental average > overall average.​

Tools Used:

●​ MySQL​

●​ SQL Server Management Studio (SSMS)​

●​ GitHub for documentation and storage​

Outcome:​
This project enhanced my ability to use aggregate functions, subqueries, and comparative
logic in SQL. It also taught me how to perform department-level business intelligence analysis —
a common requirement in HR and financial reporting systems.
29

Challenges Faced and Solutions


Throughout my internship at Celebal Technologies, I encountered a wide range of challenges that
tested not only my technical skills but also my ability to think logically, manage time, and remain
patient while debugging. These challenges played a significant role in shaping my learning
experience, helping me become more independent, confident, and industry-ready.

1. Recursive Logic in Time Dimension Generation

One of the most intellectually demanding tasks was building a Stored Procedure to populate a
Time Dimension table using only a single INSERT INTO ... SELECT statement. The traditional
approach would have involved inserting records one by one or using loops — however, these
were restricted in the problem constraints.

Challenge:​
I had to dynamically generate 365 (or 366) rows based on a single input date and extract multiple
attributes like day names, fiscal periods, quarters, suffixes, and more — without using multiple
insert statements.

Solution:​
After researching advanced SQL patterns, I implemented a Recursive Common Table Expression
(CTE) — a powerful feature in MySQL 8.0+. I used this to dynamically generate a sequence of
dates for the entire year. Within that single recursive result set, I calculated all required fields
using built-in date functions like DATE_FORMAT(), DAYOFYEAR(), WEEK(), QUARTER(),
and conditional logic for suffixes and fiscal periods. This was my first time writing such a
complex recursive query and it taught me how much logic SQL can handle when written with
care.

2. Understanding and Implementing SCD Types

Another key challenge was building stored procedures for all six types of Slowly Changing
Dimensions (SCD) — an essential but rarely explored concept at the college level.

Challenge:​
Each SCD type (0, 1, 2, 3, 4, and 6) had a distinct purpose, requiring careful understanding of
how to track changes, retain history, update live records, and structure versioned tables. Some
types required additional columns like start_date, end_date, current_flag, and even a separate
history table.
30

Solution:​
I studied data warehousing concepts from Microsoft documentation, blog articles, and GitHub
repositories to understand the best practices. For each type:

●​ I wrote modular stored procedures with MERGE-like logic using IF EXISTS, UPDATE,
and INSERT.​

●​ I built logic to set current_flag and versioning columns based on the update strategy.​

●​ I used temporary staging tables (stg_customer) and designed the dim_customer schema in
a way that supported rollback-friendly testing.​

Implementing SCD Type 6, which combines features of Type 1, 2, and 3, was the most
complicated. But solving this taught me to carefully plan schema structures and logic flows in
SQL — something I had never done before this internship.

3. Query Optimization and Logical Errors in Joins

Early in the internship, while solving LeetCode SQL problems and project-level queries, I
frequently encountered issues with wrong output, Cartesian products, and slow-running queries.

Challenge:​
At times, the results seemed correct at first glance, but subtle logic flaws in JOINs, GROUP BY,
or missing WHERE clauses led to incorrect aggregations or duplication.

🛠 Solution:​
I started writing queries with a "debugging mindset." I learned to:

●​ Break large queries into smaller testable parts.​

●​ Use aliases and indentation for better readability.​

●​ Use EXPLAIN to understand execution plans.​

●​ Use DISTINCT only where logically appropriate.​

●​ Verify outputs by comparing row counts manually with filtered queries.​

This helped me not just fix existing problems, but also write more confident and scalable
queries in my later tasks.
31

Tools and Technologies Used

During my internship at Celebal Technologies, I worked with a range of tools, platforms, and
technologies that supported both learning and task execution. These tools enabled me to write,
test, deploy, and document SQL queries and stored procedures in real-world data environments.

Here is a comprehensive list of the technologies used during the course of the internship:

1. SQL Server Management Studio (SSMS)

The primary environment used for writing and executing SQL queries. SSMS provided a
user-friendly interface to connect with SQL Server, manage databases, and debug queries in
real-time. I used it extensively for:

●​ Query testing and tuning​

●​ Writing stored procedures​

●​ Executing recursive queries and CTEs​

●​ Managing schema and tables​

2. MySQL / MySQL Workbench

Used in scenarios where tasks were required to be tested using MySQL-specific syntax, especially
for stored procedures, dynamic date functions, and recursive Common Table Expressions (CTEs).
MySQL Workbench was particularly useful in building the Time Dimension generator.

3. GitHub

Used for version control and project documentation. All SQL tasks and project files were hosted
in a public GitHub repository, where I maintained clean formatting, comments, and structure.
GitHub also allowed me to demonstrate my work to mentors and future recruiters.

4. LeetCode SQL Practice Platform


32

Used to solve real-world SQL problems and validate solutions against test cases. It helped me
enhance my logical thinking and apply theoretical concepts in structured scenarios, especially for
beginner and intermediate-level SQL logic.

5. Excel (for Attribute Reference)

Used only as a reference sheet for columns and data format in the Time Dimension task. While no
static data was copied, it guided the schema design for various date-related attributes like fiscal
periods, day suffixes, and calendar values.

6. Recursive CTEs (Common Table Expressions)

An advanced SQL feature used to dynamically generate a sequence of dates without using loops.
This was key in solving the Time Dimension task with a single INSERT INTO ... SELECT
statement, respecting the constraints.

7. Stored Procedures and Control Flow Constructs

Throughout the internship, I wrote multiple stored procedures involving:

●​ Conditional logic (IF...ELSE)​

●​ Cursors for row-by-row operations​

●​ Dynamic updates and insertions​


This helped me implement robust business logic like Subject Allotment, SCD Types, and
Data Loading.​

8. Subqueries, Joins, CASE statements

These were core to every SQL task. I worked extensively with:

●​ INNER, LEFT, SELF joins​

●​ Nested SELECT statements​

●​ CASE for conditional transformations​


33

9. Versioning and Documentation Practices

Through regular commit messages, README files, and structured comments, I learned how to
document SQL code professionally, which made my work reusable and easy to understand.

These tools, combined with a logical mindset and structured learning, helped me develop both
confidence and competency in SQL development and data warehousing practices.
34

📘 Learnings and Takeaways


My internship experience at Celebal Technologies was a turning point in my journey as a
technical learner and aspiring software engineer. It provided me with real-world exposure to
database systems, beyond the traditional classroom environment, and helped me grow not just as
a coder, but as a responsible and independent contributor.

Here are the most important learnings and takeaways from my internship:

1. Mastery of SQL Fundamentals

Before the internship, my SQL knowledge was limited to basic queries and simple use cases.
Over the course of this internship:

●​ I mastered advanced SQL topics like joins, subqueries, window functions, and
aggregations.​

●​ I developed confidence in writing multi-step logic in SQL using real data.​

2. Practical Understanding of Data Warehousing Concepts

One of the highlights of the internship was learning about Slowly Changing Dimensions (SCD
Types) — a core part of dimensional modeling. I implemented:

●​ Type 1 (overwrite)​

●​ Type 2 (versioning)​

●​ Type 6 (hybrid model)​

This gave me clarity on how businesses track historical changes in data and structure ETL
pipelines.

3. Working with Stored Procedures and Automation

For the first time, I wrote dynamic stored procedures involving loops, cursors, conditional logic,
and recursive CTEs. This helped me:
35

●​ Understand procedural SQL​

●​ Automate data tasks​

●​ Write clean and reusable backend logic​

4. Solving Real Business Problems Using SQL

From subject allotment systems to salary analysis and time dimension generation — every task
was rooted in real-world logic. I learned how to:

●​ Break down complex problems​

●​ Convert business rules into SQL logic​

●​ Anticipate edge cases and optimize solutions​

5. Version Control and Code Documentation

Using GitHub taught me the importance of organizing code, writing meaningful commit
messages, and maintaining clean documentation. This is a crucial skill in collaborative software
development.

6. Patience and Debugging Discipline

At times, queries didn’t work as expected. Joins broke, procedures failed, or logic was wrong. But
I learned to:

●​ Debug line by line​

●​ Use test data effectively​

●​ Research solutions independently​

This gave me confidence to handle future coding challenges.


36

7. Preparedness for Industry

Overall, this internship helped me realize what it means to work in a professional,


deadline-driven, problem-solving environment. It bridged the gap between textbook SQL and
industry SQL — something college alone cannot fully offer.

I will carry these lessons forward into my academic projects, future internships, and eventually
my career in software engineering and data systems. The experience made me more disciplined,
confident, and inspired to keep learning.
37

Conclusion
The internship at Celebal Technologies has been a transformative experience in my academic and
professional journey. Over the course of two months, I gained hands-on exposure to real-world
SQL tasks, database optimization techniques, and data analysis workflows. Each assignment —
from writing basic SELECT queries to developing stored procedures for subject allotment and
handling Slowly Changing Dimensions — challenged me to think analytically and apply
theoretical concepts in practical scenarios.

Working with tools like SQL Server Management Studio (SSMS), MySQL, and GitHub helped
me understand the standard practices followed in the industry. The projects and challenges pushed
me to explore advanced SQL topics such as window functions, pivoting, recursive queries, and
dynamic stored procedures, significantly strengthening my logical reasoning and problem-solving
abilities.

Beyond the technical skills, this internship also helped me grow as a professional. I learned the
importance of writing clean, maintainable code, managing time effectively, documenting work
properly, and communicating within a structured workflow. Collaborating with mentors and
adhering to deadlines taught me discipline, attention to detail, and how to align with real industry
expectations.

My capstone project — Departmental Average Salary Analysis — allowed me to consolidate


everything I learned and see the real impact SQL can have in making data-driven decisions for
organizations.

In conclusion, this internship has not only equipped me with a solid foundation in SQL and
database systems but also inspired me to continue exploring the fields of data engineering,
analytics, and backend development. I am truly grateful for this opportunity and confident that the
skills acquired will play a pivotal role in shaping my future career in the tech industry.

You might also like