Basic CRUD Operations
Which SQL statement is used to add a new record into a table?
- INSERT
- INNERT
- INSRT
- ENTR
- INPUT
Transactions in SQL
What is the purpose of a SQL TRANSACTION when performing multiple database operations?
- To ensure all operations succeed or none are saved
- To only allow select queries
- To permanently delete data
- To create a backup of the table
- To sort the data by default
SQL SELECT Syntax
Which keyword is used to filter the number of rows returned by a SQL SELECT query?
- WHERE
- LIMIT
- WHILE
- CUT
- BOUNDRY
Table Creation Basics
How do you create a new table named 'users' with SQL?
- CREATE TABLE users (...);
- MAKE TABLE users (...);
- ADD TABLE users (...);
- GEN TABLE users (...);
- BUILD TABLE users (...);
Updating Data
Which keyword updates existing records in a SQL table?
- UPDATE
- UPDAT
- CHNAGE
- REVISE
- INSERT
Deleting Records
How would you remove all records from a table called 'products' without deleting the table?
- DELETE FROM products;
- REMOVE TABLE products;
- DROP products;
- ERASE TABLE products;
- CUT FROM products;
Relational Database Features
Which concept ensures each value in a column is unique in a relational database?
- UNIQUE constraint
- PRIMARY key
- FOREIGN kay
- IDX unique
- CONST uniq
SQL and Environment Variables
Why is it a good practice to store database connection details in an environment file?
- To protect sensitive information
- To optimize query performance
- To create backups automatically
- To increase transaction speed
- To enable multi-threading
SQL Query Errors
What will likely happen if you try to use transactions with a pool.query method in PostgreSQL?
- You will encounter unexpected transactional problems
- All queries will be twice as fast
- The table will be dropped
- Indexes will automatically update
- Nothing will happen
SQL Data Persistence with Docker
How can you keep your database data intact even after stopping a Dockerized SQL service?
- By using a data volume for the database service
- By not running any queries
- By stopping the server gracefully
- By increasing memory allocation
- By setting auto_commit to TRUE