A Database is an organized collection of records.
The three types of data models are Relational, Hierarchical and Network.
DBMS stands for Database Management System.
Data redundancy means duplication of data.
Tuples are known as rows and Attributes are known as columns in RDBMS.
The three levels of abstraction are Internal level, conceptual level and external level.
Physical/Internal level is the lowest level of abstraction.
Primary key is a key that uniquely identifies a record in a table.
A combination of attributes that can serve as a primary key is known as Composite Primary key.
Number of columns in a table is the degree of the table.
In relational data model, a table is called relation.
Answer
True
Reason — In the relational data model, the data is organized into tables (i.e., rows and columns). These tables are called relation.
A row in a table will not represent a relationship among a set of values.
Answer
False
Reason — In the relational data model, a row in a table represents a relationship among a set of values.
Data Item is the smallest unit of named data.
Answer
True
Reason — In the relational data model, a data item is the smallest unit of named data. It is an atomic value that is the basic building block of a relational database.
Data Item represents multi-type of information in a field.
Answer
False
Reason — A data item, in the relational data model, represents a single value or a single type of information in a field, not multi-type.
In a relation, data is arranged in the form of rows and columns.
Answer
True
Reason — In a relation, data is arranged in the form of rows and columns, where rows represent records or tuples and columns represent attributes or fields.
A relation can contain more than one primary key.
Answer
False
Reason — Primary key is always unique in nature, i.e., non-redundant. It does not have duplicate values in a relation.
An alternate key is not a candidate key.
Answer
False
Reason — An alternate key is a candidate key. A candidate key that is not chosen as the primary key is called an alternate key. In other words, any attribute that is a candidate for the primary key, i.e., which is capable of becoming a primary key but is not a primary key, is an alternate key.
In a relation, a primary key is one of the candidate keys.
Answer
True
Reason — In a relation, a primary key is selected from one of the candidate keys. A candidate key is any attribute or set of attributes that can uniquely identify a row in a table.
The network model provides many-to-many (M:M) relationships among child and parent nodes.
Answer
True
Reason — The network model provides the capability of handling many-to-many (M:M) relationships. Thus, a child node can have more than one parent mode.
Data redundancy may lead to data inconsistency.
Answer
True
Reason — Data redundancy occurs when the same data is stored in multiple locations. This can lead to data consistency issues because if the data is updated in one location, it may not be updated in all other locations, resulting in inconsistent data across the system.
............... is a named collection of data items which represents a complete unit of information.
- Field
- Record
- Table
- Database
Answer
Record
Reason — Record is a named collection of data items which represents a complete unit of information.
A ............... is a named collection of all occurrences of a given type of logical record.
- Field
- Record
- Relation
- Database
Answer
Relation
Reason — A relation (table) is a named collection of all occurrences of a given type of logical record.
The number of attributes in a relation determines the ............... of a relation.
- Degree
- Tuples
- Attributes
- Cardinality
Answer
Degree
Reason — The total number of columns or attributes in a relation is known as degree of a relation.
The rows of the relations are generally referred to as ............... .
- Degree
- Tuples
- Attributes
- Cardinality
Answer
Tuples
Reason — The rows of the relations are referred to as tuples.
The number of tuples in a relation is called the ............... of the relation.
- Degree
- Tuple
- Attributes
- Cardinality
Answer
Cardinality
Reason — The number of tuples in a relation is called the cardinality of the relation.
What is a database?
- Organized collection of information that cannot be accessed, updated and managed
- Collection of data or information without organizing
- Organized collection of data or information that can be accessed, updated and managed
- Organized collection of data that cannot be updated
Answer
Organized collection of data or information that can be accessed, updated and managed
Reason — Database is an organized collection of interrelated data or information that can be accessed, updated and managed.
............... is a set of one or more attributes that can uniquely identify tuples within the relation.
- Primary Key
- Alternate Key
- Candidate Key
- Foreign Key
Answer
Primary Key
Reason — A primary key is a set of one or more attributes/fields which uniquely identifies a tuple/row in a table.
A candidate key that is not the primary key is called a/an ............... .
- Primary Key
- Alternate Key
- Candidate Key
- Foreign Key
Answer
Alternate Key
Reason — A candidate key that is not selected as the primary key is called an alternate key.
A/An ............... is a non-key attribute whose value is derived from the primary key of another table.
- Primary Key
- Alternate Key
- Candidate Key
- Foreign Key
Answer
Foreign Key
Reason — A foreign key is a non-key attribute whose value is derived from the primary key of another table.
Duplication of data is termed as ............... .
- Database Inconsistency
- Data Redundancy
- Data Integrity
- Data Consistency
Answer
Data Redundancy
Reason — Repetition (duplication) of the same data at multiple places in a database is known as data redundancy.
Which of the following data models is suitable for one-to-many relationship?
- Relational
- Network
- Hierarchical
- None of these
Answer
Hierarchical
Reason — Hierarchical model depicts one-to-many (1:M) relationships between a parent and child segment. Each parent segment can have many child segments but it does not hold true the other way round-each child segment has only one parent segment and is connected through links.
Which data model uses tables?
- Relational
- Network
- Hierarchical
- None of these
Answer
Relational
Reason — In relational data model, data is organized in two-dimensional tables called relations.
Which level of abstraction describes how the data is actually stored in the database?
- External level
- Conceptual level
- Physical level
- None of these
Answer
Physical level
Reason — Physical level is the lowest level of abstraction that describes how the data is actually stored in the database.
In ............... independence, any changes made in the table format do not change the data residing on the disc.
- Physical
- Logical
- Network
- None of these
Answer
Logical
Reason — Logical/Conceptual data independence is a kind of mechanism which is independent of the actual data stored on the disk. If any changes are made in the table format, it does not change the data residing on the disk.
Pool of values from where a column draws its value is called ............... .
- Table
- Attribute
- Data set
- Domain
Answer
Domain
Reason — Domain is the set of all possible values that an attribute/column may contain.
Candidate Key - Primary Key = ............... .
- Primary Key
- Alternate Key
- Foreign Key
- Zero
Answer
Alternate Key
Reason — Candidate Key - Primary Key = Alternate Key. A candidate key that is not chosen as the primary key is called an alternate key.
Records are also known as ............... and fields are also known as ............... .
- Horizontal Data, Vertical Data
- Attribute, Tuple
- Tuple, Attribute
- Column, Row
Answer
Tuple, Attribute
Reason — Records are also known as tuple and fields are also known as attributes.
Which of the following are valid field names of the table: Employee?
- empid, ename, esalary
- empid, ename, stu_name
- stu_Id, ename, esalary
- stu_Id, ename, stu_name
Answer
empid, ename, esalary
Reason — The field names empid, ename, and esalary
are valid and appropriate for a table named Employee because they are descriptive of employee attributes: employee ID, employee name, and employee salary.
Which of the following is not an example of DBMS?
- MySQL
- Microsoft Access
- IBM DB2
Answer
Reason — MySQL, Microsoft Access, and IBM DB2 are all examples of Database Management System whereas Google is a search engine.
What does an RDBMS consist of?
- Collection of Records
- Collection of Keys
- Collection of Tables
- Collection of Fields
Answer
Collection of Tables
Reason — An RDBMS (Relational Database Management System) is a collection of tables.
Assertion (A): Database management system is an application software which arranges data in a well-organized manner in the form of tables.
Reasoning (R): DBMS acts as an interface between the database stored in the computer memory and the user.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Answer
Both A and R are true and R is the correct explanation of A.
Explanation
Database Management System (DBMS) is an application software that acts as an interface between the database stored in the computer memory and the user. It enables users to interact with the database and store data in a well-organized manner in the form of tables. The purpose of the DBMS software is to allow the user to create, access, modify, and control a database.
Assertion (A): In hierarchical model, the data is organized in a tree-like structure.
Reasoning (R): In hierarchical model, searching for a particular record is a time-consuming process.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Answer
Both A and R are true and R is the correct explanation of A.
Explanation
The hierarchical model arranges data in a tree structure, where each record has a parent-child relationship. Searching for a specific record in such a model may require traversing through multiple levels of the hierarchy, which is time-consuming.
Assertion (A): A database consists of multiple tables.
Reasoning (R): A foreign key is used to represent the relationship between two tables.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Answer
Both A and R are true and R is the correct explanation of A.
Explanation
In a database system, data is organized into multiple tables for better organization, management, and query efficiency. A foreign key is a non-key attribute whose value is derived from the primary key of another table in a database. It references the primary key in another table, thereby establishing a relationship between the two tables.
Assertion (A): The limitations of traditional file system are overcome by storing data in a database.
Reasoning (R): We can organize related data logically in a database.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Answer
Both A and R are true and R is the correct explanation of A.
Explanation
Traditional file systems have limitations such as data redundancy, inconsistency, and difficulties in data sharing and security. In contrast, databases store data in a structured and organized manner, which helps overcome these limitations. They allow us to logically organize related data, making data management, retrieval, and manipulation more efficient.
Assertion (A): The number of attributes in a relation is called the degree of the relation.
Reasoning (R): The number of tuples in a relation is called the cardinality of the relation.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Answer
Both A and R are true but R is not the correct explanation of A.
Explanation
The degree of a relation and the cardinality of a relation are two separate concepts in database management. The number of attributes or columns in a relation is called the degree of the relation, while the number of tuples or records in a relation is called the cardinality of the relation.
Assertion (A): Each table must have one primary key.
Reasoning (R): Primary key is a set of one or more attributes that uniquely identifies a tuple in a relation.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Answer
Both A and R are true and R is the correct explanation of A.
Explanation
In a database, each table can have only one primary key, which is unique and non-redundant in nature. The primary key is a set of one or more attributes or fields that uniquely identify a tuple or row in a relation.
Assertion (A): A database can have only one table.
Reasoning (R): If a piece of data is stored in two places in a database, it leads to wastage of storage space.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Answer
A is false but R is true.
Explanation
A database can have multiple tables. Data redundancy, which occurs when the same data is repeated in multiple places within a database, leads to wastage of storage space. A DBMS eliminates data redundancy by integrating files, ensuring that multiple copies of the same data are not stored.
What is data?
Answer
Data is the smallest unit of file organization which is represented in the form of a bit that may either be 0 or 1.
What do you mean by information?
Answer
Information is processed, organized, and meaningful data that has been analyzed, interpreted, and structured to provide context, relevance, and value. It is derived from data through analysis and is used to make decisions or gain insights.
What is the difference between data and information?
Answer
Data | Information |
---|---|
Data is the lowest level of abstraction. | Information is one level higher abstraction than data. |
Data is unstructured and carries no meaning. | Information is derived by interpreting and processing data. |
For example, marks such as 67, 88, 90 and 77 are considered data. | For example, when these marks are related to a boy named Rohit, a student of class IX who has scored 67 in English, 88 in Maths, 90 in Physics and 77 in Chemistry then it becomes information. |
What is database and database system? What are the elements of database system?
Answer
Database is an organized collection of interpreted data that serves many applications.
A Database Management System is a general-purpose software system that facilitates the process of defining, constructing and manipulating databases for various applications.
A database system in SQL consists of tables with rows and columns, a schema defining structure and relationships, SQL for interaction, indexes for performance, constraints for data integrity.
Why do we need a database?
Answer
We need a database because it provides a structured and organized way to store, manage, and retrieve large amounts of data efficiently and effectively.
What is database management system? Why do we need a DBMS?
Answer
A Database Management System (DBMS) is a general-purpose software system that facilitates the process of defining, constructing and manipulating databases for various applications.
The database system is used to eliminate the problems of data redundancy and data inconsistency.
Explain the difference between database and file.
Answer
Database | File |
---|---|
Database is an organized collection of interpreted data that serves many applications. | A file is a collection of unorganized data stored in a single location. |
Data retrieval is fast and efficient, as databases use indexing and querying mechanisms. | Data retrieval is slow and inefficient, as the entire file needs to be searched. |
Data sharing is easy, as multiple users and applications can access the database simultaneously. | Data sharing is limited, as files are typically accessed by a single user or application. |
Data integrity is ensured through constraints, triggers, and transactions. | Data integrity is not ensured, as data can be corrupted or lost easily. |
Databases support relationships between data entities. | Files do not support relationships between data entities. |
Explain the difference between data and file.
Answer
Data | File |
---|---|
Data refers to raw facts, figures, or values that are collected and stored without any specific context or interpretation. | A file is a collection of unorganized data stored in a single location. |
The purpose of data is to convey information, provide insights, or support decision-making. | The purpose of a file is to store, manage, and provide access to the data. |
Data can exist in various formats, such as numbers, text, images, or audio, and can be structured or unstructured. | A file has a specific format and structure, defined by its file type (e.g., .txt, .jpg, .mp3), which determines how the data is stored and retrieved. |
Describe the components of the database system.
Answer
The various components of the database system are described below:
- Users — Users can be of varied types — Database administrators or DBAs, System or Application developers and end-users. DBMS provides the following critical services to the user :
- Database Creation — DBMS helps the user in creating and defining the required data or in turn, a database. It manages and organizes the required data and databases.
- Database Maintenance — A DBMS provides maintenance of data and database by addition, deletion, modification and regularly updating tables and their records.
- Database Processing — DBMS performs one of the major tasks of query processing — it processes the queries or the information requirement of the users and retrieves necessary information from the database.
- Database Application — Database applications may be personal, departmental, commercial and internal. It may be general-purpose or customized as per the needs of a user.
- DBMS — Software that allows users to define, create, access and manage databases is termed as a DBMS, for example, MySQL, Oracle, etc.
- Database — Database is an organized collection of logically related data.
What are the advantages and disadvantages of DBMS?
Answer
The advantages of DBMS are as follows:
- Control of data redundancy — A DBMS eliminates data redundancy (duplication of data) by integrating the files so that multiple copies of the same data are not stored.
- Data consistency — DBMS provides data consistency to a large extent as the changes made at one place are reflected at all other places or to all the users.
- Sharing of data — Sharing of data using a DBMS implies that not only can the existing applications share the data in the database but also that new applications can be developed to operate against the same stored data.
- Reduced programming effort — A DBMS saves a lot of programming effort since a user need not write programs for query processing involving several tables or files, report generation, addition, modification and deletion of data, etc. Thus, it provides easy retrieval of data.
- Database enforces standards — With centralized control of the database, the DBA (Database Administrator) can ensure that all applicable standards are followed in the representation of data, i.e., format, documentation standards and conventions, etc.
- Improved data integrity — The system itself checks for the correct information to be entered by the user in the correct format.
- Privacy and Security — Since there is a centralized control, the data is protected.
- Economical — Combining all the organization's operational data into one database and creating a set of applications that works on this single source of data can result in cost saving. The overall maintenance cost of data is reduced.
- Improved backup and recovery system — A database system provides facilities for recovery from hardware or software failure.
- Solving enterprise requirement, not individual requirement — Since various types of users with varying levels of technical knowledge use a database, a DBMS should provide a variety of user interfaces.
The disadvantages of DBMS are as follows:
- Complexity — DBMS software is complex and requires specialized knowledge to install, configure, and manage.
- Cost — Implementing and maintaining a DBMS involves high costs, including software licensing, hardware, and personnel.
- Maintenance — Regular maintenance, updates, and backups are required to ensure the DBMS operates efficiently and securely.
What is the role of DBA?
Answer
The DBA or the Database Administrator is the person responsible for the security and functioning of the database.
With centralized control of the database, the DBA (Database Administrator) can ensure that all applicable standards are followed in the representation of data, i.e., format, documentation standards and conventions, etc.
What is data redundancy? How can it be controlled?
Answer
Repetition (duplication) of the same data in multiple files is known as data redundancy. A DBMS eliminates data redundancy by integrating the files so that multiple copies of the same data are not stored.
What is data abstraction? What are the different levels of abstraction?
Answer
Data abstraction is a process of hiding the implementation details (such as how the data is stored and maintained) and representing only the essential features to simplify user's interaction with the system.
The different levels of abstraction are:
- Physical/Internal level
- Logical/Conceptual level
- View level/External level
What is data independence?
Answer
Data independence is the ability to change the schema at one level of a database system without requiring changes at a higher level. This is achieved through metadata, which follows a layered architecture, ensuring that changes to data at one layer do not affect data at another layer. A database system provides two types of data independence:
- Logical/Conceptual data independence
- Physical data independence
Give the terms for each of the following:
(a) Collection of logically related records.
(b) DBMS creates a file that contains description about the data stored in the database.
(c) Attribute that can uniquely identify the tuples in a relation.
(d) Special value that is stored when actual data value is unknown for an attribute.
(e) An attribute which can uniquely identify tuples of the table but is not defined as primary key of the table.
(f) Software that is used to create, manipulate and maintain a relational database.
Answer
(a) Table
(b) Data dictionary
(c) Primary key
(d) NULL
(e) Alternate Key
(f) Database Management System (DBMS)
Why are foreign keys allowed to have NULL values? Explain with an example.
Answer
A null value can be entered in a foreign key, indicating that the records are not related. In certain situations, a foreign key may accept a NULL value if it's not a part of the primary key of the foreign table.
For example, consider an Orders table in a database. Each order may or may not be associated with a customer. If an order is placed by a guest or a new customer who hasn't been added to the system yet, the CustomerID foreign key in the Orders table can be NULL to indicate that there is no associated customer record for that order.
Differentiate between database and table.
Answer
Database | Table |
---|---|
Database is an organized collection of interrelated data that serves many applications. | A table is a structure within a database that organizes data into rows and columns. |
It consists of multiple tables. | It is comprised of rows and columns. |
It is at higher level in the data storage hierarchy. | It is at lower level, as it is a component of the database. |
For example, MySQL database. | For example, employee table. |
Differentiate between primary key and foreign key.
Answer
Primary Key | Foreign Key |
---|---|
Primary Key is a column or group of columns in a table that uniquely identify every row in that table. | A foreign key is an attribute whose value is derived from the primary key of another table. A foreign key is used to represent the relationship between two tables. |
Primary key cannot have Null values. | Foreign key can have Null values. |
There can be only one primary key in a table. | Multiple foreign keys can exist in a table. |
It is used to enforce entity integrity and ensure data uniqueness. | It is used to enforce referential integrity and maintain data consistency across related tables. |
Differentiate between degree and cardinality of a relation.
Answer
Degree of a relation | Cardinality of a relation |
---|---|
The number of attributes in a relation is called the Degree of the relation. | The number of tuples in a relation is called the Cardinality of the relation. |
For example, if a relation has attributes like Name, Age, and Address, then its degree is 3. | For example, if a relation contains 10 records or tuples, then its cardinality is 10. |
Compared to a file system, how does a database management system avoid redundancy in data through a database?
Answer
A database stores the data at a central location wherefrom all application programs can access data. This removes the need of saving own data by application program and thus it reduces data redundancy.
Suppose all customers of a particular business live in states of which the city name is unique. Given the following description for customer data:
CUST_ID, CUST_NAME, STREET, CITY, STATE, PHONE
(a) List the most likely key for the primary key.
(b) List all the candidate keys and alternate keys.
Answer
(a) The most likely primary key is CUST_ID because it is a unique identifier assigned to each customer.
(b) CUST_ID, CITY attributes can be considered as candidate keys as both are unique to each customer.
CITY can serve as an alternate key because all customers live in states where the city names are unique.
Define Relation.
Answer
A relation is a table i.e., data arranged in rows and columns.
Define Domain.
Answer
A domain is a pool of values from which the actual values appearing in a given column are drawn.
Define Tuple.
Answer
The rows of tables (relations) are called tuples.
Define Attribute.
Answer
The columns of tables (relations) are called attributes.
Define Degree.
Answer
The number of attributes in a relation is called degree of a relation.
Define Cardinality.
Answer
The number of rows in a relation is known as cardinality of the relation.
Define primary key.
Answer
A primary key is a set of one or more attributes that can uniquely identify tuples within the relation.
Define candidate key.
Answer
All attribute combinations inside a relation that can serve as primary key are candidate keys as they are candidates for the primary key position.
Define alternate key.
Answer
A candidate key that is not the primary key is called an alternate key.
Define foreign key.
Answer
A non-key attribute, whose values are derived from the primary key of some other table, is known as foreign key in its current table.
Summarize the major differences between a relation and a traditional file.
Answer
Relation file | Traditional file |
---|---|
Data organized in tables with rows and columns. | Data stored in unstructured formats. |
Supports structured querying with SQL. | Lacks standardized querying abilities. |
Allows for defining relationships between tables. | No inherent support for relationships. |
Offers flexibility in data storage and retrieval. | Limited flexibility in data organization. |
Examples : MySQL, PostgreSQL | Examples : Text files, CSV files, Excel spreadsheets |
What is the relationship between a database and a table?
Answer
A database is an organized collection of interrelated data that serves many applications, while a table is a collection of logically related records. In other words, it is a named collection of data items that represent a complete unit of information within a database.
What is DBMS? Write the names of any two DBMSs.
Answer
A Database Management System (DBMS) is a general-purpose software system that facilitates the process of defining, constructing and manipulating databases for various applications.
Examples of DBMS are MS Access, MySQL.
How is data organized in a table?
Answer
Data in a table is organized into rows and columns. Each row represents a record or tuple, while each column represents an attribute or field of the data.
What is a primary key? What is its function in a table?
Answer
A primary key is a set of one or more attributes/fields which uniquely identifies a tuple/row in a table.
Its function in a table is to uniquely identify tuples or rows and prevent the entry of duplicate rows, thus ensuring data integrity.
Distinguish between Row and Column.
Answer
Row | Column |
---|---|
A horizontal group of data cells in a table. | A vertical group of data cells in a table. |
Each row in a table is known as a tuple/record. | Each column in a table is known as field/attribute. |
A record in a table represents a set of related data. | An attribute is a set of values of a particular type. |
The total number of rows in a table represent its cardinality. | The total number of columns in a table represent its degree. |
Distinguish between database and table.
Answer
Database | Table |
---|---|
Database is an organized collection of interrelated data that serves many applications. | A table is a structure within a database that organizes data into rows and columns. |
It consists of multiple tables. | It is comprised of rows and columns. |
It is at higher level in the data storage hierarchy. | It is at lower level, as it is a component of the database. |
For example, MySQL database. | For example, employee table. |