0% found this document useful (0 votes)
34 views

DMS Question Bank ANS

Uploaded by

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

DMS Question Bank ANS

Uploaded by

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

DMS QUESTION BANK

1. Define Tuple, Relation, Entity, Attribute, Domain


1. Tuple: A tuple is a single row or record in a database table,
representing a set of related data. It is an ordered list of elements,
where each element corresponds to an attribute in the relation.
2. Relation: A relation is a table in a database. It consists of rows
(tuples) and columns (attributes). Each relation represents a
specific entity set, and the table's structure is defined by its
attributes.
3. Entity: An entity is a real-world object or concept that can be
distinctly identified. In a database, an entity is represented by a
table, where each row corresponds to a specific instance of that
entity.
4. Attribute: An attribute is a property or characteristic of an
entity. In a database table, attributes are represented as columns,
where each column holds the values for a specific property of the
entity.
5. Domain: A domain is the set of all possible values that an
attribute can have. It defines the data type and constraints for a
particular attribute in a database, such as integers, strings, or dates.

2. Define i) Schema ii) Instance


1. Schema: A schema is the blueprint or structure of a database. It
defines how the data is organized, including the tables, columns,
data types, and relationships between tables. Think of it as the
overall design of the database.
2. Instance: An instance refers to the actual data stored in the
database at a particular moment. It's the collection of all records (or
rows) in the tables according to the schema. If the schema is the
plan, the instance is the current state of the data based on that plan.
3. Difference between Strong entity set and Weak entity set

4. Define Candidate Key and Super Key


- Candidate Key: A candidate key is a minimal set of attributes
that can uniquely identify a tuple (row) in a relation (table). It is a
potential primary key, meaning no subset of its attributes can
uniquely identify a tuple.
-Super Key: A super key is a set of one or more attributes that can
uniquely identify a tuple in a relation. It may contain additional
attributes that are not necessary for unique identification.

5. List set operators in SQL


1. UNION: Combines the results of two queries, returning all
unique rows from both queries.
2. UNION ALL: Similar to UNION, but includes all rows,
including duplicates, from both queries.
3. INTERSECT: Returns only the rows that are common to both
queries.
4. EXCEPT (or MINUS): Returns the rows from the first query
that are not present in the second query.
6. Write down any 4 symbols used for ER Diagram

7. Define Primary Key and Unique Key with example


A Primary Key is a unique identifier for each record in a database
table. It ensures that no two records have the same value in that
field. For example, in a student table, "StudentID" could be the
primary key.
A Unique Key also ensures that all values in a column are unique,
but unlike the primary key, it can be null. For example, "Email" in
a user table could be a unique key.

8. List any 4 String functions in SQL.


1. LEN(): Returns the length of a string, counting the number of
characters. For example, `LEN('Hello')` returns 5.
2. UPPER(): Converts all characters in a string to uppercase. For
instance, `UPPER('hello')` becomes 'HELLO'.
3. LOWER(): Converts all characters in a string to lowercase. For
example, `LOWER('HELLO')` becomes 'hello'.
4. SUBSTRING(): Extracts a portion of a string based on the
starting position and length. For instance, SUBSTRING('Hello', 2,
3) returns 'ell'.
9. Write Syntax and example of CREATE command.
Syntax for `CREATE` Command:
CREATE TABLE table_name (
column1 datatype [constraint],
column2 datatype [constraint],
...
);
Example:
CREATE TABLE Employees (
EmployeeID NUMBER PRIMARY KEY,
FirstName VARCHAR2(50) NOT NULL,
LastName VARCHAR2(50) NOT NULL,
HireDate DATE,
Salary NUMBER(10, 2)
);

10. Write Syntax and example of DELETE command.


Syntax of `DELETE` Command in Oracle DBMS:
DELETE FROM table_name
WHERE condition;
Example:
DELETE FROM Employees
WHERE EmployeeID = 101;

11. . Enlist any 4 Applications of Database Management System


1. Banking: DBMS is used to manage customer accounts,
transactions, and loans, ensuring secure and accurate handling of
financial data.
2. Healthcare: Hospitals use DBMS to store patient records,
treatment history, and billing information, making it easy to access
and update patient data.
3. E-commerce: Online stores rely on DBMS to manage product
inventories, customer orders, and payment processing, ensuring
smooth shopping experiences.
4. Education: Schools and universities use DBMS to manage
student information, course registrations, grades, and schedules,
helping streamline academic operations.
12. Explain 2 DCL commands in SQL
1. GRANT:
- Purpose: Gives specific privileges (permissions) to users or
roles, allowing them to perform certain actions on the database,
like accessing tables or executing procedures.
- Example:
GRANT SELECT ON Employees TO User1;
This command allows `User1` to use the `SELECT` statement on
the `Employees` table, letting them view the data.
2. REVOKE:
- Purpose: Removes previously granted privileges from users or
roles, preventing them from performing certain actions on the
database.
- Example:
REVOKE SELECT ON Employees FROM User1;
This command takes away the `SELECT` permission from
`User1`, so they can no longer view data in the `Employees` table.

13. Difference between Hierarchical, Network, Relational model.


14. Explain Data Abstraction and its different Levels
Data abstraction in databases is the process of hiding the complex
details of the database structure and presenting only the essential
features to users. It helps in simplifying the interaction with the
database and ensures that users and applications work with a
simplified view of the data. There are three main levels of data
abstraction:
1. Physical Level:
- What It Is: The lowest level that deals with how data is
physically stored on disk. It involves the organization of files and
indexing techniques.
- Example: How data is stored in files or how it is organized to
optimize access speed.
2. Logical Level:
- What It Is: The middle level that represents the structure of the
entire database in terms of tables, relationships, and constraints,
without focusing on physical storage.
- Example: The design of tables, columns, and relationships
among them, like how an `Employees` table relates to a
`Departments` table.
3. View Level:
- What It Is: The highest level that provides users with different
views of the data. Each user can see the data that is relevant to
them without needing to know the underlying database structure.
- Example: A view that shows only employee names and job
titles, hiding other details like salaries or addresses.
These levels help in managing complexity, improving security,
and making database management more efficient.

15. Explain any 4 rules of E.F Codd


1. Information Rule:
- What It Is: All data should be stored in tables (relations), and
every piece of data should be stored in a column.
- Example: Employee names, IDs, and salaries should all be in
columns within a table.
2. Guaranteed Access Rule:
- What It Is: Every piece of data should be accessible using a
combination of table names, column names, and row identifiers.
- Example: You can access an employee's salary by specifying
the employee table, the salary column, and the row for that specific
employee.
3. Systematic Treatment of Null Values:
- What It Is: The database should handle missing or undefined
data values uniformly, treating them as distinct from other data
values.
- Example: If a student’s phone number is unknown, the system
should recognize and handle this as a null value.
4. Dynamic On-line Catalog Based on the Relational Model:
- What It Is: The database should have a catalog (metadata) that
is itself stored in tables and accessible using the same methods as
other data.
- Example: Information about tables and columns should be
stored in tables, so you can query the database to find out about its
structure.

16. Explain drawbacks of File Processing system


1. Data Redundancy:
- What It Is: Data is often duplicated across multiple files,
leading to inconsistencies.
- Example: Customer details might be stored in different files for
sales and support, causing updates to be missed in one file.
2. Data Inconsistency:
- What It Is: Different files may have conflicting data, making it
hard to trust the information.
- Example: If a customer's address changes, but it's updated in
only one file, records become inconsistent.
3. Limited Data Sharing:
- What It Is: Sharing data between files or departments is difficult
and inefficient.
- Example: Sales and accounting departments may struggle to
access and synchronize customer data from separate files.
4. Complexity in Data Retrieval:
- What It Is: Searching for specific information requires manual
processes or complex programming.
- Example: Finding a specific transaction in a large file may
require extensive searching and filtering.
17. Explain foreign key with example
A foreign key is a column or a set of columns in one table that
uniquely identifies a row in another table. It establishes a
relationship between two tables, ensuring data consistency.
Example:
Suppose you have two tables:
1. Customers:
- Columns: `CustomerID`, `CustomerName`
- Data:
- `1, John Doe`
- `2, Jane Smith`
2. Orders:
- Columns: `OrderID`, `OrderDate`, `CustomerID`
- Data:
- `1001, 2024-08-27, 1`
- `1002, 2024-08-28, 2`
In this example, `CustomerID` in the `Orders` table is a foreign
key. It links to the `CustomerID` in the `Customers` table, showing
which customer placed each order. This helps ensure that every
order is associated with a valid customer.

18. Draw ER diagram for College Management System


19. Explain any 2 DML commands with syntax and example
1. INSERT:
- Purpose: Adds new records to a table.
- Syntax:
INSERT INTO table_name (column1, column2, ...)
VALUES (value1, value2, ...);
-Example:
INSERT INTO Employees (EmployeeID, FirstName, LastName,
HireDate, Salary)
VALUES (101, 'Alice', 'Johnson', '2024-08-27', 60000);
This command adds a new employee record with ID `101`, first
name `Alice`, last name `Johnson`, hire date `2024-08-27`, and
salary `60000` to the `Employees` table.
2. UPDATE:
- Purpose: Modifies existing records in a table.
- Syntax:
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;
- Example:
UPDATE Employees
SET Salary = 65000
WHERE EmployeeID = 101;
This command updates the salary of the employee with ID `101`
to `65000` in the `Employees` table.

20. Draw ER diagram for Bank Management System


21. Explain TCL commands with example
1. COMMIT:
- Purpose: Saves all changes made during the current transaction
permanently in the database.
- Example:
COMMIT;
After executing `COMMIT`, all changes made by `INSERT`,
`UPDATE`, or `DELETE` commands are saved, and other users
can see these changes.
2. ROLLBACK:
- Purpose: Undoes all changes made during the current
transaction, reverting the database to its previous state.
- Example:
ROLLBACK;
If you use `ROLLBACK`, any changes made since the last
`COMMIT` are undone, and the database is restored to the state it
was in before the transaction began.
3. SAVEPOINT:
- Purpose: Creates a point within a transaction to which you can
later roll back.
- Example:
SAVEPOINT sp1;
You can later use `ROLLBACK TO sp1` to undo changes made
after the `SAVEPOINT sp1` was set, without affecting changes
made before it.

22. Explain Data Independence and its types


Data Independence refers to the ability to change the structure of a
database without affecting the way data is accessed or manipulated
by applications. It helps ensure that modifications to the database
schema do not require changes to applications using the data.
There are two main types of data independence:
1. Logical Data Independence:
- What It Is: The capacity to change the logical (conceptual)
structure of the database (like adding or modifying tables) without
affecting the application programs that use the data.
- Example: You can add a new column to a table without needing
to rewrite queries or programs that access the table.
2. Physical Data Independence:
- What It Is: The ability to change the physical storage of the data
(like moving data to different storage devices or changing indexing
methods) without affecting the logical structure or the way users
interact with the data.
- Example: You can reorganize how data is stored on disk to
improve performance without changing how the data is accessed
through queries.

23. Draw ER diagram for Hospital Management System

24. Explain Relational data model.


The Relational Data Model is a way of organizing data into tables
(also called relations) that are related to each other. Here’s a simple
explanation:
1. Tables:
- What They Are: Data is stored in tables, which look like
spreadsheets with rows and columns.
- Example: A table called `Employees` might have columns for
`EmployeeID`, `FirstName`, `LastName`, and `Department`.
2. Rows:
- What They Are: Each row in a table represents a single record
or entry.
- Example: A row in the `Employees` table could represent one
employee, with their specific `EmployeeID`, `FirstName`,
`LastName`, and `Department`.

3. Columns:
- What They Are: Each column in a table represents a field or
attribute of the data.
- Example: The `EmployeeID` column holds unique IDs for each
employee, and the `FirstName` column holds their first names.
4. Relationships:
- What They Are: Tables can be related to each other through
common columns, often using keys.
- Example: A `Departments` table might be related to the
`Employees` table through a `DepartmentID` column, linking
employees to their respective departments.
5. Keys:
- What They Are: Keys are special columns used to identify
records uniquely or to establish relationships between tables.
- Example: The `EmployeeID` is a primary key in the
`Employees` table, and it might be used as a foreign key in another
table to link data.

25. Difference between File system and Database Management System.

26. Explain Attributes in ER model with its Types


In the Entity-Relationship (ER) model, attributes are properties or
characteristics that describe entities. Each attribute holds specific
information about an entity.
Types of Attributes:
1. Simple Attribute:
- What It Is: An attribute that cannot be divided further into
smaller parts.
- Example: `FirstName` in an `Employees` table, which holds
just a single piece of information: the employee's first name.
2. Composite Attribute:
- What It Is: An attribute that can be divided into smaller,
meaningful parts.
- Example: `Address` can be divided into `Street`, `City`, `State`,
and `ZipCode`.
3. Derived Attribute:
- What It Is: An attribute whose value can be derived from other
attributes.
- Example: `Age` can be derived from the `DateOfBirth`
attribute.
4. Multi-valued Attribute:
- What It Is: An attribute that can have multiple values for a
single entity.
- Example: `PhoneNumbers` for an employee, where an
employee might have more than one phone number.

27. Explain overall structure of DBMS.


1. Database:
- Description: This is the core part where all the data is stored. It
consists of tables (relations) that hold data in rows and columns.
2. Database Management System (DBMS):
- Description: This is the software that manages the database. It
provides tools for data storage, retrieval, manipulation, and
management. It ensures data integrity and security.
3. Database Schema:
- Description: This is the design or blueprint of the database,
defining the structure, including tables, columns, data types, and
relationships.

4. Query Processor:
- Description: This component interprets and executes SQL
queries. It translates user queries into commands that interact with
the database.
5. Transaction Manager:
- Description: This ensures that database transactions (like insert,
update, delete) are processed reliably and adhere to the ACID
properties (Atomicity, Consistency, Isolation, Durability).
6. Storage Manager:
- Description: This component manages how data is stored on
disk. It handles data storage, retrieval, and indexing.
7. Database Administrator (DBA):
- Description: This role involves managing and maintaining the
database, including user permissions, performance tuning, and
backup.
8. User Interface:
- Description: This is the interface through which users interact
with the database, typically via SQL commands or a graphical user
interface (GUI).

28. Describe 2 tier architecture.


Two-tier architecture is a client-server model used in database
systems where the application is divided into two layers:
1. Client Tier (Presentation Layer):
- Description: This is the user interface where end-users interact
with the application. It handles user inputs and displays results.
- Example: A desktop application or web browser that allows
users to input data and view information.
2. Server Tier (Database Layer):
- Description: This tier consists of the database server where data
is stored, processed, and managed. It handles requests from the
client tier, executes queries, and returns results.
- Example: A database management system (DBMS) like
MySQL or Oracle that processes queries and manages data.

You might also like