0
0
SQLquery~30 mins

What is SQL - Hands-On Activity

Choose your learning style9 modes available
Introduction to SQL Basics
📖 Scenario: You are working as a data assistant for a small bookstore. The store keeps track of books and their prices in a simple database table. You want to learn how to use SQL to manage this data.
🎯 Goal: Learn how to create a table, add data, and write a simple query to retrieve information using SQL.
📋 What You'll Learn
Create a table named books with columns id, title, and price
Insert three specific book records into the books table
Write a query to select all columns from the books table
Write a query to select only the title and price of books priced above 20
💡 Why This Matters
🌍 Real World
SQL is used to manage data in many businesses, like bookstores, to keep track of inventory and sales.
💼 Career
Knowing SQL helps you work with databases, a key skill for data analysts, developers, and many IT roles.
Progress0 / 4 steps
1
Create the books table
Write a SQL statement to create a table called books with three columns: id as an integer primary key, title as text, and price as a decimal number.
SQL
Need a hint?

Use CREATE TABLE books (id INTEGER PRIMARY KEY, title TEXT, price DECIMAL(10,2)); to create the table.

2
Insert book records
Write three SQL INSERT INTO books statements to add these books exactly: (1, 'The Great Gatsby', 10.99), (2, 'War and Peace', 25.50), and (3, '1984', 15.00).
SQL
Need a hint?

Use INSERT INTO books (id, title, price) VALUES (...); for each book.

3
Select all books
Write a SQL query to select all columns from the books table using SELECT * FROM books;.
SQL
Need a hint?

Use SELECT * FROM books; to get all data.

4
Select books priced above 20
Write a SQL query to select only the title and price columns from books where the price is greater than 20.
SQL
Need a hint?

Use SELECT title, price FROM books WHERE price > 20; to filter expensive books.