NEW
Font size
WorksheetsUnderstanding Data Manipulation Language
Total questions: 11
Worksheet time: 6mins
What are the main categories of SQL commands?
DQL, DDL, DML, DCL, TCL
SQL Queries, SQL Views, SQL Indexes
SQL Functions, SQL Procedures, SQL Triggers
SQL Scripts, SQL Transactions, SQL Joins
Explain the purpose of the SELECT statement in SQL.
To create new tables in a database.
To delete data from a database.
The purpose of the SELECT statement in SQL is to retrieve data from a database.
To update existing records in a database.
What is the difference between INNER JOIN and LEFT JOIN?
INNER JOIN returns all rows from the left table; LEFT JOIN returns only matched rows from the right table.
INNER JOIN returns all rows from both tables; LEFT JOIN returns only matched rows.
INNER JOIN includes unmatched rows from the left table; LEFT JOIN excludes unmatched rows.
INNER JOIN returns matched rows only; LEFT JOIN returns all left table rows with matched right table rows.
Describe the INSERT INTO statement and its syntax.
INSERT INTO table_name SET column1 = value1, column2 = value2;
INSERT INTO table_name (column1, column2, ...) VALUES (value1, value2, ...);
INSERT INTO (column1, column2) VALUES (value1, value2) INTO table_name;
INSERT table_name (column1, column2) VALUES (value1, value2);
How can you insert multiple rows into a table in SQL?
INSERT table_name (column1, column2) VALUES (value1a, value2a);
ADD ROWS INTO table_name (value1a, value2a);
INSERT INTO table_name VALUES (value1a, value2a);
INSERT INTO table_name (column1, column2) VALUES (value1a, value2a), (value1b, value2b), (value1c, value2c);
What SQL command is used to modify existing records in a table?
SELECT
DELETE
UPDATE
INSERT
Explain the purpose of the UPDATE statement and provide an example.
DELETE employees WHERE id = 1;
INSERT INTO employees (id, salary) VALUES (1, 50000);
SELECT * FROM employees WHERE id = 1;
UPDATE employees SET salary = 50000 WHERE id = 1;
What is the DELETE statement used for in SQL?
The DELETE statement is used to retrieve records from a table.
The DELETE statement is used to remove records from a table in SQL.
The DELETE statement is used to create new records in a table.
The DELETE statement is used to update existing records in a table.
How do you ensure that a transaction is completed successfully in SQL?
Execute the transaction without any commands.
Ignore errors and proceed with the next transaction.
Use SELECT to retrieve data only.
Use BEGIN TRANSACTION, then COMMIT or ROLLBACK as needed.
What is the role of COMMIT and ROLLBACK in transaction control?
COMMIT undoes changes, ROLLBACK saves changes in a transaction.
COMMIT is used to delete changes, ROLLBACK is used to create changes.
COMMIT and ROLLBACK are used for data retrieval in transactions.
COMMIT saves changes, ROLLBACK undoes changes in a transaction.
Apakah perintah Create bisa digunakan untuk input data
Bisa tapi harus spesifik
Bisa dengan membuat langsung di phpmyadmin
Tidak
bisa
