Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
6 views14 pages

8 DBMS Throry

The document provides an overview of Database Management Systems (DBMS), detailing its definition, advantages, and key concepts such as types of keys and relationships. It outlines various database models, including hierarchical, network, and relational models, and emphasizes the importance of data integrity, security, and efficient data management. Additionally, it lists examples of DBMS software and explains key functions of a DBMS.

Uploaded by

kshitijmathpal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views14 pages

8 DBMS Throry

The document provides an overview of Database Management Systems (DBMS), detailing its definition, advantages, and key concepts such as types of keys and relationships. It outlines various database models, including hierarchical, network, and relational models, and emphasizes the importance of data integrity, security, and efficient data management. Additionally, it lists examples of DBMS software and explains key functions of a DBMS.

Uploaded by

kshitijmathpal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Mr. Gajendra Sharma CS/IP Mo.NO.

: 9810301034

EDUCATION
FOR
EVERYONE

D.B.M.S
(DATA BASE MANAGEMENT SYSTEM)
1. What does DBMS stand for?
A. Data Backup Management System B. Database Management System
C. Data Business Management System D. Digital Base Management Software
Answer: B. Database Management System
2. DBMS stands for __________.
Answer: Database Management System
3. DBMS stands for Database Management __________.
A. Solution B. Software C. System D. Service
Answer: C. System
4. A database is an organized collection of related data.
Answer: True

Mr. Gajendra Sharma


9810301034
[email protected]
Page 1 of 14 EDUCATION FOR EVERYONE
Mr. Gajendra Sharma CS/IP Mo.NO.: 9810301034

DATABASE CONCEPTS
 INTRODUCTION TO DATABASE CONCEPTS AND ITS NEED
o LIST DIFFERENT TYPE OF DATABASE EXAMPLES:
o ADVANTAGES OF DATABASE
o VARIOUS LEVELS OF DATABASE
o DIFFERENT DATA MODEL
o KEY FUNCTIONS OF A DBMS:
o EXAMPLES OF DBMS SOFTWARE:
o ADVABTAGE OF DBMS SOFTWARE:
o TYPES OF KEYS IN DBMS
o KEY CONCEPTS IN RELATIONSHIPS
o BASIC TERMINOLOGIES RELATED TO A RELATIONAL
DATABASE AND TABLES (RELATION)
o RELATIONAL DATABASE MODEL
o DATABASE KEYS
 CARDINALITY OR ROW IN A TABLE IS CALLED TUPLES
 RELATIONAL DATA MODEL:
o RELATION
o ATTRIBUTE
o TUPLE
o DOMAIN
o DEGREE
o CARDINALITY
 KEYS (CANDIDATE KEY, PRIMARY KEY, ALTERNATE
KEY, FOREIGN KEY)

Page 2 of 14 EDUCATION FOR EVERYONE


Mr. Gajendra Sharma CS/IP Mo.NO.: 9810301034
DBMS
13 (DATA BASE MANAGEMENT SYSTEM)
DATABASE: A database is an organized collection of structured information, or data, typically stored electronically in
a computer system. A database is usually controlled by a database management system (DBMS).
Together, the data and the DBMS, along with the applications that are associated with them, are referred to as a
database system, often shortened to just database.
Data within the most common types of databases in operation today is typically modeled in rows and columns in a
series of tables to make processing and data querying efficient.
The data can then be easily accessed, view, show, managed, modified, edit , updated, delete, controlled, and organized
by SQL (structured query language.)
Most databases use structured query language (SQL) for writing and querying data.

LIST DIFFERENT TYPE OF DATABASE EXAMPLES:


1. PHONE BOOK 6. AIRLINE BOOKING
2. BANK SYSTEM 7. CUSTOMER RELATIONSHIP MANAGEMENT (CRM)
3. HOTEL RESERVATION 8. INVENTORY CONTROL
4. LIBRARY MANAGEMENT 9. ONLINE RETAIL STORE
5. SCHOOL MANAGEMENT 10. MEDICAL RECORDS SYSTEM

ADVANTAGES OF DATABASE
1. Data Security: Data Security is vital concept in a database. Only authorized users should be allowed to access the
database and their identity should be authenticated using a username and password. Unauthorized users should
not be allowed to access the database under any circumstances as it violates the integrity constraints.
2. Privacy: The privacy rule in a database means only the authorized users can access a database according to its
privacy constraints. There are levels of database access and a user can only view the data he is allowed to. For
example - In social networking sites, access constraints are different for different accounts a user may want to access.
3. Backup and Recovery : Database Management System automatically takes care of backup and recovery. The users
don't need to backup data periodically because this is taken care of by the DBMS. Moreover, it also restores the
database after a crash or system failure to its previous condition.
4. Data Consistency: Data consistency is ensured in a database because there is no data redundancy. All data appears
consistently across the database and the data is same for all the users viewing the database. Moreover, any changes
made to the database are immediately reflected to all the users and there is no data inconsistency.
5. Reducing Data Redundancy: The file based data management systems contained multiple files that were stored in
many different locations in a system or even across multiple systems. Because of this, there were sometimes multiple
copies of the same file which lead to data redundancy. This is prevented in a database as there is a single database
and any change in it is reflected immediately. Because of this, there is no chance of encountering duplicate data.
6. Sharing of Data: In a database, the users of the database can share the data among themselves. There are various
levels of authorization to access the data, and consequently the data can only be shared based on the correct
authorization protocols being followed. Many remote users can also access the database simultaneously and share
the data between themselves.
7. Data Integrity: Data integrity means that the data is accurate and consistent in the database. Data Integrity is very
important as there are multiple databases in a DBMS. All of these databases contain data that is visible to multiple
users. So it is necessary to ensure that the data is correct and consistent in all the databases and for all the users.
VARIOUS LEVELS OF DATABASE
Page 3 of 14 EDUCATION FOR EVERYONE
Mr. Gajendra Sharma CS/IP Mo.NO.: 9810301034
Physical Level (Internal Level ) : This is the lowest level in the three level architecture. It is also known as the internal level. The
physical level describes how data is actually stored in the database. In the lowest level, this data is stored in the external hard
drives in the form of bits and at a little high level, it can be said that the data is stored in files and folders. The physical level
also discusses compression and encryption techniques.
Conceptual Level : The conceptual level is at a higher level than the physical level. It is also known as the logical level. It
describes how the database appears to the users conceptually and the relationships between various data tables. The
conceptual level does not care for how the data in the database is actually stored.
External Level (View Level ): This is the highest level in the three level architecture and closest to the user. It is also known as
the view level. The external level only shows the relevant database content to the users in the form of views and hides the
rest of the data. So different users can see the database as a different view as per their individual requirements.
DIFFERENT DATA MODEL
HIERARCHICAL MODEL : Hierarchical Model was the first DBMS model. This
model organizes the data in the hierarchical tree structure. The hierarchy starts
from the root which has root data and then it expands in the form of a tree
adding child node to the parent node. This model easily represents some of the
real-world relationships like food recipes, sitemap of a website etc.
Example: We can represent the relationship between the shoes present on a
shopping website in the following way:
NETWORK MODEL : This model is an extension of the hierarchical model. It was
the most popular model before the relational model. This model is the same as
the hierarchical model, the only difference is that a record can have more than
one parent. It replaces the hierarchical tree with a graph.
Example: In the example below we can see that node student has two parents
i.e. CSE Department and Library. This was earlier not possible in the hierarchical
model.
RELATIONAL MODEL : Relational Model is the most widely used
model. In this model, the data is maintained in the form of a
two-dimensional table. All the information is stored in the form
of row and columns. The basic structure of a relational model
is tables. So, the tables are also called relations in the relational
model. Example: In this example, we have an Employee table.

DATABASE CONCEPTS OF:

Term Also Known As Description


A structured collection of data organized into rows and
Table Relation
columns.
Number of Rows,
Represents a single row, record, or piece of information in a
Tuple Info, Records,
table.
Cardinality
Cardinality Number of Rows Refers to the total number of rows (tuples) in a table.
Column Name, Field
Attribute Represents a column or field name in a table.
Name, Degree
Degree Number of Attributes Refers to the total number of attributes (columns) in a table.

Key Functions of a DBMS:

Page 4 of 14 EDUCATION FOR EVERYONE


Mr. Gajendra Sharma CS/IP Mo.NO.: 9810301034
1. Data Definition: Helps define the structure of the database, including data types, relationships, and
constraints.
2. Data Storage and Retrieval: Efficiently stores data and provides mechanisms to query and retrieve it.
3. Data Manipulation: Enables updating, inserting, deleting, and modifying data.
4. Data Security: Protects data against unauthorized access.
5. Data Integrity: Ensures the accu racy and consistency of data.
6. Concurrency Control: Manages simultaneous access to the database.
7. Backup and Recovery: Ensures data is recoverable in case of a system failure.
Examples of DBMS software:
 Relational DBMS: MySQL, PostgreSQL, Oracle Database, Microsoft SQL Server.
 NoSQL DBMS: MongoDB, Cassandra, Redis.
 Cloud DBMS: Google BigQuery, Amazon RDS, Microsoft Azure SQL.
Advabtage of DBMS software:
1. Data Redundancy Reduction: Centralized control prevents duplication.
2. Improved Data Sharing: Multiple users can access and update the database simultaneously.
3. Increased Security: Fine-grained access control policies protect sensitive data.
4. Enhanced Data Integrity: Built-in constraints and rules maintain data consistency.
5. Efficient Query Processing: Optimized querying mechanisms retrieve data quickly.

TYPES OF KEYS IN DBMS


1. Primary Key:
o A unique identifier for each row in a table.
o A table can have only one primary key. (if you mearg/join more then 2 tables and create a single
table, if all trable have primary keys then in the final table there is a single primary key)
o The value of a primary key column cannot be NULL (non-nullable) or duplicate.
Example: Table: Students
+--------+------------+
| RollNo | Name |
+--------+------------+
| 101 | Alice |
| 102 | Bob |
| 103 | Charlie |
+--------+------------+ Here, RollNo is the primary key.
2. Candidate Key:
o A set of attributes that can qualify as a unique identifier.(after primary key in a table another
column consider as primary key known as candidate key)
o Every table can have multiple candidate keys.
o One candidate key is chosen as the primary key.
Example: In the Students table, RollNo and Email (if present) could both be candidate keys.
3. Alternate Key: after primary key in table all columns are known as alternate key. Any candidate key that
is not chosen as the primary key.
Example: In the Students table, if RollNo is the primary key, Email (if present) is an alternate key.
4. Foreign Key:An attribute or set of attributes in one table that references the primary key of another table,
It establishes a relationship between two tables.
Example: Table: Students
| RollNo | Name |
+--------+-------+
Table: Grades
+--------+-------+
| RollNo | Grade |
Here, RollNo in the Grades table is a foreign key referencing the RollNo in the Students table.

KEY CONCEPTS IN RELATIONSHIPS


Page 5 of 14 EDUCATION FOR EVERYONE
Mr. Gajendra Sharma CS/IP Mo.NO.: 9810301034
 One-to-One: A key in one table maps to only one record in another table.
 One-to-Many: A primary key in one table is referenced by multiple foreign keys in another table.
 Many-to-Many: Managed using a junction table containing foreign keys from both related tables.
Example 1: Students Table
RollNo (PK) Email AadhaarNumber Name
101 [email protected] 1234-5678-9012 Alice
102 [email protected] 2345-6789-0123 Bob
103 [email protected] 3456-7890-1234 Charlie
Primary Key (PK): RollNo,Candidate Keys: RollNo, Email, AadhaarNumber,Alternate Keys: Email, AadhaarNumber
Example 2: Employees Table
EmpID (PK) PANCard MobileNumber Name
E001 ABCD1234E 9876543210 John
E002 XYZP5678Q 9123456780 Mary
E003 LMNO4321R 8987654321 Paul
Primary Key (PK): EmpID, Candidate Keys: EmpID, PANCard, MobileNumber, Alternate Keys: PANCard,
MobileNumber
Example 3: Products Table
ProductID (PK) Barcode SKU ProductName
P101 8901234567890 ABC123 Laptop
P102 8909876543210 XYZ987 Smartphone
P103 8904567890123 LMN456 Tablet

Primary Key (PK): ProductID Candidate Keys: ProductID, Barcode, SKU Alternate Keys: Barcode, SKU
Key Type Definition Example
RollNo in a Students table uniquely
Primary Key A unique identifier for each row in the table.
identifies each student.
All potential keys that can uniquely identify In a Students table, RollNo and Email
Candidate Key rows. Primary Key is one of the Candidate are Candidate Keys because they can
Keys. uniquely identify students.
Any Candidate Key that is not chosen as the If RollNo is the Primary Key, then
Alternate Key
Primary Key. Email is an Alternate Key.
A key in one table that references the Primary
RollNo in a Grades table refers to
Foreign Key Key in another table to establish a
RollNo in the Students table.
relationship.
Example Table: Students
RollNo (PK) Email (AK) Name
101 [email protected] Alice
102 [email protected] Bob
103 [email protected] Charlie
Primary Key: RollNo Candidate Keys: RollNo, Email Alternate Key: Email (since RollNo is chosen as the
Primary Key) Foreign Key: Not applicable here (requires another table).
Example Table: Grades
GradeID (PK) RollNo (FK) Grade
1 101 A
2 102 B
3 103 A
 Primary Key: GradeID Foreign Key: RollNo (references RollNo in the Students table).
Key Relationships:
o Primary Key vs. Candidate Key:Every Primary Key is a Candidate Key, but not every Candidate Key becomes a
Primary Key.
o Alternate Key:The Candidate Keys that are not chosen as the Primary Key.
o Foreign Key:Establishes relationships between tables by referencing the Primary Key of another table.

Page 6 of 14 EDUCATION FOR EVERYONE


Mr. Gajendra Sharma CS/IP Mo.NO.: 9810301034
https://www.mySQL.com/downloads/
RELATIONAL DATABASE
In relational data model, the data
is organized into tables (i.e., rows
and columns). These tables are
called relations. A row in a table
represents a relationship among a
set of values. Since a table is a
collection of such relationships, it
is generally referred to using the
mathematical term relation, from
which the relational data model
derives its name. In relational
database model all the information is stored on tables, tables also know as relations these tables are divided
into rows and columns. A collection on related tables are called database. A named table in a database is called
relation in relational data model.
•Row in a table is called tuples, and column of a table are called attribute.
•No. Of rows in a table is called cardinality of the table and no. Of columns in a tables in called degree.
Number of columns are know as attribute or degree in a relation | table : 4
Number of rows are know as tuples or cardinality in a relation | table : 6
NEED’S & USE OF DATABASE :
1. Redundancy can be reduced
2. Inconsistence can be avoided
3. Data integrity in maintained
4. Data can be share
5. Security restrictions can be imposed
DEGREE OR ATTRIBUTE OF THE TABLE AND NUMBER OF COLUMNS | FIELDS

THEREFORE, WITH REFERENCE TO THE GIVEN RELATION–STUDENT,


• There are 10 tuples (i.e., cardinality=10) and 4 attributes (i.e., degree=4).
• Roll number, Name, Address and Gender are the attribute names.
• The first tuple contains the values (1, “Rinku Sharma”, “Tilak Nagar”, ‘F’).
• The domain of the attribute Gender is (M, F).

Page 7 of 14 EDUCATION FOR EVERYONE


Mr. Gajendra Sharma CS/IP Mo.NO.: 9810301034
BASIC TERMINOLOGIES RELATED TO A RELATIONAL DATABASE AND TABLES (RELATION)
1. ENTITY: An entity is something that exists and about which we can store some information. It is an object which
can be distinctly identified, for example, student entity, employee entity, item entity, etc. Entity becomes the name
of the table.7
2. ATTRIBUTES/DATA-ITEM (FIELD): In a relational table, an attribute is a set of values of a particular type. The term
attribute is also used to represent a column. A table consists of several records (row) and each record can be
broken into several smaller entities known as fields or attributes or columns. A set of attributes defines the
characteristics or properties of an entity. In the given table, Student relation consists of four fields or attributes—
Roll number, Name, Address and Gender.
3. TUPLE: Each row in a table is known as a tuple. It is also called a row/record. A single entry in a table is called a
Record or Row. A Record in a table represents a set of related data. For example, the Student table, shown in Fig.
7, has 10 records.
4. TABLE/RELATION: A table is a collection of logically related records. In other words, we may say that it is a named
collection of data items which represents a complete unit of information.
5. CARDINALITY OF RELATION: It is the number of records or tuples in the relation. Thus, the cardinality of Student
relation is 10.
6. DEGREE OF RELATION: Number of columns or attributes is known as degree of a relation. Thus, the degree of
Student relation is 4.
7. DOMAIN OF RELATION: It defines the kind of data represented by the attribute. It is the set of all possible values
that an attribute may contain. For example, in the given table Student, domain for the field Gender is two since it
can have either ‘M’ or ‘F’ as the possible and available values that it may contain.
8. BODY OF THE RELATION: It consists of an unordered set of 0 or more tuples.

RELATIONAL DATABASE MODEL


In the Relational Database Model, all information is stored in TABLES. These tables are divided into ROWS AND
COLUMNS. A collection of related tables is called a DATABASE. A named table in a database is called a RELATION
in the RELATIONAL DATA MODEL.
 A ROW in a table is called a TUPLE, and a COLUMN of a table is called an ATTRIBUTE.
 The number of ROWS in a table is called the CARDINALITY of the table, and the number of COLUMNS in a
table is called the DEGREE.

DATABASE KEYS
Keys are a very important part of Relational database. They allow us to identify an attribute or a set of
attributes on the basis of which a table is identified. They are used to establish and identify relation between
two or more tables. They also ensure that each record within a table can be uniquely identified by a
combination of one or more fields within a table.
The different types of keys in an RDBMS are as follows:
KEY DISCRIPTION
Primary Key A primary key is an attribute or a group of attributes that can uniquely identify tuples within the
relation
Candidate Key A candidate key is one that is capable of becoming the primary key (i.e., candidate for the
primary key position).
Alternate Key A candidate key that is not the primary key is called an alternate key.
Primary Key: A primary key is a set of one or more attributes/fields which uniquely identifies a tuple/row in a table.
The salient features of a primary key are as follows:
(a) It is always unique in nature, i.e., non-redundant. It does not have duplicate values in a relation.
(b) It arranges the table in its own order.
(c) It cannot be re-declared or left null.

Page 8 of 14 EDUCATION FOR EVERYONE


Mr. Gajendra Sharma CS/IP Mo.NO.: 9810301034
(d) One table can have only one primary key; however, primary key can be a combination of more than one field,
which is defined as a Composite primary key. For example, roll number along with admission_no can be combined
together to make a primary key in the relation Student. In the context of the table Item given below, Item_id is
the primary key while Supp_id (supplier id) is the primary key in
the table Supplier.

CANDIDATE KEY: All the attributes in a relation that are


candidates or are capable of becoming a primary key are the
candidate keys. In the given table Item, Item_id and Item_name are the candidate keys. Out of these keys,
Item_id is the primary key and Item_name becomes the alternate key. Similarly, in the case of Supplier relation,
Supp_id and Area are the candidate keys, Supp_id is the primary key and Area becomes the alternate key. Thus,
the equation becomes.Candidate Keys – Primary Key = Alternate Key

ALTERNATE KEY: A candidate key that is not 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. For example, in a customer table, cust_name is the alternate key. Similarly, in
the given table Item, Item_name becomes the alternate key. Candidate key = Primary Key + Alternate Key

Primary Key : An attribute or a group of attribute which can distinguish a row uniquely in a table is Called
Primary key/Key Field/Key attribute.

Candidate key : The attributes which are capable to act as a primary key is known as candidate key.

Alternate key : An attribute which can act as a primary key in place of primary key as called alternate key.

Foreign Key : An attribute in it’s present table whose values are derived from some other table, is called
foreign key in the present table.

Page 9 of 14 EDUCATION FOR EVERYONE


Mr. Gajendra Sharma CS/IP Mo.NO.: 9810301034
RELATIONAL ALGEBRA: SELECTION, PROJECTION, UNION, SET DIFFERENCE AND CARTESIAN PRODUCT
Relational algebra is a procedural query language, which takes instances of relations as input and yields instances of
relations as output. It uses operators to perform queries. An operator can be either unary or binary. They accept
relations as their input and yield relations as their output. Relational algebra is performed recursively on a relation
and intermediate results are also considered relations.
The fundamental operations of relational algebra are as follows −
1. Select σ 4. Union ∪
2. Project ∏ 5. Set different
3. Cartesian product X 6. Set Intersection
SELECT OPERATION (σ): It selects tuples that satisfy the given predicate from a relation.
Notation − σp(r)
Where σ stands for selection predicate and r stands for relation. p is prepositional logic formula which may
use connectors like and, or, and not. These terms may use relational operators like − =, ≠, ≥, < , >, ≤.
For example − σsubject = "database"(Books)
Project Operation (∏): It projects column(s) that satisfy a given predicate.
Notation − ∏A1, A2, An (r)
Where A1, A2 , An are attribute names of relation r.
Duplicate rows are automatically eliminated, as relation is a set.
For example − ∏subject, author (Books)
Cartesian Product (Χ) : Combines information of two different relations into one.
Notation − r Χ s (No. of rows are r Χ r, No. of Columns are c + c)
Where r and s are relations and their output will be defined as −r Χ s = { q t | q ∈ r and t ∈ s}
σauthor = 'tutorialspoint'(Books Χ Articles)
The Cartesian Product of two sets can be easily represented in the form of a matrix where both sets are on
either axis, as shown in the image below.
Cartesian Product of : A = {1, 2} and B = {x, y, z}
EXAMPLE:
A = {1, 2} , B = {a, b}
A × B = {(1, a), (1, b), (2, a), (2, b)}
B × A = {(a, 1), (b, 1), (b, 1), (b, 2)}
Therefore as A ≠ B we have A × B ≠ B × A
Union: A union of two relations (R1 U R2) can only be performed if the two relations are union compatible. This
essentially means that both relations have the exact same attributes. A union combines the rows of the two
relations and outputs a new relation that has both input relations’ rows in it. Suppose, taking the example table
above, we want to union with this new table below:
Set Difference: The set difference between two sets A and B, denoted as A−B or A∖B, is the set of elements that
are in A but not in B.
Example:
Let A={1,2,3,4}
A={1,2,3,4} and B={3,4,5,6}.
Then, A−B={1,2} because 1 and 2 are in A but not in B.
Cartesian Product: The Cartesian product of two sets A and B, denoted as A×B, is the set of all ordered pairs where
the first element is from A and the second element is from B.
Example: Let A={x,y} and B={1,2}.
Then, A×B={(x,1),(x,2),(y,1),(y,2)}. Each element of A is paired with each element of B to form the ordered
pairs.

Page 10 of 14 EDUCATION FOR EVERYONE


Mr. Gajendra Sharma CS/IP Mo.NO.: 9810301034
CARDINALITY OR ROW IN A TABLE IS CALLED TUPLES
Q1. : Define degree and cardinality. Also, Based upon given table write degree and cardinality.

Answer:
Degree is the number of attributes or columns present in a table. Cardinality is the number of tuples or
rows present in a table.
Patients Degree = 4 Cardinality = 5
Q2. Observe the following table and SQL> the parts (i) and (ii):

1. In the above table, can we have Qty as primary key.


2. What is the cardinality and degree of the above table?
SQL> :
1. We cannot use Qty as primary key because there is a duplication of values and primary key value cannot
be duplicate.
2. Degree =4, Cardinality = 5
Q3. Observe the following PARTICIPANTS and EVENTS table carefully and write the name of the RDBMS operation
which will be used to produce the output as shown in RESULT? Also, find the Degree and Cardinality of the RESULT.

SQL> :
CARTESIAN PRODUCT
Degree : 4 (PARTICIPANTS ATTRIBUTE + EVENTS * ATTRIBUTE)
2+2 (COMMAN ONLY FOR ONCE)
Cardinality : 6 (PARTICIPANTS TUPLES *EVENTS *TUPLES) 3*2=6
DBMS MULTIPLE-CHOICE QUESTIONS (MCQS)
Page 11 of 14 EDUCATION FOR EVERYONE
Mr. Gajendra Sharma CS/IP Mo.NO.: 9810301034
1. What is a database? 15. What is the domain of an attribute?
a) A collection of tables a) The total number of rows in a table
b) A collection of related data b) The set of all possible values an attribute can take
c) A collection of files c) The set of all primary keys in a table
d) A single file storing all records d) The total number of attributes in a table
2. What is the need for a database? 16. Which of the following is NOT a characteristic of
a) To store data permanently a primary key?
b) To reduce redundancy a) It must be unique
c) To allow data sharing d) All of the above b) It can have NULL values
3. Which of the following is an example of a Database c) It must uniquely identify a record
Management System (DBMS)? d) It is selected from candidate keys
a) MS Word b) MS Excel 17. Which of the following is a valid example of a
c) MySQL d) Google Chrome primary key?
4. What does RDBMS stand for? a) A student's roll number b) A student's age
a) Rational Database Management System c) A student's height d) A student's weight
b) Relational Database Management System 18. In a relational database, a relation is a:
c) Relevant Data-Based Management Software a) Table b) Column c) Row d) Data type
d) Remote Database Management System 19. Which key is used to establish a connection
5. In a relational database, a table is also called a: between two tables?
a) Relation b) Tuple c) Attribute d) Domain a) Primary key b) Candidate key
6. A row in a relational table is called: c) Foreign key d) Composite key
a) Relation b) Attribute c) Tuple d) Domain 20. The process of dividing a large table into multiple
7. A column in a relational table is called: smaller tables to reduce redundancy is called:
a) Relation b) Attribute c) Tuple d) Domain a) Normalization b) Indexing
8. The total number of rows in a table is called: c) Aggregation d) Query Processing
a) Degree b) Cardinality c) Domain d) Relation 21. Which of the following keys can contain NULL
9. The total number of columns in a table is called: values?
a) Degree b) Cardinality c) Domain d) Attribute a) Primary key b) Candidate key
10. A candidate key is: c) Foreign key d) Alternate key
a) A key that can uniquely identify each record in a table 22. A composite key is a key that:
b) A key that is selected as the primary key a) Consists of multiple attributes
c) A key that cannot be used as a primary key b) Is a candidate key c) Contains only numeric values
d) A key that contains duplicate values d) Is used in indexing
11. A primary key: 23. What is the main purpose of a database?
a) Can have NULL values a) To store large amounts of data in a structured manner
b) Can have duplicate values b) To process data faster than a spreadsheet
c) Is a candidate key selected to uniquely identify c) To create graphical reports
records d) To execute programming languages
d) Is a combination of all attributes 24. What is the difference between a relational
12. An alternate key is: database and a non-relational database?
a) Another name for a primary key a) Relational databases use structured tables, non-
b) A candidate key that is not selected as the primary relational databases use flexible data models
key b) Relational databases are faster than non-relational
c) A key that contains duplicate values databases
d) A key used for foreign key reference c) Relational databases do not use keys, non-relational
13. A foreign key is used to: databases do
a) Identify records uniquely in the same table d) Non-relational databases are always preferred over
b) Establish a relationship between two tables relational databases
c) Perform calculations on data 25. Which SQL statement is used to define a primary
d) Sort data key?
14. A foreign key references: a) ALTER TABLE ADD PRIMARY KEY
a) A primary key in the same table b) DEFINE PRIMARY KEY
b) A primary key in another table c) SET PRIMARY KEY
c) A unique key in the same table d) CREATE PRIMARY KEY
d) A candidate key in another table
DBMS True/False statements
Page 12 of 14 EDUCATION FOR EVERYONE
Mr. Gajendra Sharma CS/IP Mo.NO.: 9810301034
1. A database is a structured collection of related data.
2. A database is required only for large-scale applications.
3. A relational database organizes data in the form of tables.
4. In a relational model, a table is also called a relation.
5. A tuple in a relational database refers to a column in a table.
6. An attribute in a relational database is a column in a table.
7. The domain of an attribute defines the set of all possible values it can take.
8. The total number of rows in a table is called the degree of the table.
9. The total number of columns in a table is called its cardinality.
10. A primary key can have duplicate values.
11. A candidate key is a set of one or more attributes that can uniquely identify a record.
12. A table can have multiple candidate keys.
13. A primary key is a candidate key that is selected to uniquely identify records in a table.
14. An alternate key is a candidate key that has been chosen as the primary key.
15. A foreign key is used to establish relationships between two tables.
16. A foreign key must always refer to a primary key in another table.
17. A foreign key can contain NULL values.
18. A primary key can have NULL values.
19. The domain of an attribute is the total number of attributes in a table.
20. The relational data model is based on the concept of records and pointers.
21. A table can have only one primary key.
22. A database management system (DBMS) is software used to create and manage databases.
23. A relational database does not support relationships between tables.
24. The process of organizing data to reduce redundancy is called normalization.
25. A single attribute can be part of multiple candidate keys in a table.

DBMS ONE-WORD ANSWER QUESTIONS


1. What is a structured collection of related data called?
2. What is another name for a table in a relational database?
3. What do we call a row in a relational database table?
4. What is a column in a relational database table called?
5. What defines the set of all possible values an attribute can take?
6. What term refers to the total number of columns in a table?
7. What term refers to the total number of rows in a table?
8. What is a unique identifier for each record in a table?
9. What type of key can be selected as a primary key?
10. What do we call a candidate key that is not chosen as the primary key?
11. What key is used to establish a relationship between two tables?
12. What key refers to the primary key of another table?
13. What is the process of reducing redundancy in a database called?
14. What is the term for ensuring data accuracy and consistency?
15. What constraint ensures that the primary key cannot have null values?
16. What constraint ensures that a foreign key must match a primary key in another table?
17. What do we call a set of attributes that uniquely identify a record?
18. What type of key consists of multiple attributes?
19. What term refers to the duplication of data in a database?
20. What do we call the overall structure of a database?
21. What technique is used to speed up data retrieval in a database?
22. What is the smallest unit of data storage in a relational database?
23. What is the language used to interact with relational databases?
24. What ensures that a database follows a predefined structure?
25. What kind of database organizes data in tabular form with relationships?

MCQ Answers:
Page 13 of 14 EDUCATION FOR EVERYONE
Mr. Gajendra Sharma CS/IP Mo.NO.: 9810301034
1. b) A collection of related data , a) A collection 13. b) Establish a relationship between two tables
of tables 14. b) A primary key in another table
2. d) All of the above 15. b) The set of all possible values an attribute can
3. c) MySQL take
4. b) Relational Database Management System 16. b) It can have NULL values
5. a) Relation 17. a) A student's roll number
6. c) Tuple 18. a) Table
7. b) Attribute 19. c) Foreign key
8. b) Cardinality 20. a) Normalization
9. a) Degree 21. c) Foreign key
10. a) A key that can uniquely identify each record 22. a) Consists of multiple attributes
in a table 23. a) To store large amounts of data in a
11. c) Is a candidate key selected to uniquely structured manner
identify records 24. a) Relational databases use structured tables,
12. b) A candidate key that is not selected as the non-relational databases use flexible data models
primary key 25. a) ALTER TABLE ADD PRIMARY KEY

TRUE FALSE Answers:


1. True 6. True 11. True 16. True 21. True
2. False 7. True 12. True 17. True 22. True
3. True 8. False 13. True 18. False 23. False
4. True 9. False 14. False 19. False 24. True
5. False 10. False 15. True 20. False 25. True

ONE WORD Answer:

1. Database
2. Relation 10. Alternate Key 18. Composite Key
3. Tuple 11. Foreign Key 19. Redundancy
4. Attribute 12. Foreign Key 20. Schema
5. Domain 13. Normalization 21. Indexing
6. Degree 14. Data Integrity 22. Tuple
7. Cardinality 15. Not Null 23. SQL
8. Primary Key 16. Referential Integrity 24. Constraints
9. Candidate Key 17. Candidate Key 25. Relational Database

Page 14 of 14 EDUCATION FOR EVERYONE

You might also like