Vous êtes sur la page 1sur 3

create table books (id number(5), title varchar(30), author varchar(25), publisher varchar(25), price number(6), pages number(5),

edition number(4)) insert into books values(32, ' A Thousand Splendid Sons', 'Khalid Hussain', 'ABC', 500, 345, 2003) insert into books values(43, 'The Kite Runner', 'Khalid Hussain', 'ABC', 450, 375, 2005) insert into books values(56, A Walk To Remember' , 'Nicholas Sparks', 'Shiva', 475, 350, 2005) insert into books values(57, 'Dear John' , 'Nicholas Sparks', 'Shiva', 350, 375, 2005) insert into books values(76, 'Eleven Minutes', 'Paulo Coelho', 'Penguin', 750, 475, 2006) insert into books values(85, 'The Princess', 'Jean Sasson', 'Rupa', 300, 400, 2001) insert into books values(54, 'The Notebook', 'Nicholas Sparks', 'Shiva', 450, 275, 2004)

Q) Find the names of all the books published by ABC publications : select title from books where publisher='ABC'

Q) Find the name of ublishers which are distinct:

Q) Find the name of the books having the maximum price: Select max(price) from books

Q) Find the total price of all the books: select sum(price) from books

Q) List the ID and Book titles of all the books written by publisher ABC: select id, title from books where publisher='ABC'

Q) Find the eddition of the book with the title Eleven Minutes select edition from books where title='Eleven Minutes'

Vous aimerez peut-être aussi