Database Management Systems: Architectures, Models, NoSQL, and Transactions
1) What is a Database? Explain the three-schema architecture with a neat diagram.
• A database is an organized collection of data stored in a computer system and usually controlled by a database management system (DBMS).
• The Three-Schema Architecture: The goal of the three-schema architecture is to separate user applications from the physical database.
1. The Internal Level (Internal Schema):
➢ Describes the physical storage structure of the database.
➢ Uses a physical data model and describes
Read MoreUnderstanding Database Transactions, ACID Properties, and Stored Procedures in SQL
Database Transactions
A database transaction is a sequence of one or more SQL operations treated as a single unit of work. It ensures that either all operations are completed successfully or none are applied, preserving data integrity.
ACID Properties of Transactions
Atomicity: Ensures that all operations within the transaction are completed successfully. If any operation fails, the entire transaction is rolled back.
Consistency: Ensures that the database moves from one valid state to another, maintaining
Read MoreDatabase Management Systems: Triggers, Views, Constraints, and Data Models
Triggers
A trigger is a block of code that automatically executes in response to specific events on a particular table or view in a database. They are stored in the database and invoked repeatedly when the defined conditions are met. Triggers are associated with events like:
- Data Definition Language (DDL) statements (CREATE, DROP, ALTER)
- Data Manipulation Language (DML) statements (UPDATE, INSERT, DELETE)
- Database operations (Startup, Shutdown, Login, Logout)
Trigger Syntax
CREATE OR REPLACE TRIGGER Trigger_
Network Configuration: Routers and Switches
Router R1 Configuration
Hostname and Enable Secret
hostname R1
enable secret cisco
IP Domain Name
ip domain-name reprobe.cl
Crypto Key
crypto key generate rsa
2048
Username and Password
username alumno password alumno
Line VTY Configuration
line vty 0 4
transport input ssh
login local
exit
SSH Configuration
ip ssh version 2
ip ssh authentication-retries 2
ip ssh time-out 60
Interface Configuration
FastEthernet 0/0.15
interface FastEthernet 0/0.15
encapsulation dot1Q 15
ip address 172.16.0.1 255.255.192.0
!
FastEthernet 0/
Read MoreNetwork Configuration for Three Routers and Three Switches
Hostname: R1
Enable Secret
enable secret cisco
IP Domain Name
ip domain-name reprobe.cl
Crypto Key
crypto key generate rsa
2048
Username and Password
username alumno password alumno
Line VTY Configuration
line vty 0 4
transport input ssh
login local
exit
SSH Configuration
ip ssh version 2
ip ssh authentication-retries 2
ip ssh time-out 60
Interface Configuration
FastEthernet 0/0.15
encapsulation dot1Q 15
ip address 172.16.0.1 255.255.192.0
FastEthernet 0/0.30
encapsulation dot1Q 30
ip address 172.16.96.1 255.255.240.0
FastEthernet
Read MoreData Structures and Algorithms in C: Implementations and Explanations
1) Implementing a Linear Queue in C
#include<stdio.h>
int q[10], ch, size, front=-1, rear=-1, item, i;
void enqueue()
{
if(rear == size – 1)
printf(“Queue Overflow
“);
else
{
if(front== – 1)
front = 0;
printf(“Insert the element in queue
: “);
scanf(“%d”, &item);
q[rear++] = item;
}
}
void dequeue()
{
if(front== -1 || front>rear)
{
printf(“Queue Underflow
“);
}
else
{
printf(“Element deleted from queue is : %d
“, q[front]);
front++;
}
}
void display()
{
if(front== -1 || front>rear)
{
printf(“Queue is empty
