Assignment - 01dbms
Assignment - 01dbms
1). Explain the difference between external, internal, and conceptual schemas. How are these different
schema layers related to the concepts of logical and physical data independence?
Ans:- External Schema represents data accessed by end-users or application programs, it provides
customized information to the end-users.
Conceptual Schema is a high-level description of a business's informational needs which represent the
logical , how data is stored in a database is represented by conceptual schema. Conceptual schema
provides information to the external schema which is customized and is accessed by application
programs.
Internal Schema: - is a very low-level representation of the entire database which represents the
physical storage of data on a disk or a physical storage device. Conceptual schema maps internal schema
data to the external schema.
2). Translate ER diagram given below to Relational tables (You have to mention the relational schemas
and key constraints only).
b).A database view is a searchable object in a database that is defined by a query. Though a view doesn't
store data, some refer to a views as “virtual tables,” you can query a view like you can a table. A view
can combine data from two or more table, using joins, and also just contain a subset of information.
c).Constraints are the rules enforced on the data columns of a table. These are used to limit the type of
data that can go into a table. This ensures the accuracy and reliability of the data in the database.
Following are some of the most commonly used constraints available in SQL:
NOT NULL constraint:− Ensures that a column cannot have NULL value.
DEFAULT constraint: − Provides a default value for a column when none is specified.
UNIQUE constraint:− Ensures that all values in a column are different.
PRIMARY key :− Uniquely identifies each row/record in a database table.
FOREIGN key:− Uniquely identifies a row/record in any of the given database table.
CHECK key:− The CHECK constraint ensures that all the values in a column satisfies certain
conditions.
INDEX:− Used to create and retrieve data from the database very quickly.
Dropping Constraints:Any constraint that you have defined can be dropped using the ALTER
TABLE command with the DROP CONSTRAINT option.
Integrity Constraints:--Integrity constraints are used to ensure accuracy and consistency of the
data in a relational database. Data integrity is handled in a relational database through the
concept of referential integrity.
d). Weak Entities: A weak entity is an entity that cannot be uniquely identified by its attributes alone;
therefore, it must use a foreign key in conjunction with its attributes to create a primary key. The foreign
key is typically a primary key of an entity it is related to.
Ans: AGGREGATION:
An aggregation tree is composed of object instances that are all part of a composite object.
"part-of relationship".
GENERALIZATION:
FILE SYSTEM:
A file system is a software that manages and organizes the files in a storage medium. It controls
how data is stored and retrieved.
The file system provides the details of data representation and storage of data.
Storing and retrieving of data can't be done efficiently in a file system.
It does not offer data recovery processes.
The file system doesn't have a crash recovery mechanism.
Protecting a file system is very difficult.
In a file management system, the redundancy of data is greater.
Data inconsistency is higher in the file system.
The file system offers lesser security.
File System allows you to stores the data as isolated data files and entities.
DBMS :
5). Construct an E-R diagram for a hospital with a set of patients and a set of medical doctors. Associate
with each patient a log of the various tests and examinations conducted.
Ans:- ACID Properties: A transaction is a very small unit of a program and it may contain several lowlevel
tasks. A transaction in a database system must maintain Atomicity, Consistency, Isolation, and Durability
− commonly known as ACID properties − in order to ensure accuracy, completeness, and data integrity.
Atomicity − This property states that a transaction must be treated as an atomic unit, that is, either all of
its operations are executed or none. There must be no state in a database where a transaction is left
partially completed. States should be defined either before the execution of the transaction or after the
execution/abortion/failure of the transaction.
Consistency − The database must remain in a consistent state after any transaction. No transaction
should have any adverse effect on the data residing in the database. If the database was in a consistent
state before the execution of a transaction, it must remain consistent after the execution of the
transaction as well.
Durability − The database should be durable enough to hold all its latest updates even if the system fails
or restarts. If a transaction updates a chunk of data in a database and commits, then the database will
hold the modified data. If a transaction commits but the system fails before the data could be written on
to the disk, then that data will be updated once the system springs back into action.
Isolation − In a database system where more than one transaction are being executed simultaneously
and in parallel, the property of isolation states that all the transactions will be carried out and executed
as if it is the only transaction in the system. No transaction will affect the existence of any other
transaction.
A->BC
B ->E
CD ->EF