0
0
SQLquery~20 mins

CREATE TABLE syntax in SQL - Mini Project: Build & Apply

Choose your learning style9 modes available
Create a Simple SQL Table
📖 Scenario: You are setting up a small database for a local bookstore. You need to create a table to store information about books.
🎯 Goal: Build a SQL table named Books with columns for BookID, Title, and Author.
📋 What You'll Learn
Create a table named Books
Add a column BookID as an integer and primary key
Add a column Title as text and not null
Add a column Author as text and not null
💡 Why This Matters
🌍 Real World
Creating tables is the first step in building a database to store and organize data for applications like bookstores, libraries, or any business.
💼 Career
Knowing how to create tables with proper columns and constraints is essential for database administrators, backend developers, and data analysts.
Progress0 / 4 steps
1
Create the table named Books
Write a SQL statement to create a table called Books.
SQL
Need a hint?

Use CREATE TABLE Books to start your statement.

2
Add the BookID column
Add a column named BookID as an integer and set it as the primary key inside the Books table.
SQL
Need a hint?

Use BookID INTEGER PRIMARY KEY to define the column.

3
Add the Title and Author columns
Add two columns inside the Books table: Title and Author. Both should be text and not allow null values.
SQL
Need a hint?

Use Title TEXT NOT NULL and Author TEXT NOT NULL to add these columns.

4
Complete the CREATE TABLE statement
Make sure the CREATE TABLE Books statement is complete with all columns and proper syntax including commas and parentheses.
SQL
Need a hint?

Check that all columns are separated by commas and the statement ends with a closing parenthesis and semicolon.