0% found this document useful (0 votes)
36 views23 pages

Class 12th Ip Project Final..-3

Uploaded by

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

Class 12th Ip Project Final..-3

Uploaded by

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

A

Project Report
On
‘MYSQL FUNCTION’
For
CBSE 2024-25 Examination
[As a part of the Informatics Practices Course
(065)]

SUBMITTED BY:

PRABAL PANDEY AND HARIOM TIWARI


ROLL NO…………………….

Under the Guidance of:


ATUL KUMAR PATEL

1
PGT (IP)
CERTIFICATE

This is to certify that the Project / Dissertation

entitled MYSQL FUNCTION is a bonafide work

done by MR. PRABAL PANDEY AND HARIOM TIWARI

of class XII Session 2024-25 in partial fulfillment

of CBSE’s Examination 2024-25 and has been

carried out under my direct supervision and

guidance. This report or a similar report on the

topic has not been submitted for any other

examination and does not form a part of any other

course undergone by the candidate.

2
…………………………
……………………………..
Signature of Students Signature
of Teacher/Guide

Name: Prabal Pandey and Hariom Tiwari


Name: Atul Kumar Patel

Designation: (PGT)

……….…………………

External signature
Signature of Principal

We ACKNOWLEDGEMENT

Under took this Project work, as the part of my XI-


Informatics Practices course. We had tried to apply
my best of knowledge and experience, gained
during the study and class work experience.
However, developing software system is generally
a quite complex and time-consuming process. It
requires a systematic study, insight vision and

3
professional approach during the design and
development. Moreover, the developer always
feels the need, the help and good wishes of the
people near you, who have considerable
experience and idea.

We would like to extend my sincere thanks and


gratitude to my teacher Atul Kuamr Patel. We am
very much thankful to our Principal Mrs. Neelam
Singh for giving valuable time and moral support to
develop this project.

We would like to take the opportunity to extend my


sincere thanks and gratitude to our parents for
being a source of inspiration and providing time
and freedom to develop this project.

Table of Contents
Introduction to MySQL

4
Types of MySQL Functions

Built-in Functions in MySQL

String Functions

Numeric Functions

Date and Time Functions

Aggregate Functions

Conversion Functions

Miscellaneous Functions

How to Use MySQL Functions

Example Queries Using MySQL Functions

Advanced Usage of Functions in MySQL

Conclusion

Introduction to MySQL
5
What is MySQL?

MySQL is an open-source relational database


management system (RDBMS) that uses Structured
Query Language (SQL) for database management.

Discussing its importance and usage in real-world


applications.

Why MySQL Functions are Important?

Functions simplify tasks such as data manipulation and


extraction, providing built-in operations that reduce the
need for manual coding.

Types of MySQL Functions


6
In MySQL, functions can be categorized as:

1. Scalar Functions

2. Aggregate Functions

3. String Functions

4. Numeric Functions

5. Date and Time Functions

6. Conversion Functions

7. Miscellaneous Functions

Scalar Functions

7
Scalar functions operate on individual values and
return a single value based on the input
parameters.

Examples:

CONCAT()

LENGTH()

UPPER()

LOWER()

String Functions
8
String functions are used to manipulate and work with text.

Examples of string functions:

CONCAT(): Concatenate two or more strings.

LENGTH(): Return the length of a string.

SUBSTRING(): Extract a substring from a string.

REPLACE(): Replace occurrences of a substring in a string.

Numeric Functions

9
Numeric functions perform mathematical
operations.

Examples of numeric functions:


ROUND(): Rounds a number to a specified decimal
point.

FLOOR(): Returns the largest integer value less than


or equal to a number.

CEIL(): Returns the smallest integer value greater


than or equal to a number.

ABS(): Returns the absolute value of a number.

Date and Time Functions

10
These functions help manage and manipulate date and
time data types.

Examples of Date and Time functions:

CURDATE(): Returns the current date.

NOW(): Returns the current date and time.

DATE_ADD(): Adds a time/date interval to a date.

DATEDIFF(): Returns the difference between two dates.

--- Aggregate Functions

11
Aggregate functions perform a calculation on a set of values
and return a single value.

Examples:

COUNT(): Returns the number of rows that match a specified


condition.

SUM(): Adds the values in a column.

AVG(): Calculates the average of a set of values.

MAX(): Returns the maximum value in a column.

MIN(): Returns the minimum value in a column.

Conversion Functions

12
These functions help in converting data types.

Examples:

CAST(): Converts an expression to a specified data type.

CONVERT(): Converts one data type to another.

---

Miscellaneous Functions

13
These include various other functions available in MySQL.

Examples:

UUID(): Generates a unique identifier.

IFNULL(): Returns a value if the expression is NULL.

COALESCE(): Returns the first non-null expression in a


list.

---

How to Use MySQL Functions

14
Syntax of MySQL Functions

Example syntax: function_name(parameters)

Basic Example: Use a simple example to demonstrate the


syntax of a MySQL function, such as SELECT
CONCAT('Hello', ' ', 'World');

---

15
Example Queries Using MySQL Functions
(1)

Query 1: Using LENGTH()

Query: SELECT LENGTH('Hello World');

Output: Returns the length of the string "Hello World".

Query 2: Using ROUND()

Query: SELECT ROUND(123.456, 2);

Output: Rounds the number 123.456 to 2 decimal places.

16
Example Queries Using MySQL Functions
(2)

Query 3: Using CURDATE()

Query: SELECT CURDATE();

Output: Returns the current date.

Query 4: Using DATEDIFF()

Query: SELECT DATEDIFF('2025-01-01', '2024-12-31');

Output: Returns the number of days between two dates.

17
Advanced Usage of MySQL Functions

Nested Functions

Example: Using multiple functions together, such as


SELECT LENGTH(CONCAT('Hello ', 'World'));

Using Functions in WHERE Clause

Example: SELECT * FROM students WHERE


LENGTH(name) > 5;

Using Functions in GROUP BY Clause

Example: SELECT AVG(price) FROM products GROUP BY


category;

18
Practical Use Cases for MySQL Functions

Example 1: Data Cleaning

Use of TRIM(), LOWER(), and REPLACE() functions for


cleaning input data.

Example 2: Data Analysis

Using AVG(), SUM(), and COUNT() to perform statistical


analysis on large datasets.

---

19
Best Practices for Using MySQL
Functions

Ensure that functions are used efficiently for better


performance.

Use built-in functions rather than writing custom code


where possible to improve readability and efficiency.

Handle NULL values carefully when using functions like


IFNULL() and COALESCE().

---

20
Conclusion

MySQL functions are essential tools that


help users manipulate and process data
efficiently in databases. Understanding how
to use them properly can greatly improve
the performance and functionality of any
database system.

---

21
8. References

In order to work on this project titled MYSQL


FUNCTION the following order of spots material are
refered by me during the various phases of
development of the project.

(6) Informatics Practices for class XI


-by Sumita Arora
(7) Together with Informatics Practices

(6) Various Websites of Discussion Forum and


software development activities.
Other than the above-mentioned books, the
suggestions and supervision of my teacher and my
class experience also helped me to develop this
software.
Website are:-
https://geo-python.github.io/site/lessons/L7/
plot-anatomy.html
https://python-graph-gallery.com/all-charts/
https://www.geeksforgeeks.org/python-data-
visualization-tutorial/

22
23

You might also like