Advertisements
Advertisements
प्रश्न
Write suitable SQL query for the following:
Display the position of occurrence of the string ‘COME’ in the string ‘WELCOME WORLD’.
उत्तर
select INSTR('WELCOME WORLD','COME');
APPEARS IN
संबंधित प्रश्न
______ keyword is used to find out the number of values in a column?
Which of the following belongs to an "aggregate function"?
Assertion (A): COUNf function ignores DISTINCT
Reason (R): DISTINCT ignores the duplicate values.
Which of the following is not an aggregate function?
The char() function in MySql is an example of ______.
What will be returned by the given query? Select round(23456.1234, -2) = ______.
What will be returned by the given query? select substr("Computer", 4) = ______.
Name a function of MySQL used to give position of the first occurrence of a string2 in string1.
What will be returned by the given query? SELECT MID('BoardExamination', 2, 4) = ______.
What will be returned by the given query? SELECT INSTR('INFORMATIONFORM', 'FOR') = ______.
What will be returned by the given query? SELECT DAYOFYEAR('2015-01-10') = ______.
Which of the following is not a text function?
Which function will be used to remove only the trailing spaces from a string?
Which statement is used to count the number of rows in table?
Site any two differences between Single Row Functions and Aggregate Functions.
Write the name of the functions to perform the following operation:
To display the specified number of characters from a particular position of the given string.
Write the output produced by the following SQL statement:
SELECT ROUND(342.9234, -1);
Predict the output of the code given below:
s="welcome2cs"
n = len(s)
m=""
for i in range(0, n):
if (s[i] >= 'a' and s[i] <= 'm'):
m = m +s[i].upper()
elif (s[i] >= 'n' and s[i] <= 'z'):
m = m +s[i-1]
elif (s[i].isupper()):
m = m + s[i].lower()
else:
m = m +'&'
print(m)
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?
In SQL, which function is used to display the current date and time?
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:
Remove all the expected leading and trailing spaces from a column userid of the table ‘USERS’.
Explain the following SQL function using a suitable example.
MID()
Explain the following SQL function using a suitable example.
POWER()
Which function returns the sum of all elements of a list?