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

Contenido del Curso

Introduction to SQL

Introduction to SQL

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

book
Challenge: Changing the Books Structure

Your manager has decided that the books_table table should have an auto-incrementing book_id to uniquely identify each book. Additionally, the book_id will be set as the primary key for the table.

Tarea
test

Swipe to show code editor

You are tasked with recreating the books_table table with the following columns:

  • book_id - The unique id of the book (SERIAL), PRIMARY KEY;
  • title - The title of the book (VARCHAR, max-length 255), NOT NULL;
  • author - The author of the book (VARCHAR, max-length 100);
  • genre - The genre/category of the book (VARCHAR, max-length 50);
  • 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 of max-length 100);
  • pages - The number of pages in the book (INTEGER);
  • language - The language of the book (VARCHAR of max-length 50);
  • is_available - Whether the book is available for lending (BOOLEAN);

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 4. Capítulo 10
toggle bottom row

book
Challenge: Changing the Books Structure

Your manager has decided that the books_table table should have an auto-incrementing book_id to uniquely identify each book. Additionally, the book_id will be set as the primary key for the table.

Tarea
test

Swipe to show code editor

You are tasked with recreating the books_table table with the following columns:

  • book_id - The unique id of the book (SERIAL), PRIMARY KEY;
  • title - The title of the book (VARCHAR, max-length 255), NOT NULL;
  • author - The author of the book (VARCHAR, max-length 100);
  • genre - The genre/category of the book (VARCHAR, max-length 50);
  • 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 of max-length 100);
  • pages - The number of pages in the book (INTEGER);
  • language - The language of the book (VARCHAR of max-length 50);
  • is_available - Whether the book is available for lending (BOOLEAN);

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 4. Capítulo 10
Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
We're sorry to hear that something went wrong. What happened?
some-alt