0% found this document useful (0 votes)
19 views

SQL Worksheet Insert Update Delete (4)

The document is a beginner-level SQL worksheet focused on practicing INSERT, UPDATE, and DELETE statements using a sample Customers table. It includes exercises for inserting a new customer, updating an existing customer's city, and deleting a customer, along with fill-in-the-blank sections and a quick check for understanding SQL concepts. Additionally, there is a bonus challenge regarding the implications of a DELETE statement without a WHERE clause.

Uploaded by

hananyah2605
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

SQL Worksheet Insert Update Delete (4)

The document is a beginner-level SQL worksheet focused on practicing INSERT, UPDATE, and DELETE statements using a sample Customers table. It includes exercises for inserting a new customer, updating an existing customer's city, and deleting a customer, along with fill-in-the-blank sections and a quick check for understanding SQL concepts. Additionally, there is a bonus challenge regarding the implications of a DELETE statement without a WHERE clause.

Uploaded by

hananyah2605
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

SQL Worksheet: INSERT, UPDATE, DELETE (Beginner Level)

Part A: Starting Table – Customers


Use the table below to answer the questions in Parts A, B, and C.

CustomerID CustomerName Phone Address City Country


1 Alice Johnson 555-0123 123 Elm New York USA
Street
2 Ravi Kumar 982- 7 MG Road Mumbai India
1234567
3 Fatima Zahra 212- 42 Pearl St Casablanca Morocco
3344556
4 John Smith 777-332211 98 King Ave London UK
5 Mei Lin 010- 55 Lotus Rd Beijing China
88997766

Part B: INSERT Statement Practice


Insert a new customer with the following information:
- CustomerID: 6
- CustomerName: Carlos Mendes
- Phone: 351-9123456
- Address: 21 Rosa St
- City: Lisbon
- Country: Portugal

1. Fill in the blanks to complete the INSERT statement below:

INSERT INTO Customers (______________________)


VALUES (_____________________________________);

2. Write the full SQL statement to add Carlos Mendes to the table:

Part C: UPDATE Statement Practice


Update Ravi Kumar’s city from Mumbai to Delhi.

3. Fill in the blanks:


UPDATE __________
SET _________ = '_______'
WHERE _________ = ___;

4. Write the full SQL UPDATE statement:

Part D: DELETE Statement Practice


Delete the customer with CustomerID = 4 (John Smith).

5. Fill in the blanks:

DELETE FROM __________


WHERE __________ = ___;

6. Write the full DELETE statement:

Part E: Quick Check (Tick the correct answers)


7. Which of the following is true about SQL statements?

☐ A. You can leave out the WHERE clause in an UPDATE if you want to update only one row.
☐ B. Strings like city names must be inside single quotes ' ' in SQL.
☐ C. DELETE without WHERE deletes all rows.
☐ D. SQL is case-sensitive for commands like SELECT and INSERT.

Bonus Challenge
8. What will happen if you run this statement?

DELETE FROM Customers;

Your answer:
____________________________________________________________
____________________________________________________________

You might also like