0% found this document useful (0 votes)
64 views

Internship Report Sample

Uploaded by

swethagy1509
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views

Internship Report Sample

Uploaded by

swethagy1509
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

SCHOOL OF ENGINEERING AND TECHNOLOGY

An Internship Report
On
“Structured Query Language”

Submitted in partial fulfillment of the requirements for the award of degree in


Bachelor of Technology
in
Computer Science & Engineering
Of CMR University, (Lakeside Campus) Bangalore

Submitted by:
AKANKSHA PRIYA
20BBTCS008

Internship carried out


at
DevSkillHub Training and Consultancy

Internal Guide: External Guide:


Prof.Chethana RM Mr.Vamshi Krishna
Assistant Professor CEO
Dept. of CSE, SOET DevSkillHub

Department of Computer Science & Engineering


Off Hennur-Bagalur Main Road,
Near Kempegowda International Airport, Chagalahatti,
Bangalore, Karnataka-562149
2024-2025
SCHOOL OF ENGINEERING AND TECHNOLOGY
Department of Computer Science & Engineering

CERTIFICATE

This is to certify that the Internship work entitled “SQL INTERNSHIP”, submitted to the CMR
University, Bangalore, in partial fulfillment of the requirements for the award of the degree of Bachelor of
Technology in Computer Science is a record of work done by Ms.Akanksha Priya bearing university
register number 20BBTCS008 during the academic year 2024-25 at School of Engineering and Technology,
CMR University, Bangalore under my supervision and guidance. The Internship report has been approved
as it satisfies the academic requirement in respect of internship work prescribed for the said degree.

Internal Guide: External Guide:


Prof. Chethana RM Mr. Vamshi Krishna
Assistant Professor CEO
Dept. of CSE DevSkillHub
SOET, Bangalore

Signature of the HOD Signature of the Dean


(Dr. Rubini P) (Dr. Rubini P)

Examiners Signature with date

(1) _____ ______ _____ ______


Name Signature

(2) _____ ______ _____ ______


Name Signature
DECLARATION

I, Akanksha Priya bearing USN 20BBTCS008, student of Bachelor of Technology,


Computer Science and Engineering, CMR University, Bangalore, hereby declare that the
internship work entitled “SQL INTERNSHIP” submitted by me, for the award of the Bachelor’s
degree in Computer Science and Engineering to CMR University is a record of bonafide work
carried out independently by me under the supervision and guidance of Prof.Chethana RM,
Asst. Prof, CSE Dept. CMR University.

I further declare that the work reported in this internship work has not been submitted and
will not be submitted, either in part or in full, for the award of any other degree in this university
or any other institute or University.

Place: Bangalore

Date: Akanksha Priya


(USN: 20BBTCS008)

i
ACKNOWLEDGEMENT

The satisfaction that accompanies the successful completion of this project would be
incomplete without the mention of the people who made it possible, without whose constant
guidance and encouragement would have made efforts go in vain.

I consider myself privileged to express gratitude and respect towards all those who
guided me through the completion of the project. I express my thanks to my Internal Internship
Guide Prof. Chethana RM, Asst. Professor, Department of Computer Science and
Engineering, School of Engineering and Technology, CMR University for her constant support.

I express my sincere gratitude to my internship external guide Mr. Vamshi Krishna,


CEO, DevSkillHub Training and Consultancy, without whose constant guidance and support the
internship would not be successful.

I would like to express my thanks to Dr. Rubini P, Head of department, Department of


Computer Science and Engineering, School of Engineering and Technology, CMR University,
Bangalore, for his encouragement that motivated me for the successful completion of internship
work.

I express my heartfelt sincere gratitude to Dr. Rubini P, Dean, School of Engineering


and Technology, CMR University for his support.

I would like to express my sincere thanks and gratitude to our internship coordinator
Prof. Prabhakar K for his support, invaluable guidance and encouragement throughout the
tenure of this internship.

AKANKSHA PRIYA

ii
ABSTRACT

This internship report provides a comprehensive overview of the intern's experience in the
field of structured query language. The report outlines the importance of structured query language in
Database management systems. This SQL Internship offers a comprehensive introduction to database
management systems and SQL querying. Interns will gain practical experience in designing,
implementing, and querying databases, honing skills that are invaluable in data-driven environments.
Through a series of structured modules and real-world querying, interns will learn to create efficient
database schema, optimize queries for performance, and understand key concepts such as
normalization and indexing. The internship will also cover advanced topics such as transactions,
stored procedures, and triggers, providing a solid foundation for database administration and
development roles. By the end of the internship, participants will have a strong command of SQL and
the ability to work confidently with relational databases.

Key Learning Objectives:

• Understand fundamental database concepts and principles


• Develop skills in SQL querying, including SELECT, JOIN, and sub queries
• Design and implement efficient database schema
• Optimize queries for performance and scalability
• Explore advanced SQL topics such as transactions, stored procedures, and triggers
• Gain practical experience through real-world projects and case studies
• Prepare for roles in database administration, development, and data analysis

Duration: 2 months

Prerequisites: Basic understanding of databases and SQL is recommended but not required.

iii
TABLE OF CONTENTS
TITLE PAGENO

DECLARATION .................................................................................................................. i

ACKNOWLEDGEMENT ...................................................................................................ii

ABSTRACT ....................................................................................................................... iii

TABLE OF CONTENTS. ................................................................................................... iv

LIST OF FIGURES ............................................................................................................ vi

CHAPTER

1. INTERNSHIP OBJECTIVES .................................................................................. 1

2. INTRODUCTION .................................................................................................. 3

ABOUT DEVSKILLHUB.......................................................................... 3
STRUCTURED QUERY LANGUAGE ...................................................... 3
UNDERSTANDING DATABASE FUNDAMENTALS ............................. 4
MASTERING SQL SYNTAX ....................................................................5
DATABASE DESIGN ............................................................................... 7
QUERY OPTIMIZATION ......................................................................... 8
TRANSACTION AND CONCURRENCY ................................................. 9
STORED PROCEDURES .......................................................................... 9
DATABASE SECURITY ........................................................................ 10

3. INTERNSHIP DISCUSSION .................................................................................. 7

INTRODUCTION TO STRUCTURED QUERY LANGUAGE………..…...11


WHAT IS SQL? ......................................................................................... 12
WHY SQL?............................................................................................... 14
USES OF SQL ........................................................................................... 15

TYPES OF SQL COMMANDS ………………………………….………...16


TYPES OF SQL OPERATORS.....................................................................16
SQL QUERIES...............................................................................................16
iv
SQL CLAUSES ........................................................................................... 17
SQL AGGREGATE FUNCTIONS .............................................................. 17
SQL CONSTRAINTS .................................................................................. 18
SQL VIEWS ................................................................................................ 18
SQL INDEX................................................................................................. 19
SQL WILDCARD OPERATORS ................................................................ 19
PERFORMANCE TUNING......................................................................... 20
SKILLS LEARNT ........................................................................................ 21
WORK EXPERIENCE ............................................................................... 22
CHALLENGES FACED ............................................................................. 22

4. CONCLUSION .......................................................................................................23

5. BIBLIOGRAPHY .....................................................................................................24

v
LIST OF FIGURES

SL NO FIGURES PAGE NO

1 Fig.1.STRUCTURED QUERY 12
LANGUAGE

vi
SQL Internship 2024-25

CHAPTER 1
INTERNSHIP OBJECTIVES

1. Understanding Database Fundamentals:


- Gain a solid understanding of database management concepts
- Data modeling
- Normalization
- Indexing.

2. Mastering SQL Syntax:


- Learn to write complex SQL queries using SELECT, INSERT, UPDATE, DELETE
statements
- Aggregate functions,
- Sub queries
- Joins.

3. Database Design:
- Acquire skills to design efficient and normalized database schemas, considering factors
such as data integrity, scalability, and performance.

4. Query Optimization:
- Learn techniques to optimize SQL queries for improved performance
- Indexing strategies
- Query tuning.

5. Transactions and Concurrency:


- Understand the concepts of transactions
- ACID properties
- Concurrency control mechanisms to ensure data consistency in multi-user environments.

6. Stored Procedures and Triggers:


- Gain hands-on experience in creating and managing stored procedures and triggers to
automate database tasks
- Enforce data integrity constraints.

7. Database Security:
- Learn about database security principles and best practices
- Access control
- Authentication
- Data encryption.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CMR UNIVERSITY, BAGALUR 1
SQL Internship 2024-25

8. Data Analysis and Reporting:


- Use SQL to extract, transform
- Analyze data for reporting and decision-making purposes
- Generating complex reports and visualizations.

9. Real-World Projects:
- Work on real-world querying or case studies that simulate industry scenarios
- Applying SQL skills to solve practical problems
- Gain hands-on experience.

10. Communication and Collaboration:


- Develop the ability to communicate effectively and collaborate with team members,
stakeholders, and clients on database-related tasks and projects.

11. Professional Development:


- Enhance professional skills such as problem-solving,
- Critical thinking,
- Attention to detail, essential for a career in database management or related fields.

12. Career Readiness:


- Prepare for entry-level roles in database administration, development, data analysis, or
related fields, with a solid foundation in SQL and database management principles.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CMR UNIVERSITY, BAGALUR 2
SQL Internship 2024-25

CHAPTER 2
INTRODUCTION

ABOUT DEVSKILLHUB
Mission:
- Empowering learners with tailored education to excel, innovate, and positively impact their
chosen fields.
Vision:
- Leading the future of learning with innovative programs, fostering excellence, and shaping
tomorrow's industry leaders.

Structured Query Language

SQL (Structured Query Language) is a powerful language used for managing and
manipulating relational databases. It allows users to perform tasks such as querying data, updating
data, and managing databases.

Key Components of SQL:


- Data Definition Language (DDL): Used to define the structure of database objects such as
tables and indexes. Examples include CREATE, ALTER, and DROP statements.
- Data Manipulation Language (DML): Used to manipulate data stored in the database.
Examples include SELECT, INSERT, UPDATE, and DELETE statements.
- Data Control Language (DCL): Used to control access to data within the database.
Examples include GRANT and REVOKE statements.
- Transaction Control Language (TCL): Used to manage transactions within the database.
Examples include COMMIT and ROLLBACK statements.
SQL Statements:
- SELECT: Retrieves data from one or more tables based on specified criteria.
- INSERT: Adds new rows of data into a table.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CMR UNIVERSITY, BAGALUR 3
SQL Internship 2024-25

- UPDATE: Modifies existing data in a table based on specified criteria.


- DELETE: Removes rows of data from a table based on specified criteria.
- CREATE TABLE: Creates a new table in the database.
- ALTER TABLE: Modifies an existing table in the database.
- DROP TABLE: Deletes a table from the database.
- CREATE INDEX: Creates an index on a table to improve query performance.
- DROP INDEX: Deletes an index from a table.
SQL Data Types:
- SQL supports various data types such as INTEGER, VARCHAR, DATE, and BOOLEAN,
among others.
- Data types define the kind of data that can be stored in a column of a table.
SQL Joins:
- Joins are used to combine rows from two or more tables based on a related column between
them.
- Common types of joins include INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN.

1. Understanding Database Fundamentals:


Understanding database fundamentals in SQL is crucial for anyone working with databases. During
internship, I learnt about various database fundamentals.
Relational Database Management System (RDBMS):
- RDBMS is a software system used to manage relational databases.
- It organizes data into tables (relations) with rows (records) and columns (fields).
Tables:
- Tables are used to store data in a database.
- Each table consists of rows (records) and columns (fields).
Keys:
- Primary Key: A primary key is a unique identifier for each record in a table.
- Foreign Key: A foreign key is a column that establishes a relationship with a primary key in
another table.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CMR UNIVERSITY, BAGALUR 4
SQL Internship 2024-25

Normalization:
- Normalization is the process of organizing data in a database to reduce redundancy and
improve data integrity.
SQL Data Types:
- SQL supports various data types such as INTEGER, VARCHAR, DATE, etc., to define the
type of data that can be stored in a column.
SQL Queries:
- SQL (Structured Query Language) is used to query and manipulate data in a database.
- Common SQL commands include SELECT, INSERT, UPDATE, DELETE, and JOIN.
Indexes:
- Indexes are used to speed up data retrieval by creating a quick reference to the data in a
table.
Constraints:
- Constraints are rules that enforce data integrity, such as NOT NULL, UNIQUE, PRIMARY
KEY, and FOREIGN KEY constraints.
Transactions:
- A transaction is a sequence of SQL statements that are treated as a single unit of work.
- ACID properties (Atomicity, Consistency, Isolation, and Durability) ensure that
transactions are reliable.

2. Mastering SQL Syntax:

Mastering SQL syntax is essential for effectively querying and manipulating data in a database.
During the internship, I learnt about the various SQL statements and their syntax
SELECT Statement:
- Used to retrieve data from one or more tables.
- Syntax: SELECT column1, column2 FROM table_name WHERE condition;
INSERT INTO Statement:
- Used to insert new records into a table.
- Syntax: INSERT INTO table_name (column1, column2) VALUES (value1, value2);

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CMR UNIVERSITY, BAGALUR 5
SQL Internship 2024-25

UPDATE Statement:
- Used to update existing records in a table.
- Syntax: UPDATE table_name SET column1 = value1, column2 = value2 WHERE
condition;
DELETE FROM Statement:
- Used to delete records from a table.
- Syntax: DELETE FROM table_name WHERE condition;
JOIN Clause:
- Used to combine rows from two or more tables based on a related column between them.
- Syntax: SELECT * FROM table1 INNER JOIN table2 ON table1.column = table2.column;
GROUP BY Clause:
- Used to group rows that have the same values into summary rows.
- Syntax: SELECT column1, COUNT(*) FROM table_name GROUP BY column1;
ORDER BY Clause:
- Used to sort the result set in ascending or descending order.
- Syntax: SELECT * FROM table_name ORDER BY column1 ASC/DESC;
Aggregate Functions:
- Used to perform calculations on a set of values.
- Examples: COUNT(), SUM(), AVG(), MIN(), MAX().
Subqueries:
- A query nested inside another query.
- Syntax: SELECT * FROM table_name WHERE column1 = (SELECT column2 FROM
another_table);
Views:
- A virtual table created from a query's result set.
- Syntax: CREATE VIEW view_name AS SELECT column1, column2 FROM table_name
WHERE condition;
Stored Procedures:
- Precompiled SQL queri es stored in the database for reuse.
- Syntax: CREATE PROCEDURE procedure_name AS SQL_statements;

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CMR UNIVERSITY, BAGALUR 6
SQL Internship 2024-25

3. Database Design:

Learning database design in an SQL internship is crucial for designing efficient and well-structured
databases.
Entity-Relationship (ER) Modeling:
- ER modeling is a technique used to design databases by identifying the entities within a
system and the relationships between them.
- Entities are objects or concepts that are important in the context of the database (e.g.,
customers, products).
- Relationships describe how entities are related to each other (e.g., one-to-many, many-to-
many).
Normalization:
- Normalization is the process of organizing data in a database to reduce redundancy and
improve data integrity.
- It involves dividing large tables into smaller tables and defining relationships between them.
Database Normal Forms:
- Normal forms are rules used to determine the level of normalization of a database schema.
- Common normal forms include 1NF (First Normal Form), 2NF (Second Normal Form), and
3NF (Third Normal Form).
Keys and Indexes:
- Primary keys uniquely identify each record in a table.
- Foreign keys establish relationships between tables by referencing the primary key of
another table.
- Indexes are used to speed up data retrieval by creating a quick reference to the data in a
table.
Denormalization:
- Denormalization is the process of adding redundancy to a database schema to improve
query performance.
- It is often used in data warehousing and reporting scenarios where read performance is more
critical than data redundancy.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CMR UNIVERSITY, BAGALUR 7
SQL Internship 2024-25

Database Design Tools:


- There are various tools available for designing databases, such as ER diagramming tools
like Lucid chart, Microsoft Visio, or online tools like dbdiagram.io.
-
4. Query Optimization:

During Internship, I learnt about Query optimization in SQL which is the process of improving the
performance of SQL queries to retrieve data from a database more efficiently.
- Use Indexes: Indexes help speed up data retrieval by creating a quick reference to the data
in a table. Use indexes on columns frequently used in WHERE clauses, JOIN conditions,
and ORDER BY clauses.
- *Avoid SELECT: Instead of selecting all columns using SELECT *, specify only the
columns you need. This reduces the amount of data that needs to be processed and retrieved.
- Use WHERE Clause Efficiently: Use the WHERE clause to filter data early in the query,
reducing the number of rows processed. Avoid using functions or calculations in the
WHERE clause that prevent the use of indexes.
- Use JOINs Carefully: Use the appropriate type of JOIN (INNER, LEFT, RIGHT, FULL)
based on your requirements. Ensure that JOIN conditions are efficient and use indexes if
possible.
- Limit the Result Set: Use LIMIT or TOP to limit the number of rows returned, especially
when you only need a subset of the data.
- Avoid Sub queries if Possible: Su bqueries can be less efficient than using JOINs or other
methods. Try to rewrite queries to eliminate or reduce the use of subqueries.
- Use EXPLAIN (or equivalent): Use the EXPLAIN keyword to analyze the query execution
plan. This can help identify areas for optimization, such as missing indexes or inefficient
JOINs.
- Avoid Functions in WHERE Clause: Functions in the WHERE clause can prevent the use
of indexes. If possible, move the function outside the WHERE clause or use a different
approach.
- Use Stored Procedures: Stored procedures can improve performance by reducing network
traffic and precompiling SQL statements.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CMR UNIVERSITY, BAGALUR 8
SQL Internship 2024-25

5. Transaction and Concurrency:

During internship, I learnt about transactions and concurrency control in SQL to ensure that
database operations are performed reliably and efficiently in multi-user environments:
Transaction:
- A transaction is a sequence of operations treated as a single unit of work.
- It follows the ACID properties (Atomicity, Consistency, Isolation, and Durability).
- Atomicity ensures that either all operations in the transaction are completed successfully, or
none are.
- Consistency ensures that the database remains in a consistent state before and after the
transaction.
- Isolation ensures that the intermediate state of a transaction is invisible to other transactions.
- Durability ensures that once a transaction is committed, its effects are permanent.
Concurrency Control:
- Concurrency control ensures that multiple transactions can run concurrently without
interfering with each other.
- Techniques such as locking, timestamp ordering, and optimistic concurrency control are
used to manage concurrent access to data.
- Locking prevents conflicting operations from being performed concurrently on the same
data.
- Timestamp ordering uses timestamps to determine the order in which transactions should be
executed.
- Optimistic concurrency control allows transactions to proceed without locking, but checks
for conflicts before committing.

6. Stored Procedures and Triggers

Stored procedures and triggers are two important features of SQL databases that help automate
tasks and enforce data integrity.
Stored Procedures:
- Stored procedures are precompiled SQL statements stored in the database.
- They can accept parameters, perform operations, and return results.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CMR UNIVERSITY, BAGALUR 9
SQL Internship 2024-25

- Stored procedures can simplify complex operations and improve performance by reducing
network traffic.
- They are often used for tasks such as data validation, calculations, and business
logic implementation.
Triggers:
- Triggers are special types of stored procedures that are automatically executed in response
to certain events.
- They can be triggered before or after INSERT, UPDATE, or DELETE operations on a
table.
- Triggers are used to enforce business rules, maintain data integrity, and automate tasks.

7. Database Security

Database security in SQL is essential for protecting sensitive data from unauthorized access and
ensuring the integrity and availability of the database.
- Authentication and Authorization
- Encryption
- Access Control
- Auditing and Logging
- Backup and Recovery
- Patch Management
- Secure Coding Practices
- Database Hardening

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CMR UNIVERSITY, BAGALUR 10
SQL Internship 2024-25

CHAPTER 3
INTERNSHIP DISCUSSION

INTRODUCTION TO STRUCTURED QUERY LANGUAGE

SQL, or Structured Query Language, is a programming language used to talk to databases. With
SQL, we can store, manipulate, and retrieve data from relational databases.

In relational databases, the data items are organized as a set of tables with columns and
rows. These data items have pre-defined relationships among them across different tables of a
database. It is a very common way to store information, whether it is for a small bookshop or
Amazon.

As an example, you have a books table. In this table, the books are stored as row items, and the
columns represent the attributes of each book such as its ID number, title, author, price, etc.

We may also have a sales table that includes order ID numbers, dates, and amounts of sales. But it
may also include the ID numbers of the books ordered, the ID number of the salesperson, and the
ID number of the corresponding bookstore. These ID numbers are references to other tables in the
database, such as books, salespeople, and stores. This means each piece of information is stored in
the database only once rather than duplicated in every table that may need it. For this reason,
relational databases are very efficient, and as a result, very popular across a variety of industries.

However, for data to be valuable, storing it efficiently is not enough. You must be able to retrieve it
efficiently. This is where SQL comes into play.

SQL is a standard language that lets you combine information from multiple tables based on
predefined relationships, analyze this information, and report the results. But SQL's capabilities go
far beyond mere retrieval of information; it also helps you create databases and keep them up to
date.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CMR UNIVERSITY, BAGALUR 11
SQL Internship 2024-25

Fig 1 . Structured Query Language

What is SQL?

SQL stands for Structured Query Language. SQL is a computer language used to interact with
relational database systems. SQL is a tool for organizing, managing, and retrieving archived data
from a computer database.
When data needs to be retrieved from a database, SQL is used to make the request. The DBMS
processes the SQL query retrieves the requested data and returns it to us. Rather, SQL statements
describe how a collection of data should be organized or what data should be extracted or added
to the database.

Components of a SQL System

Some of the Key components of a SQL System are:

Databases

- Databases are structured collections of data organized into tables, rows, and columns. They
serve as repositories for storing information efficiently and provide a way to manage and

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CMR UNIVERSITY, BAGALUR 12
SQL Internship 2024-25

access data.

Tables

- Tables are the fundamental building blocks of a database, consisting of rows (records) and
columns (attributes or fields). They ensure data integrity and consistency by defining the
structure and relationships of the stored information.

Queries

- Queries are SQL commands used to interact with databases. They enable users to retrieve,
update, insert, or delete data from tables, allowing for efficient data manipulation and
retrieval.

Constraints

- Constraints are rules applied to tables to maintain data integrity. They define conditions that
data must meet to be stored in the database, ensuring accuracy and consistency.

Stored Procedures

- Stored procedures are pre-compiled SQL statements stored in the database. They can accept
parameters, execute complex operations, and return results, enhancing efficiency,
reusability, and security in database management.
-
Transactions

- Transactions are groups of SQL statements that are executed as a single unit of work. They
ensure data consistency and integrity by allowing for the rollback of changes if any part of
the transaction fails.

Some other important components include:

- Data Types
- Indexes
- Views
- Security and Permissions
- Joins

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CMR UNIVERSITY, BAGALUR 13
SQL Internship 2024-25

What are the characteristics of SQL?

- SQL may be utilized by quite a number of users, which include people with very little
programming experience.
- SQL is a non-procedural language.
- We can without difficulty create and replace databases in SQL. It isn’t a time-consuming
process.
- SQL is primarily based totally on ANSI standards.
- SQL does now no longer have a continuation individual.
- SQL is entered into the SQL buffer on one or more lines.
- SQL makes use of a termination individual to execute instructions immediately. It makes
use of features to carry out a few formatting.
- It uses functions to perform some formatting.

Why SQL?

- SQL is an interactive question language. Users type SQL instructions into an interactive
SQL software to retrieve facts and show them on the screen, presenting a convenient, easy-
to-use device for ad hoc database queries.
- SQL is a database programming language. Programmers embed SQL instructions into their
utility packages to access the facts in a database. Both user-written packages and database
software packages (consisting of document writers and facts access tools) use this approach
for database access.
- SQL is a client/server language. Personal computer programs use SQL to communicate over
a network with database servers that save shared facts. This client/server architecture is
utilized by many famous enterprise-class applications.
- SQL is Internet facts access language. Internet net servers that interact with company facts
and Internet utility servers all use SQL as a widespread language for getting access to
company databases, frequently through embedding SQL databases get entry to inside
famous scripting languages like PHP or Perl.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CMR UNIVERSITY, BAGALUR 14
SQL Internship 2024-25

- SQL is a distributed database language. Distributed database control structures use SQL to
assist distribute facts throughout many linked pc structures. The DBMS software program
on every gadget makes use of SQL to speak with the opposite structures, sending requests
for facts to get entry to.
- SQL is a database gateway language. In a pc community with a mixture of various DBMS
products, SQL is frequently utilized in a gateway that lets one logo of DBMS speak with
every other logo. SQL has for this reason emerged as a useful, effective device for linking
people, pc packages, and pc structures to the facts saved in a relational database.

Uses of SQL

SQL is used for interacting with databases. These interactions include:


- Data definition: It is used to define the structure and organization of the stored data and the
relationships among the stored data items.
- Data retrieval: SQL can also be used for data retrieval.
- Data manipulation: If the user wants to add new data, remove data, or modifying in existing
data then SQL provides this facility also.
- Access control: SQL can be used to restrict a user’s ability to retrieve, add, and modify data,
protecting stored data against unauthorized access.
- Data sharing: SQL is used to coordinate data sharing by concurrent users, ensuring that
changes made by one user do not inadvertently wipe out changes made at nearly the same
time by another user.
SQL also differs from other computer languages because it describes what the user wants the
computer to do rather than how the computer should do it. (In more technical terms, SQL is a
declarative or descriptive language rather than a procedural one.)
SQL contains no IF statement for testing conditions, and no GOTO, DO, or FOR statements for
program flow control. Rather, SQL statements describe how a collection of data is to be organized,
or what data is to be retrieved or added to the database. The sequence of steps to do those tasks is
left for the DBMS to determine.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CMR UNIVERSITY, BAGALUR 15
SQL Internship 2024-25

Types of SQL Commands


The SQL commands are mainly categorized into five categories:
- DDL – Data Definition Language
- DQL – Data Query Language
- DML – Data Manipulation Language
- DCL – Data Control Language
- TCL – Transaction Control Language

Types of Operators in SQL

Different types of operators in SQL are:


- Arithmetic operator
- Comparison operator
- Logical operator
- Bitwise Operators
- Compound Operators

SQL Queries

SQL (Structured Query Language) is a domain-specific language used for managing and
manipulating relational databases. In SQL Server, a query is a statement or command that you use
to interact with the database to retrieve, insert, update, or delete data. SQL queries are an integral
part of working with SQL Server and are used for a wide range of database-related tasks.

A SQL query is a structured command written in SQL syntax. It is used to communicate with a
SQL Server database to perform various operations on the data stored in tables.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CMR UNIVERSITY, BAGALUR 16
SQL Internship 2024-25

SQL Clauses

SQL (Structured Query Language) is a domain-specific language used in programming and


designed for managing relational databases. It consists of several clauses, each serving a specific
purpose:
 SELECT: Retrieves data from one or more tables.
 FROM: Specifies the table(s) from which to retrieve the data.
 WHERE: Filters the rows returned based on a specified condition.
 GROUP BY: Groups rows that have the same values into summary rows.
 HAVING: Filters records returned by a GROUP BY clause.
 ORDER BY: Sorts the result set in ascending or descending order.
 LIMIT: Limits the number of rows returned in a result set.
 OFFSET: Specifies the starting row offset for the result set.
 INSERT INTO: Inserts new rows into a table.
 UPDATE: Modifies existing records in a table.
 DELETE: Deletes records from a table.

SQL Aggregate functions

SQL aggregate functions perform calculations on a set of values and return a single value. Some
common aggregate functions include:
 COUNT(): Returns the number of rows that match a specified condition.
 SUM(): Calculates the sum of a numeric column.
 AVG(): Calculates the average value of a numeric column.
 MIN(): Returns the smallest value in a column.
 MAX(): Returns the largest value in a column.
 GROUP_CONCAT(): Concatenates values from multiple rows into a single string.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CMR UNIVERSITY, BAGALUR 17
SQL Internship 2024-25

SQL Constraints

SQL constraints are rules that are enforced on data columns in a table. These constraints maintain
the integrity and consistency of the data within the database. Here are some common SQL
constraints:
 NOT NULL: Ensures that a column cannot have a NULL value.
 UNIQUE: Ensures that all values in a column are unique.
 PRIMARY KEY: A combination of NOT NULL and UNIQUE. Uniquely identifies each
record in a table.
 FOREIGN KEY: Ensures that the values in a column match the values appearing in a column
in another table.
 CHECK: Ensures that all values in a column satisfy a specific condition.
 DEFAULT: Provides a default value for a column when no value is specified.

SQL Views

A SQL view is a virtual table that is based on the result-set of an SQL statement. It contains rows
and columns, just like a real table, but the data is not stored in the database. Instead, the view's data
is dynamically generated when the view is referenced in a query.
Views are used for the following purposes:
 Simplifying complex queries: Views can hide the complexity of a query, making it easier for
users to query data.
 Data security: Views can restrict the columns or rows that a user has access to, providing a
layer of security.
 Reusability: Views can be used to encapsulate frequently used queries, allowing them to be
reused across multiple queries or applications.
 Performance: Views can improve performance by precomputing expensive operations or by
limiting the amount of data retrieved from the database.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CMR UNIVERSITY, BAGALUR 18
SQL Internship 2024-25

SQL Index

SQL indexes are structures that improve the speed of data retrieval operations on a database table at
the cost of additional space and decreased performance for write operations. They work similarly to
the index in a book, providing quick access to specific rows in a table.
Types of Indexes:
 Primary Key: Uniquely identifies each record in a table. Automatically creates a clustered
index.
 Unique: Ensures that the values in a column (or a group of columns) are unique.
 Clustered: Orders the physical order of rows in a table based on the index key. A table can
have only one clustered index.
 Non-clustered: A separate structure from the actual table that contains a sorted list of
references to the table rows.

SQL Wildcard Operators:

In SQL, wildcard operators are special characters used with the LIKE operator in a WHERE clause
to search for a specified pattern in a column. There are two main wildcard operators:
 Percentage (%): Represents zero or more characters.
For example, LIKE 'a%' finds any values that start with "a".
LIKE '%a' finds any values that end with "a".
LIKE '%or%' finds any values that have "or" in any position.
 Underscore (_): Represents a single character.
For example, LIKE '_r%' finds any values that have "r" in the second position.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CMR UNIVERSITY, BAGALUR 19
SQL Internship 2024-25

SQL Performance Tuning

SQL performance tuning involves optimizing SQL queries and database structures to improve the
speed and efficiency of database operations. Here are some common strategies for SQL
performance tuning:
 Use Indexes: Indexes can significantly speed up data retrieval operations. Ensure that tables are
properly indexed based on the queries being executed.
 Limit the Use of Wildcards: Wildcard searches (LIKE '%value%') can be slow, especially on
large datasets. If possible, avoid using leading wildcards or consider full-text search solutions
for more complex text searches.
 **Avoid SELECT ***: Instead of selecting all columns (SELECT *), specify only the columns
you need. This reduces the amount of data that needs to be retrieved and can improve
performance.
 Use JOINs Efficiently: Use the appropriate type of JOIN (INNER JOIN, LEFT JOIN, etc.)
based on the relationship between tables. Ensure that JOIN conditions are indexed.
 Avoid Nested Queries: Nested queries can be slow. Where possible, use JOINs or subqueries to
improve performance.
 Optimize Data Retrieval: Use pagination (OFFSET and LIMIT in MySQL, ROWNUM in
Oracle) to retrieve data in smaller chunks rather than retrieving all data at once.
 Minimize Transactions: Keep transactions short and minimize the number of round trips to the
database.
 Use Stored Procedures: Stored procedures can reduce network traffic and improve performance
by executing multiple SQL statements in a single call to the database.
 Use Database Profiling Tools: Use tools provided by the database system (e.g., EXPLAIN in
MySQL, SQL Server Profiler in SQL Server) to analyze query performance and identify
bottlenecks.
 Monitor and Tune Regularly: Monitor database performance regularly and make adjustments
as needed. As data grows and usage patterns change, performance tuning requirements
may also change.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CMR UNIVERSITY, BAGALUR 20
SQL Internship 2024-25

SKILLS LEARNT

The internship provided me with an opportunity to learn and develop various scientific and
professional skills. Some of the skills I learned include:

1. SQL querying : I gained hands-on experience in solving real world problems using
various optimization features present in SQL. I learned how to identify and exploit
vulnerabilities in different systems and applications.

2. Web Application Security: I learned about various web application security issues, such
as SQL injection. I learned how to use various encryption methods such as stored
procedures to identify and safeguard these vulnerabilities.

3. Database Administration: Gained knowledge of basic database administration tasks,


such as user management, backup and recovery, and monitoring database performance.

4. Transactions and Concurrency Control: Understood how to manage transactions in a


database, including ensuring data consistency, implementing ACID properties, and
handling concurrent access to data.

5. Problem-Solving and Troubleshooting: Developed skills in identifying and resolving


database-related issues, such as performance bottlenecks, data inconsistencies, and
query optimization.

6. Collaboration and Communication: Learnt to work effectively in a team environment,


communicate database-related concepts to non-technical stakeholders, and collaborate on
database projects.

7. Data Analysis and Reporting: Used SQL for data analysis, including extracting and
transforming data, generating reports, and performing calculations and aggregations.

8. Query Optimization: Learnt techniques to optimize SQL queries for better performance,
including indexing strategies, query restructuring, and understanding query
execution plans.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CMR UNIVERSITY, BAGALUR 21
SQL Internship 2024-25

WORK EXPERIENCE

During the internship, I worked on various projects that involved these technologies. Some of the
queries I worked on include:

 Vendor Booth Assignments: I performed various querying related to the real world
database given by the instructor named vendor booth assignment wherein I learnt various
sorting techniques and rounding off numbers techniques in the most optimized manner.
 Sub query and joins: I learnt how to deal with sub queries and solved various queries
which involved the join truncate and various other statements.
 Aggregate functions: I performed basic database administration tasks, such as finding
min; max and using various others aggregate functions.
 Encryption: Designed software to safeguard against SQL Injection attack for the
organization.

CHALLENGES FACED

During the internship, I faced several challenges such as:

 Lack of Experience: Since I was new to some of the advanced features of SQL, I had to
spend extra time learning and practicing them.

 Time Management: Managing time was a challenge, as I had to balance my work


responsibilities with my learning objectives.

 Technical Issues: Sometimes, I faced technical issues with the tools and systems I was
working on, which caused delays in completing my tasks.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CMR UNIVERSITY, BAGALUR 22
SQL Internship 2024-25

CHAPTER 4
CONCLUSION

In conclusion, this SQL internship offered a comprehensive and practical learning experience in
database management and querying, providing me with a valuable skill set that is in high demand
across industries. Throughout the internship, I gained hands-on experience with various aspects of
SQL, including database design, query optimization, transactions, and concurrency control.

I learnt how to design efficient and normalized database schemas, ensuring data integrity and
consistency. I also became proficient in writing complex SQL queries to retrieve, insert, update,
and delete data, as well as in using advanced SQL features such as joins, sub queries, and aggregate
functions to manipulate and analyze data effectively.

One of the key takeaways from this SQL internship is the ability to optimize SQL queries for
improved performance. I learnt techniques such as indexing strategies, query restructuring, and
understanding query execution plans to optimize the performance of database operations.

Additionally, I gained valuable skills in database administration, including user management,


backup and recovery, and monitoring database performance. I also learn about database security
principles and best practices, including access control, authentication, encryption, and auditing, to
protect sensitive data from unauthorized access.

Overall, this SQL internship provided me with a solid foundation in SQL and database
management, preparing them for roles in database administration, data analysis, software
development, and other related fields. The skills and knowledge acquired during this SQL
internship are highly transferable and can open up exciting career opportunities in the ever-growing
field of data management.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CMR UNIVERSITY, BAGALUR 23
SQL Internship 2024-25

CHAPTER 5
BIBLIOGRAPHY

[1] V. K. Myalapalli and P. R. Savarapu, "High Performance SQL," 2014 Annual IEEE India
Conference (INDICON), Pune, India, 2014, pp. 1-6, doi: 10.1109/INDICON.2014.7030467.

[2] I. S. Vershinin and A. R. Mustafina, "Performance Analysis of PostgreSQL, MySQL,


Microsoft SQL Server Systems Based on TPC-H Tests," 2021 International Russian Automation
Conference (RusAutoCon), Sochi, Russian Federation, 2021, pp. 683-687, doi:
10.1109/RusAutoCon52004.2021.9537400.

[3] Y. Zhao and R. Chen, "Spark SQL Query Optimization Based on Runtime Statistics
Collection," 2021 IEEE 6th International Conference on Cloud Computing and Big Data Analytics
(ICCCBDA), Chengdu, China, 2021, pp. 250-255, doi: 10.1109/ICCCBDA51879.2021.9442524 .

[4] K. I. Satoto, R. R. Isnanto, R. Kridalukmana and K. T. Martono, "Optimizing MySQL


database system on information systems research, publications and community service," 2016 3rd
International Conference on Information Technology, Computer, and Electrical Engineering
(ICITACEE), Semarang, Indonesia, 2016, pp. 1-5, doi: 10.1109/ICITACEE.2016.7892476.

[5] A. Joshi and V. Geetha, "SQL Injection detection using machine learning," 2014
International Conference on Control, Instrumentation, Communication and Computational
Technologies (ICCICCT), Kanyakumari, India, 2014, pp. 1111-1115, doi:
10.1109/ICCICCT.2014.6993127.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CMR UNIVERSITY, BAGALUR 24
Internship

Date :
Week#: 1

Student ID 20BBTCS008

Internship Title SQL Internship

Learnt about creation of database and tables and performed various functions
inside a database
Extraction of data from database and usage of SELECT statement
Work completed
this week Writing queries for database involving various constraints

Extracting information based on various constraints specified by the mentor

Deliverables
submitted this Tasks which were given by the Mentor
week

contribution for the


week Understood the usage of SELECT statements and how to further optimize our
query

Plan for next week


Learning of the features

Progress since last


-
report

Comment by Guide

Signature of
Students with
Date
Signature of Guide
with Date
Internship

Date :
Week#: 2

Student ID 20BBTCS008

Internship Title SQL Internship

Work completed Learnt how to create ER diagrams, learnt how to work with duplicated records,
this week learnt how to update a database, learnt about subquery and joins.

Deliverables
submitted this Tasks given by the Mentor
week

contribution for the Solve organization related queries with high end efficiency.
week

Plan for next week


Learning other Features of SQL

Progress since last


Gaining Knowledge from different SQL Commands
report

Comment by Guide

Signature of
Students with
Date
Signature of Guide
with Date
Internship

Date :
Week#: 3

Student ID 20BBTCS008

Internship Title SQL Internship

Learnt about the various types of joins and how to implement queries involving
Work completed joins.
this week Learnt about the aggregate functions.

Deliverables Basic Tasks given by the Mentor


submitted this
week

contribution for the


week Developed and intrusion prevention system for the organization

Plan for next week


Learning other advanced features of SQL

Progress since last


Explored the system vulnerability during SQL injection and how to prevent it.
report

Comment by Guide

Signature of
Students with
Date
Signature of Guide
with Date

You might also like