Bookstore Database SQL query: 1480705

Answer 1

Select CONCAT(UPPER(SUBSTRING(FirstName,1,1)),LOWER(SUBSTRING(FirstName,2)),’ ‘,UPPER(SUBSTRING(LastName,1,1)),LOWER(SUBSTRING(LastName,2))) AS Name from customers; 

 Answer 2

select FirstName, LastName, NVL2(referred, ‘REFERRED’, ‘NOT REFERRED’) from customers;

Answer 3

SELECT title, TO_CHAR(quantity*(paideach-cost), ‘$999.99’)FROM books JOIN orderitems USING(isbn) where OrderId = 1002;

Answer 4

select title, ROUND((retail-cost)/cost*100,0) ||’%’from books;

Answer 5

SELECT LENGTH(`ISBN`) AS LengthOfString FROM `books`;

Answer 6

SELECT Title, PubDate, CURRENT_DATE, DATE_FORMAT(NOW(),’%m’) AS Age FROM books;