KnowledgeBoat Logo

Informatics Practices

Write suitable SQL query for the following:

I. Round the value of pi (3.14159) to two decimal places.

II. Calculate the remainder when 125 is divided by 8.

III. Display the number of characters in the word 'NewDelhi'.

IV. Display the first 5 characters from the word 'Informatics Practices'.

V. Display details from 'email' column (attribute), in the 'Students' table, after removing any leading and trailing spaces.

SQL Queries

1 Like

Answer

I.

SELECT ROUND(3.14159, 2); 

II.

SELECT MOD(125, 8); 

III.

SELECT LENGTH('NewDelhi');

IV.

SELECT LEFT('Informatics Practices', 5);

V.

SELECT TRIM(email) 
FROM Students;

Answered By

1 Like


Related Questions