Free Databases MCQs with Answers
210 Databases MCQs from Computer Science and IT, each with the correct answer and a written explanation of why it is correct. Free and unlimited, with no account needed.
Databases cover tables, records, fields, keys and relationships, together with database management systems and relational database design. The subject includes primary and foreign keys, normalization, SQL commands such as SELECT, INSERT, UPDATE and DELETE, queries, forms and reports, while distinguishing a database from a spreadsheet used for simple tabular data.
Last updated
210 questions · page 3 of 11
- A. Primary Key
- B. Foreign Key
- C. Super Key
- D. Composite Key
Explanation: A candidate key is a minimal set of attributes that can uniquely identify a tuple (or row) in a relation (or table) in a database.In simpler terms, it's a set of one or more columns (attributes) in a table that can uniquely identify each record in the table
Correct answer: Primary Key- A. It must be unique
- B. It helps in indexing of large database
- C. It makes sorting quicker
- D. All of these
Explanation: A primary key is a column (or set of columns) in a database table that uniquely identifies each row in the table. This means that no two rows in the table can have the same value for the primary key.B. It helps in indexing of large database: A primary key can be used to create an index on a table, which can improve the performance of queries that filter or sort data based on the primary key. However, this is not the only purpose of a primary key.C. It makes sorting quicker: As mentioned above, a primary key can be used to create an index that can speed up sorting.
Correct answer: All of these- A. A person's last name
- B. An employee salary
- C. A customer's Id
- D. A sale's person region
Explanation: The correct answer is (c) A customer's ID number.A primary key is a field (or set of fields) in a database table that uniquely identifies each row in the table. This means that no two rows in the table can have the same value for the primary key. A customer ID number is typically a unique identifier assigned to each customer, making it a good choice for a primary key.
Correct answer: A customer's Id- A. Data Manager
- B. SQL
- C. Report Generators
- D. Utilities
Explanation: SQL (b) is used to create data views. SQL (Structured Query Language) is a programming language designed for managing data in relational databases. It can be used to create, read, update and delete data in a database, as well as to create data views.
Correct answer: SQL- A. Secondary key
- B. Foreign Key
- C. Candidate Key
- D. Primary Key
Explanation: A foreign key is a column or group of columns in a relational database table that references the primary key of another table. The table that contains the foreign key is called the child table or dependent table. It establishes a link between two tables and helps enforce data integrity by ensuring that the data in the child table refers to valid data in the parent table.
Correct answer: Foreign Key- A. Join
- B. Data Integration
- C. Relationship
- D. Keys
Explanation: A Key can be a single attribute or a group of attributes, where the combination may act as a key.
Correct answer: Keys- A. Each row is unique
- B. The order column is significant
- C. The order of rows is insignificant
- D. Columns are all elemental or atomic
Explanation: A table is a set of data elements (values) using a model of vertical columns (identifiable by name) and horizontal rows, the cell being the unit where a row and column intersect. A table has a specified number of columns, but can have any number of rows.
Correct answer: The order column is significant- A. Improve the performance of data base
- B. Document the structure of database itself
- C. Reduce data dependancy for application program
- D. All of these
Explanation: Indexes in a database management system (DBMS) are data structures that improve the speed of data retrieval operations on a table. They work like the index of a book, allowing the database to quickly find the location of rows that match a certain criteria.
Correct answer: Improve the performance of data base- A. Each attribute has a unique name
- B. No two rows in a relation are Identical
- C. There are no multivalued attributes in a relation
- D. All of the above
Explanation: Improve the performance of the database: This is the most common reason to create indexes. Indexes act like a special filing system for your database table, allowing the database to quickly locate specific rows of data without having to scan the entire table. This can significantly speed up queries that filter or sort data based on the indexed columns.Document the structure of the database itself: Indexes can help document the structure of a database by revealing which columns are frequently used for filtering and sorting data. This information can be helpful for database administrators and developers who are trying to understand how the database is being used.Reduce data dependency for application program: By improving the performance of queries, indexes can indirectly reduce the data dependency for application programs. This is because applications will wait less time for data to be retrieved from the database.
Correct answer: All of the above- A. A key that identifies only one record
- B. The most important field in a record
- C. The first field of tha table
- D. Redundant field
Explanation: A Key can be a single attribute or a group of attributes, where the combination may act as a key.
Correct answer: The most important field in a record- A. Indivisible
- B. Different
- C. Divisible
- D. Constant
Explanation: In the context of databases, a domain is considered atomic if its elements are considered indivisible units. This means that the values in the domain cannot be further divided or decomposed into smaller parts for the purpose of data storage or manipulation within the database.
Correct answer: Indivisible- A. Global key
- B. Link key
- C. Foreign key
- D. Super key
Explanation: A foreign key is a field in one table that uniquely identifies a row of another table or the same table. In simpler words, the foreign key is defined in a second table, but it refers to the primary key or a unique key in the first table
Correct answer: Foreign key53. SQL is used for
- A. Data definition
- B. Data Manipulation
- C. Data definition and Manipulation
- D. Searching records
Explanation: SQL is a domain-specific language used in programming and designed for managing data held in a relational database management system, or for stream processing in a relational data stream management system.
Correct answer: Data definition and Manipulation- A. Parabola
- B. Parallelogram
- C. Ellipse
- D. Rectangular
Explanation: In an Entity-Relationship (ER) diagram, attributes are represented by ellipses or ovals connected to their respective entity. Each attribute is usually depicted with its name inside the ellipse.
Correct answer: Ellipse- A. Secondary Key
- B. Index
- C. Composite
- D. Linked key
Explanation: A secondary key is made on a field that you would like to be indexed for faster searches. A table can have more than one secondary key. The main purpose of a database is to store and search for data.
Correct answer: Secondary Key- A. Relationship
- B. Cardinality
- C. Modality
- D. Attribute
Explanation: An attribute is a property or characteristic of an object. In a database, attributes are used to define the columns in a table. For example, in a table of customers, some attributes might be customer name, address, and phone number
Correct answer: Attribute- A. One-to-one
- B. One-to-many
- C. Many-to-many
- D. Many-to-one
Explanation: A single book can be read by many different people (many). Likewise, a single person can read many different books (many). There is a reciprocal relationship between books and readers. A book doesn't become obsolete after being read by one person, and a reader can keep reading new books. So, it's a many-to-many relationship
Correct answer: Many-to-many- A. Query
- B. Table
- C. Form
- D. Report
Explanation: A table is the fundamental structure of a relational database. It stores data in a grid-like format with rows and columns. Each row represents a record, and each column represents an attribute (characteristic) of that record. Tables allow data to be organized and efficiently accessed
Correct answer: Table- A. Each relation name is distinct from the names of other relations in the schema
- B. Tuples in a relation are ordered
- C. None of the other options
- D. Each value in a tuple is atomic
- E. Values of a specific attribute arefrom the same atomic domain
Explanation: Unlike sets, order does not matter in relations. Tuples can be returned or processed in any order without affecting the results
Correct answer: Tuples in a relation are ordered- A. Table
- B. Record
- C. Field
- D. Cell
Explanation: In a relational database table, columns represent categories of data. Each column holds a specific type of information about the entities in the table. For instance, in a customer table, a column might be named "Last Name" to store the last names of customers. Another column might be named "City" to store the city in which each customer lives.
Correct answer: Field