CBSE Arts (English Medium) Class 12 Important Questions for Informatics Practices - Querying and SQL Functions
Advertisements
Advertisements
Chapter wise important questions with answers and solutions for Informatics Practices in CBSE Arts (English Medium) Class 12.
Which type of values will not be considered by SQL while executing the following statement?
SELECT COUNT(column name) FROM inventory;
Chapter: [1] Querying and SQL Functions
If column “Fees” contains the data set (5000,8000,7500,5000,8000), what will be the output after the execution of the given query?
SELECT SUM (DISTINCT Fees) FROM student;
Chapter: [1] Querying and SQL Functions
Which SQL statement do we use to find out the total number of records present in the table ORDERS?
Chapter: [1] Querying and SQL Functions
Which one of the following is not an aggregate function?
Chapter: [1] Querying and SQL Functions
Which one of the following functions are used to find the largest value from the given data in MySQL?
Chapter: [1] Querying and SQL Functions
In SQL, which function is used to display the current date and time?
Chapter: [1] Querying and SQL Functions
Rashmi, a database administrator needs to display house wise total number of records of the ‘Red’ and ‘Yellow’ houses. She is encountering an error while executing the following query:
SELECT HOUSE, COUNT (*) FROM STUDENT GROUP BY HOUSE WHERE HOUSE=’RED’ OR HOUSE= ‘YELLOW’;
Help her in identifying the reason for the error and write the correct query by suggesting the possible correction (s).
Chapter: [1] Querying and SQL Functions
What is the purpose of the Order By clause in SQL? Explain with the help of a suitable example.
Chapter: [1] Querying and SQL Functions
Write outputs for SQL queries that are based on the given table PURCHASE:
| TABLE: PURCHASE | ||||
| CNO | CNAME | CITY | QUANTITY | DOP |
| C01 | GURPREET | NEW DELHI | 150 | 2022-06-11 |
| C02 | MALIKA | HYDERABAD | 10 | 2022-02-19 |
| C03 | NADAR | DALHOUSIE | 100 | 2021-12-04 |
| C04 | SAHIB | CHANDIGARH | 50 | 2021-10-10 |
| C05 | MEHAK | CHANDIGARH | 15 | 2021-10-20 |
- SELECT LENGTH(CNAME) FROM PURCHASE WHERE QUANTITY>100;
- SELECT CNAME FROM PURCHASE WHERE MONTH(DOP) = 3;
- SELECT MOD (QUANTITY, DAY(DOP)) FROM PURCHASE WHERE CITY = ‘CHANDIGARH’;
Chapter: [1] Querying and SQL Functions
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.
Chapter: [1] Querying and SQL Functions
Discuss the significance of Group by clause in detail with the help of a suitable example.
Chapter: [1] Querying and SQL Functions
Write suitable SQL query for the following:
Display 7 characters extracted from the 7th left character onwards from the string ‘INDIA SHINING’.
Chapter: [1] Querying and SQL Functions
Write suitable SQL query for the following:
Display the position of occurrence of the string ‘COME’ in the string ‘WELCOME WORLD’.
Chapter: [1] Querying and SQL Functions
Write suitable SQL query for the following:
Round off the value 23.78 to one decimal place.
Chapter: [1] Querying and SQL Functions
Write suitable SQL query for the following:
Display the remainder of 100 divided by 9.
Chapter: [1] Querying and SQL Functions
Write suitable SQL query for the following:
Remove all the expected leading and trailing spaces from a column userid of the table ‘USERS’.
Chapter: [1] Querying and SQL Functions
Explain the following SQL function using a suitable example.
UCASE()
Chapter: [1] Querying and SQL Functions
Explain the following SQL function using a suitable example.
TRIM()
Chapter: [1] Querying and SQL Functions
Explain the following SQL function using a suitable example.
MID()
Chapter: [1] Querying and SQL Functions
Explain the following SQL function using a suitable example.
DAYNAME()
