KnowledgeBoat Logo

Informatics Practices

Rahul, who works as a database designer, has developed a database for a bookshop. This database includes a table BOOK whose column (attribute) names are mentioned below:

BCODE: Shows the unique code for each book.

TITLE: Indicates the book’s title.

AUTHOR: Specifies the author’s name.

PRICE: Lists the cost of the book.

Table: BOOK

BCODETITLEAUTHORPRICE
B001MIDNIGHT'S CHILDRENSALMAN RUSHDIE500
B002THE GOD OF SMALL THINGSARUNDHATI ROY450
B003A SUITABLE BOYVIKRAM SETH600
B004THE WHITE TIGERARAVIND ADIGA399
B005TRAIN TO PAKISTANKHUSHWANT SINGH350

I. Write SQL query to display book titles in lowercase.

II. Write SQL query to display the highest price among the books.

III. Write SQL query to display the number of characters in each book title.

IV. Write SQL query to display the Book Code and Price sorted by Price in descending order.

SQL Queries

2 Likes

Answer

I.

SELECT LOWER(TITLE) 
FROM BOOK;  

II.

SELECT MAX(PRICE) 
FROM BOOK; 

III.

SELECT LENGTH(TITLE) 
FROM BOOK; 

IV.

SELECT BCODE, PRICE 
FROM BOOK 
ORDER BY PRICE DESC; 

Answered By

2 Likes


Related Questions