DBMS Flashcards

1
Q

define data

A

information translated to required/appropriate format for easier management

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

define database

A

collection of organized data to manage and manipulate

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

define dbms

A

managing system for databases - create,update, manipulate and delete data entities

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

FPS | DBMS

A

Data inconsistency (common in FPS)
Data redundancy (common in FPS)
Security (Robust in DBMS)
Maintainibility
Data Concurrency
Accessibility (Difficult in FPS)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

DBMS structure/architecture

A

1 DDL Compiler (converts query to table with metadata)
2 DML compiler and Query
Optimizer (converts DML to object code which is then optimized)
3 Data manager (optimized object code to machine unders., DBMS info access, buffer in main mem, controls backup and rec)
4 Data Files (data portion of dataB stored on magnetic tapes or optical disk)
5 Data Dictionary (respository of description, data, relationship, constraints, access)
6 Compiled DML (stored)
7 End User

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Schema

A

Design of Database
Physical
Logical
View

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Data Models

A

Analysis of relation between one data entity and another data entity
Relation (record base, record = tuples, fields = attributes)
Hierarchical (data organized into tree structure, records connected)
Network (extended hier, multiple records to same file, flexible, records and sets)
E-R
OOP (extension of ER model)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is view in DBMS and how to create it? Can you update view?

A

A view in DBMS (Database Management System) is a virtual table that is based on the result of a query. It provides a simplified way to present data from one or more tables, without actually storing the data itself.
Updation : only if from single table and no aggregate functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is trigger? Consider following schema
Student_fee_details (rollno, name, fee_deposited, date)
Write a trigger to preserve old values of student fee details before updating in the table.

A

A trigger is a set of actions that are automatically executed in response to certain events, such as insertions, updates, or deletions, on a table in a database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Constraints

A

Primary Key
Foreign Key
Unique
Not null
Default
Check
Referential
Entity Integrity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Index

A

An index is a data structure that improves the speed of data retrieval operations on a database table (copy of selected col and pointer to corres rows)
adv : fast data retrieval, less disk i/o, better query performance
dis : additional memory, index maintenance, insert, updat and delete overhead

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Types of triggers

A

Before Trigger: A before trigger is executed before the triggering event occurs. It can be used to validate data before it is inserted or updated.
After Trigger: An after trigger is executed after the triggering event occurs. It can be used to perform actions after data has been inserted, updated, or deleted.
Instead of Trigger: An instead of trigger is executed instead of the triggering event. It can be used to replace the default behavior of an insert, update, or delete operation.
Row-Level Trigger: A row-level trigger is executed for each row affected by the triggering event.
Statement-Level Trigger: A statement-level trigger is executed once for each triggering event, regardless of the number of rows affected.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Stored procedure

A

A stored procedure is a set of SQL statements that are compiled and stored in a database. It is a reusable block of code that can be executed repeatedly with different input parameters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

characteristics of database approach

A

1 self-describing (self description)
2 integrated (integrates data from multiple sources to single rep)
3 shared (multiple users and applications can share)
4 structured (structured format - tables easy to manage and query)
5 query-able (allows to query data)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How database approach differs from traditional file system

A

Data redundancy (duplicates, centralized rep storage)
Data inconsistency (one file updated not others, data integrity constraint)
Data Security (file-level permission, user authentication, access control)
Data sharing (file-level sharing, multiple appplication and user)
Data scalability (file system capacity, scale hor and vert to accomodate data)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

what is the importance of creating constraints on a table in DBMS

A

Data integrity
Data accuracy
Consistency
Prevention of Data Redu
Data Security

17
Q

data manager

A

1 converts i/p from QO to machine
understandable code
2 buffer handling
3 DBMS info access stored on disk
4 enforces constraints
5 controls backup and rec

18
Q

Primary key, Candidate key, Super key

A

PK - unique identifier not null
CK - can be primary key (only one), various columns unique rows
SK - set of unique identifier and non primary key

19
Q

Specialization | Generalization

A

used to represent complex relationships between entities.

Spec - creating specific entities form general
Total, partial, disjoint

Gen - creating general entities from specific
Total, partial, disjoint

20
Q

PL/SQL

A

procedural programming lan
used to create triggers, stored procedures and functions in Oracle

Blocks (self contained unit of code)
Variables (store and mani data)
Control Structure (IF THEN, loops)
Exception (exc)

21
Q

Cursor

A

A cursor is a control structure that enables traversal over the records in a database. It allows you to fetch and process rows from a query result set one at a time

22
Q

Embedded | Dynamic

A

allows to embed SQL queries, generate
pre compiled, dynam. compiled at run time
faster, slower
execution at run time, dynamic execution at run time
more secure, less secure
less flexible, more flexiblle

23
Q

DB languages

A

SQL (MySQL)
NoSQL (Mongo DB)
LnnQ (Microsoft.NET, C#)
Oracle (Oracle DB)
Graph (gremlin, Amazon Neptune)