CSS - PMS - CCE - PCS - Basic Computing
Database Basics
Which clause filters individual rows before grouping?
A. WHERE
B. HAVING
C. ORDER BY
D. AS
Correct Answer: A
WHERE filters rows before grouping and aggregation are performed.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
Which SQL command marks a point inside a transaction for partial rollback?
A. SAVEPOINT
B. SELECT
C. ALTER
D. TRUNCATE
Correct Answer: A
SAVEPOINT creates a named point to which a transaction can later be rolled back.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
Which SQL command cancels uncommitted transaction changes?
A. ROLLBACK
B. COMMIT
C. GRANT
D. CREATE
Correct Answer: A
ROLLBACK reverses changes made since the transaction began or since a savepoint.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
Which SQL command permanently saves a transaction?
A. COMMIT
B. ROLLBACK
C. SELECT
D. DROP
Correct Answer: A
COMMIT makes the changes made in the current transaction permanent.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
COMMIT, ROLLBACK, and SAVEPOINT belong to:
A. TCL
B. DDL
C. DQL
D. HTML
Correct Answer: A
Transaction Control Language commands manage database transactions.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
GRANT and REVOKE belong to:
A. DCL
B. DML
C. DDL
D. DQL
Correct Answer: A
Data Control Language commands manage permissions and access rights.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
INSERT, UPDATE, and DELETE belong to:
A. DML
B. DDL
C. DCL
D. CSS
Correct Answer: A
Data Manipulation Language commands insert, change, and remove table data.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
CREATE, ALTER, and DROP belong to:
A. DDL
B. DCL
C. TCL
D. HTML
Correct Answer: A
Data Definition Language commands define or change database structures.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
Which SQL command quickly removes all rows while keeping the table structure?
A. TRUNCATE TABLE
B. DROP TABLE
C. CREATE TABLE
D. ALTER TABLE
Correct Answer: A
TRUNCATE TABLE removes all rows but keeps the table structure for future use.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
Which SQL command removes a table definition and its data?
A. DROP TABLE
B. DELETE ROW
C. SELECT TABLE
D. ORDER TABLE
Correct Answer: A
DROP TABLE removes the table object, including its structure and stored rows.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
Which SQL command changes the structure of an existing table?
A. ALTER TABLE
B. SELECT TABLE
C. INSERT TABLE
D. SAVE TABLE
Correct Answer: A
ALTER TABLE changes table structure, such as adding, removing, or modifying columns.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
Which SQL command creates a new table?
A. CREATE TABLE
B. SELECT TABLE
C. UPDATE TABLE
D. COMMIT TABLE
Correct Answer: A
CREATE TABLE defines a new table, its columns, data types, and constraints.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
Which SQL command removes selected rows from a table?
A. DELETE
B. CREATE
C. SELECT
D. GRANT
Correct Answer: A
DELETE removes rows and can use a WHERE clause to choose which rows are removed.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
Which SQL command changes existing records?
A. UPDATE
B. SELECT
C. CREATE
D. COMMIT
Correct Answer: A
UPDATE changes values in existing rows, usually based on a WHERE condition.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
Which SQL command adds a new record to a table?
A. INSERT
B. UPDATE
C. ALTER
D. GRANT
Correct Answer: A
INSERT adds new rows to a table.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
Which SQL command retrieves data from a table?
A. SELECT
B. INSERT
C. DELETE
D. DROP
Correct Answer: A
SELECT is used to retrieve rows and columns from one or more tables.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
What does SQL stand for?
A. Structured Query Language
B. Simple Question Logic
C. System Quality Link
D. Sequential Queue Language
Correct Answer: A
SQL stands for Structured Query Language and is used to work with relational databases.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
A decomposition that allows the original table to be reconstructed without losing information is:
A. Lossless decomposition
B. Destructive deletion
C. Data encryption
D. Circular backup
Correct Answer: A
Lossless decomposition divides a table while preserving all information and valid relationships.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
A possible disadvantage of heavy normalization is:
A. More joins may be required
B. Primary keys become impossible
C. The database cannot store text
D. All security is removed
Correct Answer: A
Highly normalized designs may require more table joins, which can make queries more complex.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
A relationship in which one attribute determines another is called a:
A. Functional dependency
B. Visual dependency
C. Network address
D. File extension
Correct Answer: A
A functional dependency exists when the value of one attribute determines the value of another.