Advertisements
Advertisements
प्रश्न
Explain the following SQL function using a suitable example.
TRIM()
उत्तर
TRIM(): It removes the leading and trailing spaces from the given string.
Example: SELECT TRIM(‘ Welcome world ‘);
Output: Welcome world
APPEARS IN
संबंधित प्रश्न
______ is used to get a specified day of the month for a given date.
______ keyword is used to find out the number of values in a column?
Which of the following belongs to an "aggregate function"?
The MAX () function finds the
Consider the table STUDENT given below:
RollNo | Name | Class | DOB | Gender | City | Marks |
1 | Anand | XI | 6/6/97 | M | Agra | 430 |
2 | Chetan | XII | 7/5/94 | M | Mumbai | 460 |
3 | Geet | XI | 6/5/97 | F | Agra | 470 |
4 | Preeti | XII | 8/8/95 | F | Mumbai | 492 |
5 | Saniyal | XII | 8/10/95 | M | Delhi | 360 |
6 | Maakhiy | XI | 12/12/94 | F | Dubai | 256 |
7 | Neha | X | 8/12/95 | F | Moscow | 324 |
8 | Nishant | X | 12/6/95 | M | Moscow | 429 |
State the command that will give the output as:
Name |
Anand |
Chetan |
Geet |
Preeti |
(i) select Name from student where Class ='XI' and Class='XII';
(ii) select name from student where not Class='XI' and Class='XII';
(iii) select name from student where City="Agra" or City="Mumbai";
(iv) select name from student where City in("Agra", "Mumbai");
Choose the correct option:
What will be the output of the following SQL statement?
SELECT DAY NAME (2022-04-08)
Which command is used to delete a table? (in SQL)
Identify Single Row function of MySQL among the following.
What will be returned by the given query? select mid("Computer", 2, 4) = ______.
What will be returned by the given query? select power(3, 2) = ______.
What will be returned by the given query? Select length(trim("ABC Public School")) = ______.
What will be returned by the given query? SELECT RIGHT("LEFT", 2) = ______.
Name a function of MySQL which is used to remove trailing and leading spaces from a string.
Which of the following is not a date function?
What is the general format of UPPER() return type?
Site any two differences between Single Row Functions and Aggregate Functions.
Write the output produced by the following SQL statement:
SELECT LENGTH("Informatics Practices");
Write the output produced by the following SQL statement:
SELECT YEAR(“1979/11/26”),
MONTH(“1979/11/26”), DAY(“1979/11/26”), MONTHNAME(“1979/11/26”);
Differentiate between count() and count(*) functions in SQL with appropriate examples.
Which type of values will not be considered by SQL while executing the following statement?
SELECT COUNT(column name) FROM inventory;
Which one of the following is not an aggregate function?
Which one of the following functions are used to find the largest value from the given data in MySQL?
Based on the table STUDENT given here, write suitable SQL queries for the following:
Roll No | Name | Class | Gender | City | Marks |
1 | Abhishek | XI | M | Agra | 430 |
2 | Prateek | XII | M | Mumbai | 440 |
3 | Sneha | XI | F | Agra | 470 |
4 | Nancy | XII | F | Mumbai | 492 |
5 | Himanshu | XII | M | Delhi | 360 |
6 | Anchal | XI | F | Dubai | 256 |
7 | Mehar | X | F | Moscow | 324 |
8 | Nishant | X | M | Moscow | 429 |
- Display gender-wise highest marks.
- Display city-wise lowest marks.
- Display the total number of male and female students.
Write suitable SQL query for the following:
Round off the value 23.78 to one decimal place.
Explain the following SQL function using a suitable example.
MID()
Explain the following SQL function using a suitable example.
DAYNAME()
Explain the following SQL function using a suitable example.
POWER()