Q.Write the names of SQL functions to perform the following operations :
You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.
Start your 14-day free trial to unlock the full solution →SQL provides built-in string and date functions: MONTHNAME() extracts the month name from a date, LOWER() converts text to lowercase, and LENGTH() or CHAR_LENGTH() counts characters in a string.
SQL, or Structured Query Language, is the standard language for managing and manipulating relational databases. Beyond simply retrieving data with SELECT statements, SQL equips you with a rich library of built-in functions that transform, analyze, and format data on the fly. These functions fall into several categories—string functions operate on text, date functions handle temporal data, and numeric functions perform calculations. Understanding these functions is essential because they allow you to process data directly within your queries rather than having to extract raw data and manipulate it elsewhere.
Let's examine the three operations you've asked about, each of which draws on a different category of SQL function.
Displaying the name of the month from a date of birth requires a date function. SQL stores dates in a specific format, but often you need to extract or display just one component—the year, the month name, the day of the week, and so on. The function MONTHNAME() does exactly this: it takes a date value and returns the full name of the month as a string. For example, if your date of birth is stored as 1995-08-15, MONTHNAME('1995-08-15') would return 'August'. This function is particularly useful in reports where you want human-readable month names rather than numeric codes.
Some SQL dialects use slightly different functions. MySQL uses MONTHNAME(), while others like PostgreSQL use TO_CHAR(date, 'Month'). The NCERT curriculum typically references MySQL syntax.
Converting an email-id to lowercase is a classic string manipulation task. Email addresses are case-insensitive by standard, but databases store them exactly as entered—some users might type PRIYA@GMAIL.COM while others type priya@gmail.com. To ensure consistency when searching or comparing, you use the LOWER() function (also called LCASE() in some contexts). This function takes any string and converts all uppercase letters to lowercase. So LOWER('PRIYA@GMAIL.COM') returns 'priya@gmail.com'. There's a corresponding UPPER() function that does the reverse. …
Unlock everything free for 14 days
- Full step-by-step solutions
- Concept-first explanations
- Methods, shortcuts & mistakes
- PYQ mapping + timed mock tests
Full access for 14 days. No credit card required.