Fdmsprac 5
Fdmsprac 5
Query to display all the details from the student table with the date:
Query to display the year from the given date, i.e., 24th October 2021.
Query to display the month from the given date, i.e., 24th October 2021.
Query to display the day from the given date, i.e., 24th October 2021.
Query to display the hour from the given time, i.e., 19:10:43.
Query to display the minute from the given time, i.e., 19:10:43.
Query to display the seconds from the given time, i.e., 19:10:43.
6) DATE_ADD(): Using the DATE_ADD () function in SQL, we can add a
specific time interval to the given date.
Query to add an interval of 15 days to the given date, i.e., 15 th jan, 2000.
Query to add an interval of 15 months to the given date, i.e., 15th jan,
2000.
Query to add an interval of 15 years to the given date, i.e., 15th jan,
2000.
Quer
y to
remove an interval of 25 days from the given date, i.e., 24th October, 2021.
Query to display the given date and time in a well-formatted manner, i.e.,
24th October, 2021 22:30:17.
Query to display all the details from the student column with the DateTime
column in a well-formatted manner.
STRING FUNCTIONS:
1) ASCII String Function: This function in SQL returns the ASCII value of the
character in the output.
4) LOWER String Function: This string function allows users to convert the specified
string into lower case letters.
5) UPPER String Function: This string function allows users to convert the
specified string into the UPPER case letters.
MATH FUNCTIONS:
1)ABS() Function:
The ABS() method returns the absolute value of the number specified.
2) CEILING() Function
The smallest integer value greater than or equal to a given number is returned by
the CEILING() function.
3) SQRT() Function :
Return the square root of a number
4) TRUNCATE:
The TRUNCATE TABLE command deletes the data inside a table, but not the table
itself.
5) POWER:
The POWER() function returns the value of a number raised to the power of another
number.
6) MOD:
The MOD() function returns the remainder of a number divided by another
number.
7) FLOOR:
The FLOOR() function returns the largest integer value that is smaller than or
equal to a number.
8) ROUND: