DBMS Answers Question Bank Ch01 PDF
DBMS Answers Question Bank Ch01 PDF
Strong Entity:
A strong entity is not dependent on any other entity in the schema. A strong entity
will always have a primary key. Strong entities are represented by a single
rectangle. The relationship of two strong entities is represented by a single
diamond.
Weak Entity:
A weak entity is dependent on a strong entity to ensure its existence. Unlike a
strong entity, a weak entity does not have any primary key. It instead has a partial
discriminator key. A weak entity is represented by a double rectangle.
The relation between one strong and one weak entity is represented by a double
diamond. This relationship is also known as identifying relationship.
Example : A loan entity can not be created for a customer if the customer doesn’t
exist
Number of It contains mainly two layers- It mainly contains three layers- the
Layers the Data Tier (Database Tier), Data Layer, the Business Layer, and
and the Client Tier. the Client Layer.
4) Write the difference between logical data independence and physical data
independence.
Physical Data Independence Logical Data Independence
It mainly concern about how the data It mainly concerned about the structure
is stored into the system. or the changing data definition.
Suppose that one of the bank officers needs to find out the names of all customers
who live within a particular postal-code area. The officer asks the data-processing
department to generate such a list. Because the designers of the original system did
not anticipate this request, there is no application program on hand to meet it. The
bank officer has now two choices: either obtain the list of all customers and extract
the needed information manually or ask a system programmer to write the
necessary application program. Both alternatives are obviously unsatisfactory.
The conventional file-processing environments do not allow needed data to be
retrieved in a convenient and efficient manner. More responsive data-retrieval
systems are required for general use.
3. Data isolation.
Because data are scattered in various files, and files may be in different formats,
writing new application programs to retrieve the appropriate data is difficult.
4. Integrity problems.
The data values stored in the database must satisfy certain types of consistency
constraints. For example, the balance of a bank account may never fall below a
prescribed amount (say, $25). Developers enforce these constraints in the system
by adding appropriate code in the various application programs. However, when
new constraints are added, it is difficult to change the programs to enforce them.
5. Atomicity problems.
For the sake of overall performance of the system and faster response, many
systems allow multiple users to update the data simultaneously. In such an
environment, interaction of concurrent updates may result in inconsistent data.
7. Security problems.
Not every user of the database system should be able to access all the data. For
example, in a banking system, payroll personnel need to see only that part of the
database that has information about the various bank employees. They do not need
access to information about customer accounts.
The above ER diagram illustrates key information about bank, including entities
such as branches, customers, accounts, and loans. It allows us to understand the
relationships between entities.
Entities and their Attributes are :
Bank Entity : Attributes of Bank Entity are Bank Name, Code and Address.
Code is Primary Key for Bank Entity.
Customer Entity : Attributes of Customer Entity are Customer_id, Name,
Phone Number and Address.
Customer_id is Primary Key for Customer Entity.
Branch Entity : Attributes of Branch Entity are Branch_id, Name and
Address.
Branch_id is Primary Key for Branch Entity.
Account Entity : Attributes of Account Entity are Account_number,
Account_Type and Balance.
Account_number is Primary Key for Account Entity.
Loan Entity : Attributes of Loan Entity are Loan_id, Loan_Type and
Amount.
Loan_id is Primary Key for Loan Entity.
Relationships are :
3.System Analyst :
System Analyst is a user who analyzes the requirements of parametric end users.
They check whether all the requirements of end users are satisfied.
The BETWEEN operator in SQL is used to retrieve data from a table within a
specific range of values. It is a logical operator that combines the >= (greater than
or equal to) and <= (less than or equal to) operators.
SELECT column_name(s)
FROM table_name
WHERE column_name BETWEEN value1 AND value2;
IN Operator
The IN operator allows you to specify multiple values in a WHERE clause.
IN Syntax
SELECT column_name(s)
FROM table_name
WHERE column_name IN (value1, value2, ...);
The following SQL statement selects all customers that are located in "Germany",
"France" or "UK":
IN Operator in SUBQuery
The IN operator in SQL is used to check if a value matches any value in a list or a
subquery. It is a logical operator that can be used in the WHERE clause of a
SELECT statement.
SELECT column_name(s)
FROM table_name
WHERE column_name IN (SELECT STATEMENT);
The following SQL statement selects all customers that are from the same
countries as the suppliers: