Create a table in DB Studio

Design a table with an automatic key and useful field types, add three records, and export the database.

Watch
2:29 · English narration; English captions are on by default.
What you'll learn

What you'll learn

You will create a Practice inventory table, give it an automatic primary key, enter three records, and export the database.

Before you begin

Before you begin

Open https://db.pyroom.app/ on a desktop or tablet. On a phone, the editor asks for a larger screen, because table design needs more space.

Steps

Steps

  1. Click New database, enter Workshop practice in Database name, and click Save. Open the new database card.
  2. Click New table, enter Practice inventory in Table name, and start with the first field.
  3. Enter ID in Field name, choose AutoNumber from Data type, and mark it as Primary key.
  4. Click New field…, name it Item and choose Short Text; in its properties set Field size to 80. Use New field… again to add Units (Number (whole)), Unit cost (Currency) and Ready (Yes/No).
  5. Click Save table to save the design, then switch to Data.
  6. Click New record. Type Paper model, 4 and 12.50 in Item, Units and Unit cost, and tick the Ready box. Save the record with the button in the save bar (it reads "Save 1 record"). Leave ID empty; AutoNumber fills it in.
  7. Add and save two more records the same way: Cardboard stand, 2, 18.25, Ready not ticked; and Sensor box, 6, 31.40, Ready ticked.
  8. Return to the library, open the menu on the Workshop practice card and choose Export. The browser downloads Workshop practice.sqlite.
Expected result / Common mistakes

Expected result

Practice inventory contains three records with different automatic IDs. Its fields store text, whole numbers, currency, and yes-or-no values. The exported .sqlite file includes the database tables and data.

Common mistakes

  • Save the table design before switching to Data.
  • Leave ID empty when adding a record; the AutoNumber field supplies it.
  • If you are using a phone, switch to a desktop or tablet to design the table.
  • Keep the exported file somewhere you can find it. Browser storage is not a backup.
Try it in DB Studio
Try it in DB StudioStart with a blank database
Open DB Studio
Related tutorials