0
0
SQLquery~30 mins

What is a database in SQL - Hands-On Activity

Choose your learning style9 modes available
Understanding What a Database Is
📖 Scenario: Imagine you run a small bookstore. You want to keep track of your books, customers, and sales in an organized way. A database helps you store and manage this information easily.
🎯 Goal: You will create a simple table to represent a database storing book information. This will help you understand what a database is and how data is organized inside it.
📋 What You'll Learn
Create a table called Books with columns BookID, Title, and Author
Insert three books with exact details into the Books table
Write a query to select all columns from the Books table
💡 Why This Matters
🌍 Real World
Databases are used everywhere to keep information organized, like in stores, websites, and apps.
💼 Career
Understanding databases is important for jobs in data management, software development, and many tech roles.
Progress0 / 4 steps
1
Create the Books table
Write a SQL statement to create a table called Books with three columns: BookID as an integer primary key, Title as text, and Author as text.
SQL
Need a hint?

Use CREATE TABLE followed by the table name and define each column with its data type.

2
Insert book records
Write three SQL INSERT INTO Books statements to add these exact books:
1. BookID: 1, Title: 'The Great Gatsby', Author: 'F. Scott Fitzgerald'
2. BookID: 2, Title: '1984', Author: 'George Orwell'
3. BookID: 3, Title: 'To Kill a Mockingbird', Author: 'Harper Lee'
SQL
Need a hint?

Use INSERT INTO Books (BookID, Title, Author) VALUES (...) for each book.

3
Select all books
Write a SQL query to select all columns from the Books table.
SQL
Need a hint?

Use SELECT * FROM Books; to get all columns and rows.

4
Explain what a database is
Add a SQL comment at the top of your code explaining in simple words what a database is. Use the exact phrase: -- A database is a place to store and organize data so we can find and use it easily.
SQL
Need a hint?

Start your code with a comment using -- and write the exact phrase given.