Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Challenge: Creating a new Books Table | Populating a Database
Introduction to SQL
course content

Kurssisisältö

Introduction to SQL

Introduction to SQL

1. Getting Started
3. Sorting Data
4. Populating a Database
5. Updating & Deleting Data

book
Challenge: Creating a new Books Table

Congratulations on Your New Job!

You've moved on from your old library to take up a position at a much larger and older library. Unlike your previous job, this library has no digital system — everything is still on paper. Your first responsibility is to modernize their system by creating a database for the library.

First Task: Create a Books Table

As your first task, you are required to create a table to store data about all the available books. Consider which columns to include in the table to ensure the books are easily browsable and manageable.

After some brainstorming, you decide the table should include the following columns:

  • title - The title of the book (VARCHAR, max-length 255);
  • author - The author of the book (VARCHAR, max-length 255);
  • genre - The genre/category of the book (VARCHAR, max-length 100);
  • published_year - The year the book was published (INTEGER);
  • isbn - The International Standard Book Number (VARCHAR, max-length 20);
  • publisher - The publisher of the book (VARCHAR, max-length 255);
  • pages - The number of pages in the book (INTEGER);
  • language - The language of the book (VARCHAR, max-length 50);
  • is_available - Whether the book is available for lending (BOOLEAN).
Tehtävä

Swipe to start coding

Your task is to write a query for creating a table called books_table, having the above mentioned columns.

Note

You need to specify exactly the books_table name, it's specified by the task description.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 4. Luku 2
toggle bottom row

book
Challenge: Creating a new Books Table

Congratulations on Your New Job!

You've moved on from your old library to take up a position at a much larger and older library. Unlike your previous job, this library has no digital system — everything is still on paper. Your first responsibility is to modernize their system by creating a database for the library.

First Task: Create a Books Table

As your first task, you are required to create a table to store data about all the available books. Consider which columns to include in the table to ensure the books are easily browsable and manageable.

After some brainstorming, you decide the table should include the following columns:

  • title - The title of the book (VARCHAR, max-length 255);
  • author - The author of the book (VARCHAR, max-length 255);
  • genre - The genre/category of the book (VARCHAR, max-length 100);
  • published_year - The year the book was published (INTEGER);
  • isbn - The International Standard Book Number (VARCHAR, max-length 20);
  • publisher - The publisher of the book (VARCHAR, max-length 255);
  • pages - The number of pages in the book (INTEGER);
  • language - The language of the book (VARCHAR, max-length 50);
  • is_available - Whether the book is available for lending (BOOLEAN).
Tehtävä

Swipe to start coding

Your task is to write a query for creating a table called books_table, having the above mentioned columns.

Note

You need to specify exactly the books_table name, it's specified by the task description.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 4. Luku 2
Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Pahoittelemme, että jotain meni pieleen. Mitä tapahtui?
some-alt