DBMS
DBMS
Describe the Advantages and Disadvantages of DAMS01 Explain DBMS What are Advantages and Disadvantages of
DBMS? Dr Define Database Explain the Feature of Effective DBMS with Pros and ConsAns Database Management System (DBMS) is a software aloning and retrieving
users data while considering appropriate wity measures It consists of a group of programs which manipulate Satabase The DBMS accepts the request for data from an
application and instructs th operating system to provide the specific sata in large systems, a DBMS helps users and other third-party tware to store and retrieve
dataDSMS allows users to create their own databases as per ther quement The term "DBMS Includes the user of the database and other application programs It provides
an interface between the and the software applicationCompared to the File Based Data Management System, DatabaseManagement System has many advantages
Some of these advantagese given belowAdvantage of DBMS :-(1) Improved Data Sharing :-(a) The DBMS helps create an environment in which end users have better
access to more and better systems are implemented(ii) Management Complexity :- (a) Database systems interface with many different technologies and have a
significant impact on a company's resources and culture(b) The changes introduced by the adoption of a database system must be properly managed to ensure that they
help advance the company's objectives Given the fact that database systems hold crucial company data that are accessed from multiple sources, security issues mustbe
assessed constantly Maintaining Currency :-(a) To maximize the efficiency of the database system, you must keep your system current(b) Therefore, you must perform
frequent updates and apply the latest patches and security measures to all components (c) Because database technology advances rapidly, personneltraining costs tend
to be significant Vendor dependence (d) Given the heavy investment in technology and personnel training, companies might be reluctant to change database vendors(iv)
Frequent Upgrade/Replacement Cycles :- (a) DBMS vendors frequently upgrade their products byadding new functionality Such new features often come bundled in new
upgrade versions of the software(b) Some of these versions require hardware upgrades Not only do the upgrades themselves cost money, but it also costs money to
train database users and administrators to properly use and manage the new featuresQ2 Briefly explain the Different Types of DBMS Ans There are Four Types of DBMS
Systems -(i) Hierarchical DBMS: In a Hierarchical database, model data is organized in a tree-like structure Data is Stored Hierarchically(top down or bottom up) format
Data is represented using a parent- child relationship In Hierarchical DBMS parent may have many children, but children have only one parent (ii)) Network Model: The
network database model allows each child to have multiple parents It helps you to address the need to model more complex relationships like as the orders/parts many-
to-many relationship In this model, entities are organised in a graphwhich can be accessed through several paths, (iii) Relational Model: Relational DBMS is the most
widely used DBMS model because it is one of the easiest This model is based on normalizing data in the rows and columns of the tables Relational model stored in fixed
structures and manipulated using SQL(iv) Object-Oriented Model: In Object-oriented Model data stored in the form of objects The structure which is called classes,
which display data within it It defines a database as a collection of objects which stores both data members values and operationsQ3 Discuss the Distributed Database
Management System with its Advantages and DisadvantagesAns In a distributed database management system, the database is not stored at a single location Rather, it
may be stored in multiple computers at the same place or geographically spread far away Despite all this, the distributed database appears as a single database to the
user A diagram to better explain this is as follows:-System in IndiaWorkstationDatabaseWorkstationSystem in AustraliaNETWORKDatabaseSystem in
CanadaDatabaseWorkstationAs seen in the figure, the components of the distributed database can be in multiple locations such as India, Canada, Australia, etcHowever,
this is transparent to the user le the database appears as single entity Distributed Database Management System :-The following are the types of Distributed Database
Management (1) Homogeneous DDBMS: In a homogeneous DDBMS, the System: database management systems across all locations are uniform and pased on the same
data model These database management systems are much easier to handle and the database can even be scaled if requiredofTypes(ii) Heterogeneous DDBMS: In
heterogeneous DDBMS, the database management systems across different locations may be based on different data models such as relational, hierarchical, object
oriented etc This type of database systems are a result of later integration of Individual database systems They are quite complicated and difficult to manageAdvantages
:-The distributed database can have the data arranged according to different levels of transparency ie data with different transparency levels can be stored at different
locations(1) If there were a natural catastrophe such as a fire or anearthquake, all the data would not be destroyed as it isstored at different locations(ii) It is cheaper to
create a network of systems containing apart of the database This database can also be easily increased or decreased (iii) Even if some of the data nodes go offline, the
rest of the database can continue its normal functionsDisadvantages :-(1) The distributed database is quite complex and it is difficult to make sure that a user gets a
uniform view of the database because it is spread across multiple locations(ii) It is difficult to provide security in a distributed database as the database needs to be
secured at all the locations it is stored Moreover, the infrastructure connecting all the nodes in a distributed database also needs to be secured(iii) It is difficult to
maintain data integrity in the distributed database because of its nature There can also be data redundancy in the database as it is stored at multiple locationsQ4 What
is Relational Database Model? Explain with its AdvantagesAns Relational Database Model :- The relational data model was introduced by C F Codd in 1970 Currently, it
is the most widely used data model The relational da model describes the world as "a collection of inter-related relation (or tables)" A relational data model involves the
use of data that collect groups of elements into relations These models w based on the idea that each table setup will include a primary key identifier Other tables use
that identifier to provide "relational" data links and results There are four stages of an RDM which are as follows:- tables work(i) Relations and attributes: The various
tables and attributesrelated to each table are identified The tables represent entities and the attributes represent the properties of the respective entities (ii) Primary
keys: The attribute or set of attributes tha help in uniquely identifying a record is applying a set of rules, a table is normalized into the above normal forms in a linearly
progressive fashion The efficiency of t design gets better with each higher degree of normalizationAdvantages of Relational Databases :-The main advantages of
databases are that they enable users to easily categorize and store data that can later be querie and filtered to extract specific information for reports Relation
databases are also easy to extend and aren't reliant on the physicaorganisation After the original database creation, a new data category an be added without all existing
applications being modified other Advantages :- 103(1) Accurate: Data is stored just once, which eliminates data deduplication (ii) Flexible: Complex queries are easy for
users to carry out Collaborative: Multiple users can access the same database(iv) Trusted: Relational database models are mature and well- understood (v) Secure: Data
in tables within relational databasemanagement systems (RDBMS) can be limited to allow accessby only particular usersQ5 What is RDBMS? Explain with Example
What are its Features ?Ans A relational database refers to a database that stores data in a structured format, using rows and columns This makes it easy to locate and
access specific values within the database It is relational" because the values within each table are related to each other Tables may also be related to other tables The
relational structure makes it possible to run queries across multiple tables at onceWhile a relational database describes the type of database an RDMBS manages, the
RDBMS refers to the database program itself It is the software that executes queries on the data, including adding, updating and searching for values An RDBMS may
also provide a visual representation of the data For example, it may display data in a table like a spreadsheet, allowing you to view and even edit individual values in the
table Some RDMBS programs allow you to create forms that can reasons why RDBMS is widely used across the world In simple words, RDBMS is the software system
that allows storing data in the form of tables As we discussed, data stored within RDBMS is in the form of rows and columns and this kind of a setup is often referred to
as tuples and attributesKey Factors to Consider when Selecting a Relational Database:- (1) Initial Setup: Setting up a DBMS, optimizing it for idealoperations and future-
proofing it for growth requires adequate flexibility for integration into the current data infrastructure Synchronization with other platforms is also essential for
uninterrupted workflow (ii) Data Security: Every DBMS will provide different security methods, like encryption, customizable routines and access rights, to protect your
data These should all be carefully considered duringthe evaluation process We probably want access controls likeauthorization and authentication to be default
features, meaning datain tables within a RDBMS is limited to access by specific users(iii) Data Model: How will we tell which model is right for us? If we need to work
with unstructured data, then relational model won't work No SQL databases are often available as open source, whereas a RBDMS is usually a commercial purchase(iv)
Data Accuracy/Reliability: Some of the questions wewill be asking ourself here are our accuracy requirements and whetherto rely on business logic Financial data and
government reports, forexample, will have more stringent requirements Q6 Explain the Application of DBMS systemAns There are different fields where a database
management system is utilized Following are a few applications which utilize the information base administration framework :-(1) Railway Reservation System: In the rail
route reservation framework, the information base is needed to store the record or information of ticket appointments, status about trainsappearance and flight
Additionally, if trains get late, individuals become acquainted with it through the information base update (ii) Library Management System: There are loads of books the
library so; it is difficult to store the record of the relative multitude of books in a register or duplicate Along these lines, the data set administration framework (DBMS) is
utilized to keep up all the data identified with the name of the book, issue date, accessibility of the book and its writer(iii) Banking: Database the executives framework is
utilized to store the exchange data of the client in the information base (iv) Education Sector : Presently, assessments are led online by numerous schools and colleges
They deal with all assessment information through the data set administration framework (DBMS) In spite of that understudy's enlistments subtleties, grades, courses,
expense, participation, results and so forth all the data is put away in the information base(v) Credit Card Exchanges: The database Management framework is utilized
for buying on charge cards and age of month to month proclamations (vi) Social Media Sites: We all utilization of online mediastes to associate with companions and to
impart our perspectivesto the world Every day, many people group pursue these onlinemedia accounts like Pinterest, Facebook, Twitter and Google inaddition to By the
utilization of the data set administrationframework, all the data of clients are put away in the informationbase and, we become ready to interface with others()(vii)
Broadcast Communications: Without DBMS any media transmission organisation can't think The Database the executives framework is fundamental for these
organisations to store the call subtleties and month to month postpaid bills in the information base(viii) Account: The information base administration framework is
utilized for putting away data about deals, holding and acquisition of monetary instruments, for example, stocks and bonds in a data set(ix) Online Shopping : These
days, web-based shopping has become a major pattern Nobody needs to visit the shop and burn through their time Everybody needs to shop through web based
shopping sites, (for example, Amazon, Flipkart, Snapdeal) from home So all the items are sold and added uniquely with the assistance of the information base
administration framework(DBMS) Receipt charges, installments, buy data these are finished with the assistance of DBMS Resource Management: Bigorganisations have
numerous specialists or representatives working under them They store data about workers compensation, assessment and work with the assistance of an information
base administration framework (DBMS) Q7 Discuss the Functions of DBMS in Accounting and its firms or(x) HumanComponentsAns DBMS constitutes of five
components that help in the use and management of data in an organisation These are:- (i) Data: Data is a collection of raw facts that are stored and used inside a
database in order to form meaningful information(ii) Hardware : Hardware is a collection of physical componentsof a computer system It includes secondary storage
devices like diskdrives (floppy, CD), processor, etc (iii) Software: Software refers to the program that a database system uses in order to run a DBMS application It is the
platform through which data is accessed from the physical location (hardware) where data is stored For example, a Software named "Database Manager" (iv) User:
Users are the people who use the databaseapplications They can be Database Administrators, ApplicationProgrammers, Database Designers, End Users, etc(v)
Procedure: A set of instructions that describe the working of DBMS is its procedure DBMS performs many necessary functions to ensure effectiverunning of accounting
system in a businessSome of them are listed below :-(i) Data storage management: DBMS stores a variety ofdata and data related forms, reports, etc related to
accounting system (ii) Data dictionary management: The data dictionary automatically updated in case of any modification, alteration, addition, deletion in the database
This dictionary is used to lookup the required data or components in a journal, ledger, etc (iii) Security management: It is very important to maintainthe security and
privacy within the database from the outside environment (iv) Backup and recoverybackup 107 and recovery procedures in order to ensure the safety of information in
accounting software dequate Database communication interface:Internet services to communicate reports, queries and distribute other information throughout the
accounting system The process of computerized accounting system uses databases to store and retrieve data in the form of inter-related data tables To understand how
a DBMS uses the database is designed, let us first know about data processing cycle, Data Processing is a technique of collecting, sorting, relating, interpreting and
computing data in order to produce meaningful information, which can be used for decision making(v)Q8 What do you Mean by Entity, Entity Set, Relationship?
Attributes and Ans Concept of Entity and its Attributes:-(i) Entity: Entities are specific objects or things in the mini world that are represented in the database For
example Employee John Smith, the research Department, are independent entities(ii) Attributes: The properties that are used to describe an entity are known as
Attributes; for example, an Employee entity may have a Name, Gender, Date of Birth of his/her attributes If book is regarded as an entity then Author's Name,
Price,Published by, etc are its various attributes A Specific entity will havea value for each of its attributes Thus, an entity has a value foreach attributeAttributes are of
many types :-(1) Single-valued and Multi-valued Attributes: An attribute having a single value such as age of a person, is called single valued attribute and vice versa(ii)
Composite and Simple Attributes: Composite attributes can further be sub-divided into smaller attributes with independent meanings, such as name of a person has 3
parts-first name, middle name and last name A simple attribute cannot be divided further(iii) Stored and Derived Attribute: An attribute that is stored in such a way that
other attributes depend upon it and are thereby derived from it, is known as stored attribute For example, Date of birth of a person is a stored attribute, while his age is
a derived attribute(iv) Complex Attribute: When composite or multi-valued attributes are grouped, they form complex attributes(v) Null Values: When the value of an
attribute is unknown, t is referred to as a null attributeEntity Set: An entity set is a group of similar entities a these entities can have attributes In terms of DBMS, an
entity is a table or attribute of a table in database, so by showing relationship and among tables and their attributes, ER diagram shows the complete logical structure of
a databaseEntity Relationship: An entity by itself and alone does not mean anything But when it is related to some other entity or entities, a significant relationship can
be established A relationship relates two or more distinct entities with a specific meaning, for example, Employee 'A' works on Project 'XQ9 What is Entity Relationship
Diagram (ERD) Explain Or, Discuss the Different Symbols used in E-R Model Or, What do you mean by Entity Relationship ChartsAns An Entity Relationship (ER)
Diagram is a type of flowchart that illustrates how "entities" such as people, objects or concepts relate to each other within a system ER Diagrams are most often used to
design or debug relational databases in the fields of software engineering, business information systems, education and research Also known as ERDS or ER Models, they
use a defined set of symbols such as rectangles, diamonds, ovals and connecting lines to depict the inter-connectedness of entities, relationships and their attributes
They mirror grammatical structure, with entities as nouns and relationships as verbsIn short, a diagram representing entities and relationships among them is known as
entity relationship diagram The major elements used in an ER diagram are entities, attributes, identifiers and relationships that express a reality for which the database
is designed The model is depicted using the symbols are shown in figure:-SYMBOLSMEANINGENTITY TYPEWEAK ENTITY TYPERELATIONSHIP TYPEIDENTIFYING
RELATIONSHIP TYPEATTRIBUTEKEY ATTRIBUTEMULTI VALUED KEVATTRIBUTEDERIVED ATTRIBUTE BY DASHEDLINE OVALSmeaning of these symbols :- (i) Entity type: It
symbolizes anything in the real world that The As multiple existence(ii) Weak entity type: An entity set that does not have a primary key is referred to as a weak entity
set Here a primary key refers to the unique attribute about an entity (iii) Relationship type: A diamond box is used to represent me relationship between two entities
Relationships can be one-to- one, one-to-many or many-to-many(iv) Identifying relationship type: The relationship type that s used to relate a weak entity type to its
owner is shown by double Ined diamond-shaped box (v) Attribute: Characteristics of interest that describe the various properties of an entity(vi) Key attribute: A key
attribute is one for which eachentity has a unique value It is represented by an oval shape with theattribute name underlined(vii) Multi-valued attribute: An entity that
has multiple valuesfor that attribute is called multi-valued attribute(viii) Derived attribute: As discussed earlier, an attribute whose value depends upon the value of the
stored attribute It is represented using a dashed oval shape Q 10 Discuss File-based Data Management System with its Functionalities Also give its Advantages and
DisadvantagesAns The systems that are used to organise and maintain data files are known as file based data systems These file systems are used to handle a single or
multiple files and are not very efficientFunctionalities:-The functionalities of a File-based Data Management System are as follows:-(1) A file based system helps in basic
data management forany user (H) The data stored in the file based system should remain consistent Any transactions done in the file based system should not alter the
consistency property (i) The file based system should not allow any illegal or potentiallyhazardous operations to occur on the data(iv) The file based system should allow
concurrent access bydifferent processes and this should be carefully co-ordinated (v) The file based system should make sure that the data is uniformly structured and
stored, so it is easier to access it Advantages of File Based System :-(1) The file Based system is not complicated and is simpler to use(i) Because of the above point, this
system is quite inexpensive (ii) Because the file based system is simple and cheap, it is normally suitable for home users and owners of small businesses (iv) Since the file
based system is used by smaller organisationsor individual users, it stores comparatively lesser amount of data Hence, the data can be accessed faster and more
easilyDisadvantages of File Based System :- (1) The File based system is limited to a smaller size and cannotstore large amounts of data(ii) This system is relatively
uncomplicated but this means itcannot support complicated queries, data recovery etc (ii) There may be redundant data in the file based system as it does not have a
complex mechanism to get rid of it (iv) The data is not very secure in a file based system and maybe corrupted or destroyed (v) The data files in the file based system
may be stored across multiple locations Consequently, it is difficult to share the data easily with multiple usersQ11 Discuss Generalization, Specialization and
Aggregation in ER Model Or, Explain the Term Generalization and SpecializationAns Generalization : Generalization is the process of extracting common properties
from a set of entities and create a generalized entity from it It is a bottom-up approach in whichtwo or more entities can be generalized to a higher level entity if some
attributes in common For Example, STUDENT and FACULTY can be generalized to a higher level entity called PERSON they have as shown in Figure 1 In this case,
common attributes like P_NAME, ADD become part of higher entity (PERSON) and specialized attributes like S_FEE become part of specialized entity
(STUDENT)PERSONP_ADDP_NAMEis AFACULTYSTUDENTS_FEEFig 1: GeneralizationSpecialization: In Specialization, an entity is divided into sub-entities based on their
characteristics It is a top-down approach where higher level entity is specialized into two or more lower level entities For Example, EMPLOYEE entity in an Employee
management system can be specialized into DEVELOPER, TESTEREMPLOYEEE_SALARYis AP_NAMETESTERDEVELOPERTES_TYPEFig 2: Specializationetc as shown in Figure
2 In this case, common attributes like ENAME, E SAL etc become part of higher entity (EMPLOYEE) andspecialized attributes like TES_TYPE become part of
specializedAggregation: An ER diagram is not capable of representing entity (TESTER) relationship between an entity and a relationship which may be required in some
scenarios In those cases, a relationship with its corresponding entities is aggregated into a higher level Aggregation is an abstraction through which we can represent
entity relationships as higher level entity setsPROJECTmWORKS FOREMPLOYEEImREQUIREMACHINERYFig 3: AggregationFor Example, Employee working for a project
may require some machinery So, REQUIRE relationship is needed between relationship WORKS FOR and entity MACHINERY Using aggregation, WORKS FOR relationship
with its entities EMPLOYEE and PROJECT is aggregated into single entity and relationship REQUIRE is created between aggregated entity and MACHINERYQ12 Explain the
Architecture of RDBMS Ans RDBMS stands for Relational Database Management System and it implementsSQLIn the real-world scenario, people use the Relational
Database Management System to collect information and process it to provide service Eg In a ticket processing system, details about us (eg age, gender) and our journey
(eg source, destination), are collected and the ticket is provided to us RDBMS Architecture :-TRANSACTIONMANAGERDATAMETADATALOOBUFFER MANAGERRECOVERY
MANAGERSECONDARY STORAGE DEVICE g disk tapeCOMPILED APPLICATION PROGRAMSQUERYROOMS RUNTIME SYSTEMOPTIMISERAPPLICATIONPROGRAM
COMPILERAPPLICATION PROCKAMERQUERY COMPILERDATA ANALYSTCOMMAND PROCESSORDATABASE ADMINISTRATOREach term in the diagram is explained below
in the point number sociated with the term(1) All data, data about data (metadata) and logs are stored in the Secondary Storage Devices (SSD), such as Disks and Tapes
The programs that are used to do the day-to- day tasks of an enterprise are called Application programs These programs provide Run-Time System executes the
compiled queries and application programs and also interacts with the transaction manager and buffer manager (vii) Buffer Manager temporarily stores the data of
thedatabase in the main memory and uses paging algorithmso that operations can be performed faster and the diskspace can be managed (viii) Transaction Manager
deals with the principle of either completely doing a task or not doing it at all (Atomicity property) Eg, Suppose a person named Geeks, wants to send money to his sister
He sends the money and system crashes in between In no case should it happen that he has sent money but his sister has not received it This is handled by the
transaction manager Thetransaction manager would either refund the money to Geeks or transfer it to his sister(disk (ix) Log is a system, which records the Information
about all the transactions, so that whenever a system failure ( failure, system shut down due to no power etc) arises, the partial transactions can be undone (x) Recovery
Manager takes control of the system so that itreaches a steady state after failure The Recovery Managertakes into account the log files and undoes the
partialtransactions and reflects the complete transaction in thedatabaseQ13 What Factor that Affect Database Performance? ExplainOr, Discuss Performance
Improvement in DatabaseAns Databases are the guts of an application; without them, you're left with just skins and skeletons, which aren't as useful on their own
Therefore, the overall performance of any app is largely dependent on database performance There are dozens of factors that affect performance including how indexes
are used, how queries are structured and how data is modeledConsequently, making minor adjustments to any of these elements can have a large impact This database
performance tuning guide will cover the basics of building and sustaining databases that maximize your system resources for optimal efficiency The examples will
assume we're using SQL Server, but the general advice is applicable to any database management system Five factors influence database performance :-(i) The workload
: That is requested of the DBMS defines the demand It is a combination of online transactions, batch jobs, ad hoc queries, data warehousing analysis, utilities and system
commands directed through the system at any given time Workload can fluctuate drastically from day-to-day, hour-to-hour and even minute-to-minute Sometimes
workload can be predicted (such as heavy month-end processing of payroll, or light access after 7:00 pm, when most users have left for the day), but at other times it Yet
there are other factors that need to be optimized (SQL formulation, database parameters, database but many organisation, etc) to enable the database optimizer to
create the efficient access paths to the data(v) Connection: When the demand (workload) for a particular most esource is high, contention can result Contention is the
condition which two or more components of the workload are attempting to se a single resource in a conflicting way (for example, dual updates o the same piece of
data) As contention increases, throughput decreasesTherefore, database performance can be defined as the optimization of resource use to increase throughput and
minimize contention, enabling the largest possible workload to be processedThe core of the DBMS contributed to the performance speed equation, How fast can the
DBMS handle read/write operations? How does the DBMS utilize system memory to enhance performance? What mechanism does the DBMS use to lock data to ensure
integrity while maintaining concurrency? These are core questions and each database system willimplement different techniques and capabilities to deliver
differentlevels of performance and integrity Q14 Explain SQL with Basic Commands Or, Discuss the following SQL Commands with SuitableExamples:-(a) Insert, (b)
Select,(c) Delete, (d) GrantAns, SQL is Structured Query Language, which is a computer language for storing, manipulating and retrieving data stored in a relational
databaseSQL is the standard language for Relational Database System All the Relational Database Management Systems (RDMS) like MySQL, HS Access, Oracle, Sybase,
Informix, Postgres and SQL Server use SQL as their standard database languageAlso, they are using different dialects, such as:-(1) MS SQL Server using T-SQL, (ii) Oracle
using PL/SQL,() MS Access version of SQL is called JET SQL (native format) etc Why SQL?: SQL is widely popular because it offers the following advantages:-(1) Allows
users to access data in the relational database management systems(ii) Allows users to describe the data(iii) Allows users to define the data in a "Ted"Donald
DCodd89ChamberlinDonald D Chamberlin Raymond F BoyceRaymond FBoyceEdgar Frank "Ted" Codd9 rows in set (000 sec)(c) DELETE :-DELETE is used to delete a
record in a tableBe careful You can delete all records of the table or just a few Use the WHERE condition to specify which records you want to deleteDELETE FROM
table_name WHERE condition;with Id 3:-The syntax is :- Here is an example deleting from the table Person the recordDELETE FROM Person WHERE Id = 3;(e) Grant: Data
Controlling Language (DCL) helps users to retrieve and modify the data stored in the database with some specified queries Grant and Revoke belong to these type of
commands of the Data controlling Language DCL is a component of SQL commands\SQL Grant command is specifically used to provide privileges to database objects for
an user This command also allows users to grant permissions for other users tooSyntax :-grant privilege_name on object_name to (user_name | public | role_name)Here
privilege_name is which permission has to be granted, object_name is the name of the database object, user_name is the user to which access should be provided,
public is used to permit the access to all the usersQ15 What is SQL Functions and DDL ? Discuss any FiveFunctions of SQL Ans SQL Functions are simply sub-programs,
which arecommonly used and re-used throughout SQL database applications for processing or manipulating data All SQL database systems have DDL (data definition
language) and DML (data manipulation language) tools to support the creation and maintenance of databasesDDL is responsible for tasks related to database creation,
modification and maintenance, while DML is responsible for tasks related to the manipulation of data, which essentially means DML is the programming interface of the
database The DML, like other programming languages, consists of instructions which are used to process or compute data within the database The DML also supports
functions and these are referred to as SQL functions SQL functions are small programs that may have zero or more input parameters but can return only one
valueClassification & Purpose of SQL: There are many ways to classify SQL functions The easiest is to divide them into built-in functions and user-defined functions The
built-in functions are standard functions which are already provided by the SQL database system and most of these functions are (expr)COUNT (expr)119AggregateThere
are many advantages of using functions The most commonCounts the number of rowsNumericmeeting the selection criteriaones are listed here :- (1) A function needs
to be written only once and can be reused multiple times This saves time and effort and supports modular programming() Functions improve performance and efficiency
of the databaseSQL functions are compiled and cached before use()Complex programming logic can be decomposed into anumber of smaller and simpler functions, thus
making iteasier to understand and maintainAll built-in SQL functions are a part of the SQL database These can be divided into the scalar and aggregate functions The
scalar functions act on the input values and can return text, numeric or time and date values The aggregate functions act on field/fields in the database and return single
values (either strings or numerical values) after processing Functions can also be classified according to the type of data returnedQ16 What is Data Model in DBMS? List
the Various Types of Data Model? Explain any Two of them Or, Discuss Hierarchical and Relational Data ModelAns Data Model is a logical structure of Database It
describes the design of database to reflect entities, attributes, relationship among data, constrains etcTypes of Data Models:- There are many kinds of data models Some
of the most commonones Include:- • Hierarchical database model;Relational model; Network model;• Object-oriented database model;Entity-relationship model;
Document model;Entity-attribute-value model;• Star schema;The object-relational modelRelational Model: The most common model, the relationalmodel sorts data
into tables, also known as relations, each of which consists of columns and rows Each column lists an attribute of the entity in question, such as price, zip code, or birth
date Together, the attributes in a relation are called a domain A particular attribute or combination of attributes is chosen as a primary key that can be referred to in
other tables, when it's called a foreign keyEach row, also called a tuple, includes data about a specific instance of the entity in question, such as a particular
employeeThe model also accounts for the types of relationships between those tables, including one-to-one, one-to-many and many-to-many relationships Here is an
example (Fig 1)Student ID52-74396548-20968914-204968CharlesAnthonyLast NamePetersSondrupRebeccaPhillipsProvider IDProvider nameUnitedHealth156-983 146-
823Blue ShieldCarefirst Inc447-784Provider IDStudent ID52-74396548-209689 146-823156 983First nameType of planStart dateHSA 04/01/201614-
204968447:784HMOHSA12/01/201503/14/2016Fig 1Within the database, tables can be normalized or brought tocomply with normalization rules that make the
database flexible, ptable and scalable When normalized, each piece of data is atomic broken into the smallest useful pieces Relational databases are typically written in
Structured Queryanguage (SQL)Hierarchical Model: The hierarchical model organises data a tree-like structure, where each record has a single parent or root Sibling
records are sorted in a particular order That order is used as the physical order for storing the database This model is good for describing many real-world
relationships(Living) Great apesOrangutansGorillasChimpanzeesHumansBornean orangutanSumatran orangutanCommon chimpanzeeBonoboEastern gorillaWestern
gorillaModern humansThis model was primarily u…KeyDBMSRDBMSData is stored as tablesData is stored as fileData StorageData AccessRelationshipIn DBMS, each data
elements are to accessed individually There is no relationship between data in DBMSIn RDBMS, multiple data be elements can be accessedat same time Data is present
in multiple tables which can beNormali- zationDistributed Q17 What is Different between DBMS and RDBMS?Ans DBMS represents a Database Management System It
is used to create/update/delete and maintain a database and it provides controlled access to data RDBMS, Relational Database Management System, is an enhanced
version of DBMSFollowing are the important differences between DBMS and RDBMS:-KeyDBMSDefinitionDBMS stands for DataBase Management SystemRDBMSRDBMS
stands for DataBaseRelationalManagement System KeyDBMSRDBMSData is stored as tablesData is stored as fileData StorageData AccessRelationshipIn DBMS, each data
elements are to accessed individually There is no relationship between data in DBMSIn RDBMS, multiple data be elements can be accessedat same time Data is present
in multiple tables which can beNormali- zationDistributed databaseDataQuantityData Redundancy UserDBMS has no support for distributed databases DBMS deals with
smallquantity of dataData Redundancyiscommon in DBMS DBMS supports single userat a time DBMS provides low securitySecurityduring data manipulationrelated to
each other Normalization can be achievedOracle, SQL Server,RDBMS has multilayer security during data manipulationRDBMS supports multiple users at a timeData
Redundancy can be reduced using key and indexes in RDBMSRDBMS deals with large quantity of data RDBMS supportsdistributed databasesNormalization cannot be
achievedExample MSAccessQ18 Discuss the following SQI Commands with Example :- (i) CREATE TABLE,(ii) INSERT,(iii) SELECT Ans (1) CREATE TABLE: CREATE, It is used
to create a newtable in the databaseSyntax :CREATE TABLE TABLE_NAME (COLUMN_NAME DATATYPES[]Example :CREATE TABLE EMPLOYEE (Name VARCHAR2(20),
EmailVARCHAR2(100), DOB (DATE) (ii) INSERT: The INSERT statement is a SQL query It is used to insert data into the row of a table[17:14, 15/03/2023] Aatish Flatmate:
syntax:INSERT INTO TABLE_NAME;(coll, col2, col3, col N);VALUES (value1, value2, value3, valueN);INSERT INTO TABLE_NAME;VALUES (value1, value2, value3, valueN);
For example:INSERT INTO javatpoint (Author, Subject) VALUES ("Sonoo",(H) SELECT: This is the same as the projection operation of onal algebra It is used to select the
attribute based on the don described by WHERE clauseSyntax:SELECT expressionsFROM TABLESWHERE conditions;For example: SELECT emp_nameFROM
employeeWHERE age > 20; Q 19 Explain Network and Relational Data Model with ExampleAns The Network model commonly represents data and sationships through
diagrams containing boxes and arrows Each or represents a record type and each arrow represents a relationship te A record type will contain fields, which are used to
store individual es, which together represent defining information about the real- world entity the record represents For example, if there is a need to Sore information
about employees in a database, it is natural to ine an employee record type containing fields such as last name, rst name, SSN, Date of Birth, etc If employees are
grouped by partments in a certain organisation, then a department should also defined to store information about one or more departments The onship between
departments and employees could be called contains It is a one-to-many relationship, where one department y contain many employees and each employee (at least
for[17:14, 15/03/2023] Aatish Flatmate: modeling exercise) can by contained by only one department A diagramis shownDEPARTMENTCONTAINSEMPLOYEEThe name
"Network model" is used because multiple boxes canbe connected to other boxes through multiple arrows :- The Relational Model represents data in a tabular format,
with each row representing an entity of some type and each column representing a defining attribute of the entity The columns for employee and department tables in a
Relational model might look as follows:EMPLOYEELast nameFirst NameSSNDate of birthDept nameDEPARTMENTDept nameDept descRoughly, a row is the same as a
record and a column is the same as a field A relational model does not show explicit relationships between rows, but allows relationships to be derived through
comparison of column values In the above example, the employee table contains a department name (dept name) column, which should identify the department that
contains the employee In this case, where the employee's department name matches the department's department name, we can derive the relationship between an
employee and departmentQ20 Explain Data Manipulation and Data Definition Language with Example Or, Discuss DCL, DDL,AND DQL with Suitable Example Or,
Discuss DML Commands with Illustrations in SQL Ans (i) Data Manipulation Language (DML) :- A Data Manipulation Language (DML) is a computerprogramming
language used for adding (inserting), deleting and[17:14, 15/03/2023] Aatish Flatmate: blanguage of a broader database language such as SQL, with dying (updating) 125
data in a database A DML is often a ONL comprising some of the operators in the language Read- y selecting of data is sometimes distinguished as being part of a rate
Data Query Language (DQL), but it is closely related and sometimes also considered a component of a DML; some operators y perform both selecting (reading) and
writing A popular data manipulation language isQuery Language (SQL), which is used to retrieve and manipulate that of Structured data in a relational database Other
forms of DML are those used IMS/DLI, CODASYL databases, such as IDMS and others Examples of DML commands:INSERT is used to insert data into a table UPDATE is
used to update existing data within a table DELETE is used to delete records from a database table(DDL (Data Definition Language) :-DDL or Data Definition Language
actually consists of the SQL commands that can be used to define the database schema It simply deals with descriptions of the database schema and is used to create
and modify the structure of database objects in the databaseExamples of DDL Commands: • CREATE is used to create the database or its objects (liketable, index,
function, views, store procedure and triggers) DROP is used to delete objects from the database ALTER is used to alter the structure of the database
TRUNCATE is used to remove all records from a table,including all spaces allocated for the records are removed • COMMENT is used to add comments to the data
dictionary • RENAME is used to rename an object existing in thedatabase(ii) DQL (Data Query Language) :-DQL statements are used for performing queries on the data
within schema objects The purpose of the DQL Command is to get some schema relation) can by contained by only one department A diagramis
shownDEPARTMENTCONTAINSEMPLOYEEThe name "Network model" is used because multiple boxes canbe connected to other boxes through multiple arrows :- The
Relational Model represents data in a tabular format, with each row representing an entity of some type and each column representing a defining attribute of the entity
The columns for employee and department tables in a Relational model might look as follows:EMPLOYEELast nameFirst NameSSNDate of birthDept
nameDEPARTMENTDept nameDept descRoughly, a row is the same as a record and a column is the same as a field A relational model does not show explicit
relationships between rows, but allows relationships to b…blanguage of a broader database language such as SQL, with dying (updating) 125 data in a database A DML is
often a ONL comprising some of the operators in the language Read- y selecting of data is sometimes distinguished as being part of a rate Data Query Language (DQL),
but it is closely related and sometimes also considered a component of a DML; some operators y perform both selecting (reading) and writing A popular data
manipulation language isQuery Language (SQL), which is used to retrieve and manipulate that of Structured data in a relational database Other forms of DML are those
used IMS/DLI, CODASYL databases, such as IDMS and others Examples of DML commands:INSERT is used to insert data into a table UPDATE is used to update existing
data w…mainly deal with the rights, permissions and other controls of thedatabase systemExamples of DCL Commands:• GRANT : Gives users access privileges to the
database• REVOKE: Withdraw users access privileges the GRANT command given by using (v) TCL (Transaction Control Language) :-TCL commands deal with the
transaction within the database Examples of TCL Commands:• COMMIT: Commits a Transaction• ROLLBACK : Rollbacks a transaction in case of any errorOccurs
SAVEPOINT : Sets a savepoint within a transaction • SET TRANSACTION : Specify characteristics for thetransactionQ21 List SQL Commands with its Short Description Ans
SQL Commands: The standard SQL commands to interact with relational databases are CREATE, SELECT, INSERT, UPDATE, DELETE and DROP These commands can be
classified into the following groups based on their nature:-DDL Data Definition LanguageCommandDescriptionCREATEALTERCreates a new table, a view of a table or
other objectin the databaseModifies an existing database object, such as a tableDROPDeletes an entire table, a view of a table or other objects in the databaseDML Data
Manipulation LanguageCommandDescriptionRetrieves certain records from one or more tablesSELECT INSERTUPDATECreates a recordModifies recordsDELETEDeletes
records DCL Data Control LanguageCommandGRANTREVOKEGives a privilege to userDescriptionTakes back privileges granted from user