CodeBlanks Logo Icon CodeBlanks

Project design

Set up the table structure of the CRUD app and write skeleton queries.

Project design

In this project you will build the table structure of a simple CRUD app. First step is to create the notes table.

CREATE TABLE notes (
  id INT PRIMARY KEY,
  title VARCHAR(100),
  body TEXT
);

This table has id, title and body columns. id is the primary key.

The table notes is created.

Project design — details

CRUD stands for Create-Read-Update-Delete. You create a table, then insert, read, update and delete data. This lesson sets up the table.

Practice Project design

Create the notes table with id (INT PRIMARY KEY), title (VARCHAR(100)) and body (TEXT).

Starter code

query.sql
-- create the table
CREATE TABLE

Sample solution

query.sql
CREATE TABLE notes (
  id INT PRIMARY KEY,
  title VARCHAR(100),
  body TEXT
)

Expected output

Tablo oluşturuldu

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 What does CRUD stand for?

  • Count-Read-Use-Drop
  • Copy-Run-Undo-Draw
  • Create-Read-Update-Delete Correct answer
  • Create-Run-Update-Done

Explanation: CRUD means Create-Read-Update-Delete.

2 Create table

Question
CREATE ____ notes (id INT PRIMARY KEY, title VARCHAR(100));
Answer
CREATE TABLE notes (id INT PRIMARY KEY, title VARCHAR(100));

Explanation: A new table is created with CREATE TABLE; columns are defined in the parentheses.

3 Project design: match the terms

Term Meaning
CREATE TABLE create table
INSERT insert
UPDATE update
DELETE delete

All lessons in Beginner