CSS - PMS - CCE - PCS - Basic Computing
Database Basics
Which data type is normally used for whole numbers?
A. INTEGER
B. VARCHAR
C. DATE
D. BOOLEAN
Correct Answer: A
INTEGER stores whole numbers without a fractional part.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
A temporary name given to a table in a query is especially useful for:
A. Self joins and shorter references
B. Deleting the database server
C. Formatting a hard disk
D. Creating passwords automatically
Correct Answer: A
Table aliases make queries shorter and allow the same table to be referenced more than once.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
Which statement about a candidate key is correct?
A. It uniquely identifies a row and contains no unnecessary attribute
B. It must always contain every column
C. It may identify many rows with the same value
D. It cannot become a primary key
Correct Answer: A
A candidate key is both unique and minimal.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
The primary key is selected from the available:
A. Candidate keys
B. Foreign keys
C. Reports
D. Views
Correct Answer: A
A table may have several candidate keys, and one is selected as the primary key.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
Which table commonly resolves a many-to-many relationship?
A. Junction table
B. Report table only
C. Backup table
D. Temporary view only
Correct Answer: A
A junction table contains foreign keys referencing the two related tables.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
If Table A has 4 rows and Table B has 3 rows, a CROSS JOIN returns:
A. 12 rows
B. 7 rows
C. 4 rows
D. 3 rows
Correct Answer: A
A Cartesian product contains 4 × 3 = 12 row combinations.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
Which clause normally specifies the condition used to connect tables in a join?
A. ON
B. AS
C. ORDER
D. VALUES
Correct Answer: A
The ON clause defines how rows from the participating tables are matched.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
CRUD stands for:
A. Create, Read, Update, Delete
B. Copy, Run, Undo, Display
C. Create, Replace, Upload, Download
D. Connect, Read, Use, Disconnect
Correct Answer: A
CRUD represents the four basic data operations: Create, Read, Update, and Delete.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
What is a possible disadvantage of adding many indexes?
A. INSERT, UPDATE, and DELETE operations may become slower
B. SELECT becomes impossible
C. The database cannot use keys
D. All tables become views
Correct Answer: A
Indexes require storage and must be maintained whenever indexed data changes.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
What is a major purpose of a database index?
A. To speed up data retrieval
B. To delete all records
C. To replace the primary key in every case
D. To remove the DBMS
Correct Answer: A
An index provides a faster path for locating rows, especially in frequently searched columns.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
A virtual table based on a stored SELECT statement is called a:
A. View
B. Index
C. Trigger
D. Backup
Correct Answer: A
A view presents query results like a table without necessarily storing the data separately.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
The EXISTS operator is true when a subquery:
A. Returns at least one row
B. Returns no columns
C. Deletes a table
D. Creates a backup
Correct Answer: A
EXISTS evaluates to true when the subquery produces one or more rows.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
A query written inside another query is called a:
A. Subquery
B. Form
C. Report
D. Index
Correct Answer: A
A subquery is nested inside another SQL statement and provides data to the outer query.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
Which SQL operator combines query results and keeps duplicates?
A. UNION ALL
B. UNION
C. DISTINCT
D. GROUP BY
Correct Answer: A
UNION ALL is faster in many cases because it keeps duplicate rows instead of removing them.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
Which SQL operator combines query results and removes duplicates?
A. UNION
B. UNION ALL
C. JOIN ALL
D. MERGE ONLY
Correct Answer: A
UNION combines compatible result sets and removes duplicate rows.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
A join in which a table is joined to itself is called a:
A. SELF JOIN
B. CROSS JOIN
C. FULL JOIN
D. UNION
Correct Answer: A
A self join uses aliases to compare or relate rows within the same table.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
Which join produces every possible combination of rows from two tables?
A. CROSS JOIN
B. INNER JOIN
C. LEFT JOIN
D. RIGHT JOIN
Correct Answer: A
CROSS JOIN produces the Cartesian product of the two tables.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
Which join returns matched and unmatched rows from both tables?
A. FULL OUTER JOIN
B. INNER JOIN
C. CROSS JOIN
D. SELF JOIN
Correct Answer: A
FULL OUTER JOIN includes all rows from both tables and uses NULL where no match exists.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
Which join returns all rows from the right table and matching rows from the left table?
A. RIGHT JOIN
B. LEFT JOIN
C. INNER JOIN
D. SELF JOIN
Correct Answer: A
RIGHT JOIN preserves every row from the right table and includes matching rows from the left.
CSS - PMS - CCE - PCS - Basic Computing
Database Basics
Which join returns all rows from the left table and matching rows from the right table?
A. LEFT JOIN
B. INNER JOIN
C. RIGHT JOIN
D. CROSS JOIN
Correct Answer: A
LEFT JOIN preserves every row from the left table and fills unmatched right-side values with NULL.