DBMS Important Questions For Annual Exams
DBMS Important Questions For Annual Exams
PART A
1. Define DBMS
Database management system is a software which is used to manage the database. For
example: MySQL, Oracle, etc are a very popular commercial database which is used in
different applications.
DDL stands for data definition language. DDL commands are used for creating and altering the
database and database object in the relational database management system, like CREATE
DATABASE, CREATE TABLE, ALTER TABLE, etc. The most used DDL commands are CREATE,
DROP, ALTER, and TRUNCATE.
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.
Various strong entities, when combined together, create a strong entity set.
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.
• DBA also monitors the recovery and backup and provide technical
support.
• The DBA has a DBA account in the DBMS which called a system or
superuser account.
• DBA repairs damage caused due to hardware and/or software
failures.
Data Model gives us an idea that how the final system will look like after its complete
implementation. It defines the data elements and the relationships between the data elements.
Data Models are used to show how data is stored, connected, accessed and updated in the
database management system.
1. Hierarchical Model
2. Network Model
3. Entity-Relationship Model
4. Relational Model
5. Object-Oriented Data Model
6. Object-Relational Data Model
• CREATE
CREATE command is used to create a database and database object like a table, index,
view, trigger, stored procedure, etc.
Syntax
CREATE TABLE Employee (Id INT, Name VARHCAR(50), Address VARCHAR (100));
• ALTER
ALTER command is used to restructure the database object and the settings in the
database.
Syntax
ALTER TABLE Employee ADD Salary INT;
A primary key is used to ensure that data in the specific column is unique. A column cannot
have NULL values. It is either an existing table column or a column that is specifically
generated by the database according to a defined sequence.
Example: STUD_NO, as well as STUD_PHONE both, are candidate keys for relation
STUDENT but STUD_NO can be chosen as the primary key (only one out of many candidate
keys).
A foreign key is a column or group of columns in a relational database table that provides a link
between data in two tables. It is a column (or columns) that references a column (most often the
primary key) of another table.
Example: STUD_NO in STUDENT_COURSE is a foreign key to STUD_NO in STUDENT
relation.
An Entity–relationship model (ER model) describes the structure of a database with the help of a
diagram, which is known as Entity Relationship Diagram (ER Diagram). An ER model is a design or
blueprint of a database that can later be implemented as a database. The main components of E-
R model are: entity set and relationship set.
o Views in SQL are considered as a virtual table. A view also contains rows and columns.
o To create the view, we can select the fields from one or more tables present in the
database.
o A view can either have specific rows based on certain condition or all the rows of a table.
A single user system in DBMS refers to a database management system that allows only
one user to access and manipulate the database at a time. In other words, a single user
system provides exclusive access to the database, and no other user can make any
changes or modifications to the data until the first user has finished.
A Join operation combines related tuples from different relations, if and only if a given
join condition is satisfied. It is denoted by ⋈.
Join statement is used to combine data or rows from two or more tables based on a
common field between them.
There are three types of joins: inner joins, natural joins, and outer joins. Inner joins are classified into
two types: Theta Join (for relational operators) and Equi Join (for Equality).outer joins are classified
into Left outer join Right outer join Full outer join.
The normal form is used to reduce redundancy from the database table.
• The Skeleton of the database is created by the attributes and this skeleton is named Schema.
• Schema mentions the logical constraints like table, primary key, etc.
• The schema does not represent the data type of the attributes.
An Entity may be an object with a physical existence – a particular person, car, house, or
employee – or it may be an object with a conceptual existence – a company, a job, or a
university course.
26. Define 2 NF
A relation that is in First Normal Form and every non-primary-key attribute is
fully functionally dependent on the primary key, then the relation is in Second
Normal Form (2NF).
ER Diagram stands for Entity Relationship Diagram, also known as ERD is a diagram
that displays the relationship of entity sets stored in a database. In other words, ER
diagrams help to explain the logical structure of databases. ER diagrams are created based
on three basic concepts: entities, attributes and relationships.
The data is stored for a particular amount of time and is called an instance of the database.
The database schema defines the attributes of the database in the particular DBMS. The
value of the particular attribute at a particular moment in time is known as an instance of
the DBMS.
35. Write syntax for UPDATE and INSERT command with example
UPDATE syntax
The syntax of the SQL UPDATE statement is:
UPDATE table_name
SET column1 = value1, column2 = value2, ...
[WHERE condition];
example:
UPDATE Customers
SET first_name = 'Ravi'
WHERE customer_id = 1;
INSERT INTO tableName
(column1, column2, ...)
VALUES (value1, value2, ...)
INSERT INTO dbo.Patient
(Surname, FirstName, DOB, Sex, [Weight], Height, Vaccinated)
VALUES (NULL, NULL,'2019-11-19', 'F', 14.0, 23.1, 'No')
UML defines a standard set of modeling diagrams for all stages of developing a software
system. This information describes the entity-relationship model of database design.
Another model that you can use is Unified Modeling Language (UML). The Object
Management Group is a consortium that created the UML standard.
Syntax
CREATE TABLE table_name (
column1 datatype,
column2 datatype,
column3 datatype,
....
);
ExampleGet your own SQL Server
CREATE TABLE Persons (
PersonID int,
LastName varchar(255),
FirstName varchar(255),
Address varchar(255),
City varchar(255)
);
38. List any two applications of DBMS
A data dictionary in Database Management System (DBMS) can be defined as a component that
stores the collection of names, definitions, and attributes for data elements that are being used in a
database.
Syntax:
SELECT SQRT(..value..)
Syntax:
SELECT CEILING(..value..)
Syntax:
SELECT FLOOR(..value..)
The acronym ACID stands for Atomicity, Consistency, Isolation, and Durability.
In a multi-user system, multiple users can access and use the same database at one time,
which is known as the concurrent execution of the database. It means that the same
database is executed simultaneously on a multi-user system by different users
PART B