Databases & DBMS MCQs

20 practice MCQs on this page Page 8 of 16

Tap an option to check your answer — the correct answer and full explanation appear after you choose.

Computer ScienceDatabases & DBMS PPSCID: LTP-7749

A LEFT JOIN returns all rows from the left table and:

  1. AOnly rows that match in both tables
  2. BMatching rows from the right table, with NULL where there is no match ✓ Correct answer
  3. CNo rows from the right table
  4. DAll rows from the right table only
Computer ScienceDatabases & DBMS PPSCID: LTP-7750

A RIGHT JOIN returns all rows from the right table and:

  1. AOnly rows that match in both tables
  2. BNo rows from the left table
  3. CMatching rows from the left table, with NULL where there is no match ✓ Correct answer
  4. DAll rows from the left table only
Computer ScienceDatabases & DBMS PPSCID: LTP-7751

A FULL OUTER JOIN returns:

  1. AOnly matching rows
  2. BOnly the left table rows
  3. COnly the right table rows
  4. DAll rows from both tables, with NULL where there is no match ✓ Correct answer
Computer ScienceDatabases & DBMS PPSCID: LTP-7752

A CROSS JOIN between two tables produces:

  1. AThe Cartesian product of the two tables ✓ Correct answer
  2. BOnly matching rows
  3. CAn empty result
  4. DA single row
Computer ScienceDatabases & DBMS PPSCID: LTP-7753

In SQL, the UNION operator combines the results of two queries and:

  1. AKeeps all duplicate rows
  2. BRemoves duplicate rows ✓ Correct answer
  3. CDeletes the tables
  4. DSorts by the primary key only
Computer ScienceDatabases & DBMS PPSCID: LTP-7754

In SQL, the GROUP BY clause is used to:

  1. ASort rows in reverse order
  2. BDelete duplicate tables
  3. CGroup rows that share the same values for aggregate functions ✓ Correct answer
  4. DCreate a new database
Computer ScienceDatabases & DBMS PPSCID: LTP-7755

In SQL, the HAVING clause differs from WHERE because HAVING filters:

  1. ARows before grouping
  2. BTables before creation
  3. CColumns by data type
  4. DGroups after aggregation ✓ Correct answer
Computer ScienceDatabases & DBMS PPSCID: LTP-7756

In SQL, the ORDER BY clause is used to:

  1. ASort the result rows ✓ Correct answer
  2. BDelete rows
  3. CCreate an index
  4. DGrant permissions
Computer ScienceDatabases & DBMS PPSCID: LTP-7757

In SQL, the DISTINCT keyword is used to:

  1. ADelete a table
  2. BRemove duplicate values from the result ✓ Correct answer
  3. CSort by date
  4. DAdd a new column
Computer ScienceDatabases & DBMS PPSCID: LTP-7758

Which SQL aggregate function returns the number of rows in a group?

  1. ASUM
  2. BAVG
  3. CCOUNT ✓ Correct answer
  4. DMAX
Computer ScienceDatabases & DBMS PPSCID: LTP-7759

A database view is best described as:

  1. AA physical copy of a table
  2. BA backup file
  3. CA user password
  4. DA virtual table based on a query ✓ Correct answer
Computer ScienceDatabases & DBMS PPSCID: LTP-7760

A database index is mainly used to:

  1. ASpeed up data retrieval ✓ Correct answer
  2. BSlow down queries
  3. CDelete records
  4. DEncrypt passwords
Computer ScienceDatabases & DBMS PPSCID: LTP-7761

A trigger in a database is:

  1. AA printed report
  2. BA stored procedure that runs automatically when an event occurs ✓ Correct answer
  3. CA type of virus
  4. DA backup tape
Computer ScienceDatabases & DBMS PPSCID: LTP-7762

A stored procedure is best described as:

  1. AA single row of a table
  2. BA user manual
  3. CA set of SQL statements saved in the database for reuse ✓ Correct answer
  4. DA network cable
Computer ScienceDatabases & DBMS PPSCID: LTP-7763

In an ER diagram, cardinality describes:

  1. AThe size of the database file
  2. BThe speed of the server
  3. CThe colour of the diagram
  4. DHow many instances of one entity relate to another ✓ Correct answer
Computer ScienceDatabases & DBMS PPSCID: LTP-7764

A weak entity in an ER model is an entity that:

  1. ACannot exist without its owner entity ✓ Correct answer
  2. BHas no attributes at all
  3. CIs never stored
  4. DHas many primary keys
Computer ScienceDatabases & DBMS PPSCID: LTP-7765

The schema of a database describes:

  1. AThe data stored in the tables
  2. BThe structure of the database, including tables and columns ✓ Correct answer
  3. CThe password of the DBA
  4. DThe speed of queries
Computer ScienceDatabases & DBMS PPSCID: LTP-7766

The data dictionary of a DBMS contains:

  1. AThe personal data of users
  2. BPrinted manuals
  3. CMetadata about the database structure ✓ Correct answer
  4. DBackup tapes only
Computer ScienceDatabases & DBMS PPSCID: LTP-7767

Which of the following is the main responsibility of a Database Administrator (DBA)?

  1. AWriting web pages
  2. BDesigning logos
  3. CRepairing printers
  4. DManaging and securing the database system ✓ Correct answer
Computer ScienceDatabases & DBMS PPSCID: LTP-7768

In a database, concurrency control is needed mainly to:

  1. APrevent conflicts when several users access data at the same time ✓ Correct answer
  2. BDelete old records
  3. CPrint reports faster
  4. DCompress the database file

Practice these MCQs interactively