Dbms
Dbms
Id Number : N210142
Seciton : CSE-03
Roll Number : 09
2
08/07/24
LAB-1
Task-1 :
Write the applications of Database management system ?
2. Airlines :
• Flight scheduling: Manage flight schedules and timings.
• Reservations: Handle ticket reservations and cancellations.
• Crew scheduling: Assign and manage crew schedules.
3. Education :
• Student information systems: Manage student records, grades, and
enrollment.
• Library management: Track book inventory and lending.
• Learning management systems: Handle course materials and student
progress.
4. Telecommunications :
• Call records: Store call detail records (CDRs).
• Billing: Handle billing and invoicing for customers.
• Network management: Monitor and manage the network infrastructure.
5.Healthcare :
• Patient records: Store and manage patient information.
• Appointment scheduling: Manage doctor and patient schedules.
• Billing and insurance: Handle billing and insurance claims.
3
6. Government :
• Public records: Store and manage records such as birth and death
certificates.
• Tax administration: Manage tax records and transactions.
• E-governance: Facilitate online services for citizens.
7. Manufacturing :
• Supply chain management: Track raw materials and products.
• Production planning: Manage production schedules and processes.
• Quality control: Monitor and maintain product quality.
8. E-Commerce :
• Product catalogs: Manage product listings and inventory.
• Order processing: Handle orders and track shipments.
• Customer management: Store customer information and purchase
history.
9. Hospitality :
• Reservation systems: Manage room bookings and reservations.
• Guest management: Store guest information and preferences.
• Billing: Handle billing and invoicing for guests.
Task-2 :
Identify the names of existing Databases and write which
companies are using those Databases ?
Relational Databases
1. Oracle Database
• Companies: Amazon, eBay, LinkedIn, Cisco, and Airbnb.
2. Microsoft SQL Server
• Companies: Microsoft, Dell, Bank of America, Citibank, and
Starbucks.An entity is like a person, place, thing, or concept that
4
NoSQL Databases
1. MongoDB
• Companies: Adobe, eBay, EA, Verizon, and SEGA.
2. Cassandra
• Companies: Facebook, Netflix, Spotify, Instagram, and Reddit.
3. Couchbase
• Companies: LinkedIn, PayPal, Amadeus, Marriott, and Tesco.
4. Redis
• Companies: Twitter, GitHub, Snapchat, StackOverflow, and
Craigslist.
5. Amazon DynamoDB
• Companies: Amazon, Samsung, Lyft, Dropbox, and Capital One.
Task-3 :
Purpose of these existing Databases ? (Why is that Database
developed) ?
Relational Databases :
1. Oracle Database
Purpose : Designed for enterprise-level applications requiring high
performance, reliability, and complex transaction processing. Used
extensively in financial services, government, and large-scale operations.
2. Microsoft SQL server
5
NoSQL Databases :
1. MongoDB
Purpose : A document-oriented database designed for high availability,
high scalability, and agile development. Used for storing JSON-like
documents, making it a popular choice for web applications and real-time
analytics.
2. Cassandra
Purpose : A distributed NoSQL database designed for handling large
amounts of data across many commodity servers, providing high
availability with no single point of failure. Suitable for big data
applications.
3. CouchBase
Purpose : A NoSQL database that combines the best of both document and
key-value stores. Designed for interactive applications that require
consistent high performance, availability, and scalability.
4. Redis
6
Task-4 :
MySQL , Oracle , MongoDB , Sybase – Developed by ,Purpose
of the database , its functionalities ?
MySQL
• Developed by : MySQL AB (now owned by Oracle Corporation).
• Functionalities :
◦ Data Storage: Stores data in tables using rows and columns.
◦ SQL Support: Executes SQL queries to retrieve and manipulate data.
◦ Indexes: Improves query performance by creating indexes on columns.
◦ Transactions: Supports transactions to ensure data integrity.
◦ Replication : Allows data to be copied from one database server to
another for backup and high avaliability.
Oracle
• Developed by : Oracle Corporation.
• Functionalities :
◦ Data Storage: Advanced storage options including tables, indexes, and
partitions.
◦ SQL and PL/SQL: Executes SQL and PL/SQL (procedural language)
queries.
◦ Backup and Recovery: Tools for backing up data and recovering it in
case of failures.
7
MongoDB
• Developed by : MongoDB, Inc.
• Functionalities :
◦ Document Storage: Stores data in JSON-like documents, which can
have varying structures.
◦ Dynamic Schema: No fixed schema, allowing flexible data models.
◦ Indexing: Creates indexes on documents to improve query
performance.
◦ Sharding: Distributes data across multiple servers for scalability.
◦ Replication: Ensures high availability by replicating data across
different servers.
Sybase (SAP ASE - Adaptive Server Enterprise)
• Developed by: Sybase, Inc. (now owned by SAP SE)
• Functionalities:
◦ Data Storage: Organizes data in tables with rows and columns.
◦ SQL Support: Executes standard SQL queries for data operations.
◦ Transactions: Supports ACID-compliant transactions for data integrity.
◦ Backup and Recovery: Provides tools for data backup and recovery.
◦ High Availability: Features like data mirroring and failover clustering
for reliability.
Task-5 :
Installation of MySQL -write down the steps in the document ?
Step-1 : Update the Package Index
8
• Setup your root password (low or medium or strong ) and configure other
security options.
Step-4 : Install MySQL Workbench
• Run the following commands :
sudo apt install mysql-workbench
• This will show you the current status of the MySQL Servcice.
Step-6 : Access MySQL
• You can access MySQL by running :
sudo mysql -u root -p
Task-6 :
Open MySQL application and observe the elements in it ?
MySQL Workbench :
1) Open MySQL Workbench :
Launch MySQL Workbech form your applications menu.
2) Connect to MySQL Server :
Click on the connection you want to use or create a new connection by
entering the required details (hostname,port,username and password).
3) Show Databases :
In the left-hand sidebar, you will see a list of databases under the
“SCHEMAS” tab.
4) Select a Database :
Click on the database name to expand it and see the tables it contains.
5) View Tables :
Click on the table name to view its columns and indexes.
6) Describe a Table :
Right-click on a table and select “Table Inspector” to see detalied
information about the table structure.
7) View Table Data :
Right-click on a table and select “ Select Rows-Limit 1000 ” to see the
data within the table.
10
LAB – 2
Task-1 :
Define Entity and Relationship in Databases and write about
them in detail with examples ?
Entity :
An entity is like a person, place, thing, or concept that you want to store
information about in a database. Think of an entity as a table in a database, where
each table holds data about one type of thing.
Examples :
• Person: Employee, Student, Patient
• Place: Store, Building
• Object: Machine, product, and Car
• Event: Sale, Registration, Renewal
• Concept: Account, Course
Entity Set :
An entity set is a set of entities of the same type that share the same properties or
attributes.An entity set is represented in an E-R diagram by a Rectangle, which is
divided into two parts. The first part, which in this text is shaded blue, contains the
name of the entity set. The second part contains the names of all the attributes of
the entity set.
Example :
• The set of all people who are instructors at a University can be defined as
the entity set Instructor.
• The set of all Students at a University can be defined as the entity set
Student.
Types of Entities :
1. Strong Entity (or Independent Entity) :
• A strong entity is an entity that can exist independently of other
entities. It has a primary key that uniquely identifies each record.
11
• Example:
◦ Customer: A customer can exist independently in the system.
2. Weak Entity
• A weak entity is an entity that cannot exist without being associated
with another entity (known as the owner or strong entity). It doesn't
have a primary key on its own but uses a foreign key in combination
with its own attributes to create a unique identifier.
• Example:
▪ OrderItem: An order item exists only as part of an order.
Relationship :
• Relationship is nothing but an association among two or more
entities.Entities take part in relationships. We can often identify
relationships with verbs or verb phrases.In ER diagram, the relationship
type is represented by a diamond and connecting the entities with lines.
• Examples :
• A student attends a lecture.
Relationship Set :
• A set of relationships of the same type is known as a relationship set.
• Example : The Students table stores information about students.The
Courses table stores information about courses.The Enrollments table
represents the relationship set where each row indicates that a student is
enrolled in a particular course.
Degree of a Relationship Set :
1) Unary (or Recursive) Relationship:
• Involves a single entity set.
• Example: An employee is a manager of another employee.
2) Binary Relationship:
12
For a Binary Relationship set R over two entities A and B there are four possible
Mapping Cardinalities :
1. One-to-One: Each record in one table is related to one record in another
table.
Example: A person and their passport.
2. One-to-Many: One record in a table can be related to many records in
another table.
Example: A customer can place many orders.
3. Many-to-One : Many records in a table are related to one record in
another table.
13
Component Symbol
Entity
Attribute
Relationship
Weak Entity
Multivalued Attribute
Derived Attribute
15
Weak Relationship
Total Participation
Task-2
List the tools to draw ER diagrams in both Offline and Online :
Offline Tools
1) Microsoft Visio
◦ A widely used diagramming tool that includes templates for ER
diagrams.
◦ Features: Drag-and-drop interface, extensive library of shapes, data
linking.
◦ Platform: Windows.
2) Lucidchart Desktop App
◦ Although primarily an online tool, it offers offline functionality.
◦ Features: Intuitive interface, templates, collaboration features.
◦ Platform: Windows, macOS.
3) draw.io Desktop
◦ Free, open-source diagramming tool with offline capabilities.
◦ Features: Simple interface, templates, no internet connection required.
◦ Platform: Windows, macOS, Linux.
4) ER/Studio Data Architect
◦ A professional-grade data modeling tool that supports ER diagrams.
◦ Features: Advanced data modeling, database integration, reverse
engineering.
◦ Platform: Windows.
5) Oracle SQL Developer Data Modeler
16
Lab – 3
Draw ER diagrams to the following streams :
Identify the attributes and keys (Primary key and Foreign key)
in the Databases ?
Schema Diagram :
19
E-R Diagram :
20
Schema Diagram :
21
E-R Diagram :
22
Schema Diagram :
23
E-R Diagram :
24
Schema Diagram :