Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Database Systems - SQL Functions - Numeric, String, and Date Time Function with Examples
Play lesson

Database Systems with SQL - Full Course - Database Systems - SQL Functions - Numeric, String, and Date Time Function with Examples

5.0 (0)
6 learners

What you'll learn

This course includes

  • 4.5 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

There are additional functions that you can use in your SQL query. Numeric functions ABS(x) Absolute value of x LOG(x) Natural logarithm of x POW(x, y) x to the power of y RAND() Random number between 0 (inclusive) and 1 (exclusive) ROUND(x, d) x rounded to d decimal places SQRT(x) Square root of x SELECT POW(4, 2); Returns 16 SELECT SQRT(100); Returns 10 String functions: CONCAT(str1, str2) Concatenates the strings LOWER(s) Lowercase str REPLACE(str, from, to) Replaces all occurrences of from with to, within str SUBSTRING(str, pos, len) Gets a substring starting from pos of length len TRIM(str) Removes leading and trailing whitespace UPPER(str) Uppercase str CURDATE() Returns YYYY-MM-DD CURTIME() Returns HH:MM:SS NOW() Returns YYYY-MM-DD HH:MM:SS DATE(str) Extract the date from the string datetime expression TIME(str) Extract the time from the string datetime expression DAY(str) Returns the day from the string datetime expression MONTH(str) Returns the month from the string datetime expression YEAR(str) Returns the year from the string date or datetime expression HOUR(str) Returns the hour from the string datetime expression MINUTE(str) Returns the minute from the string datetime expression SECOND(str) Returns the seconds from the string datetime expression DATEDIFF(str1, str2) Returns str1 – str2 time difference in number of days TIMEDIFF(str1, str2) Returns str1 – str2 time difference Subscribe to Appficial for more programming videos coming soon. Also, don't forget to click LIKE and comment on the video if it helped you out!

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere