Hei,
Tätä tehtävää en osaa ratkaista. Osaisiko joku auttaa?
- Your task is to provide a query that counts the total number of books in stock.
Esimerkkitulostus:
sum
890
-----------------------------------------------------------------------------------------
Eli summaksi on saatava 890.
select * from book;
tulostaa seuraavan:
bookid title authorid publisherid pages price published
101 Three Bearded Men and the Sea 202 304 333 21.8 1983-12-04
102 The Ghost of the Moor 202 301 310 23.1 1980-12-01
103 How Computers Work 205 303 870 16.8 1999-03-14
104 The Hound and other short stories 204 302 475 35.5 2000-01-01
105 Let's Play Poker and Chess! 201 303 125 10.5 2006-04-19
106 My life as I see it 204 301 782 55.2 1990-10-10
107 Upside-down and other children's stories 204 301 245 20.8 1970-11-20
108 The Winter Everlasting 204 301 1156 46.8 1975-12-01
109 There and Never Back Again 206 302 370 29.9 1998-09-30
110 The Crime that never was 202 304 555 16.4 2004-03-10
111 Learn to Knit 207 303 75 10.2 1995-11-02
------------------------------------------------------------------------------------
Mitä tosta on laskettava yhteen et saisi sen 890 luvun? select sum(mitä tähän pitäisi laittaa?) from book;
Tätä tehtävää en osaa ratkaista. Osaisiko joku auttaa?
- Your task is to provide a query that counts the total number of books in stock.
Esimerkkitulostus:
sum
890
-----------------------------------------------------------------------------------------
Eli summaksi on saatava 890.
select * from book;
tulostaa seuraavan:
bookid title authorid publisherid pages price published
101 Three Bearded Men and the Sea 202 304 333 21.8 1983-12-04
102 The Ghost of the Moor 202 301 310 23.1 1980-12-01
103 How Computers Work 205 303 870 16.8 1999-03-14
104 The Hound and other short stories 204 302 475 35.5 2000-01-01
105 Let's Play Poker and Chess! 201 303 125 10.5 2006-04-19
106 My life as I see it 204 301 782 55.2 1990-10-10
107 Upside-down and other children's stories 204 301 245 20.8 1970-11-20
108 The Winter Everlasting 204 301 1156 46.8 1975-12-01
109 There and Never Back Again 206 302 370 29.9 1998-09-30
110 The Crime that never was 202 304 555 16.4 2004-03-10
111 Learn to Knit 207 303 75 10.2 1995-11-02
------------------------------------------------------------------------------------
Mitä tosta on laskettava yhteen et saisi sen 890 luvun? select sum(mitä tähän pitäisi laittaa?) from book;
Vastaukset 2
Vanhimmat
select count(*) from book;
Kiitos viestistä.
Tehtävän annossa oli piilevä stock-taulu, josta sai sen in-stock kirjojen yhteenlasketun summan.