Dbms File: Submitted by
Dbms File: Submitted by
Dbms File: Submitted by
DBMS FILE
Submitted By:
Pulkit Chhabra
2K17/CO/248
COE - A4 (G1)
Submitted To:
Mr. Manoj Sethi
Index
S. No. Aim Page No. Done on Signature
EXPERIMENT-1
AIM:
To obtain in-depth knowledge of various database management system softwares, their advantages and
disadvantages and the operating system they work on.
PROBLEM STATEMENT:
Compare five database management systems and explain one of them in detail
DBMS DEFINITION:
A database-management system (DBMS) is a computer-software application that interacts with end-users,
other applications, and the database itself to capture and analyse data. A general-purpose DBMS allows the
definition, creation, querying, update, and administration of databases.
FEATURES
• MySQL follows a client /server architecture. There is a database server (MySQL) and
arbitrarily many clients (application programs), which communicate with the server; that is,
they query data, save changes, etc.
• MySQL is compatible to run on many operating systems like Windows, Linux, many
varieties of UNIX (such as Sun, Solaris, AIX, and DEC UNIX), OS/2, FreeBSD, and others.
MySQL also provides a facility that the clients can run on the same computer as the server
or on another computer (communication via a local network or the Internet).
• MySQL uses Triggers, Stored procedures and views which allows the developer to give a
higher productivity.
Their Advantages:
MySQL is easy to learn and use. MySQL is very easy to install, and thanks to a bevy of third-party
tools that can be added to the database, setting up an implementation is a relatively simple task.
MySQL is free to use and you can download it from MySQL official website.
MySQL can handle almost any amount of data, up to as much as 50 million rows or more. The
default file size limit is about 4 GB. However, you can increase this number to a theoretical limit of
8 TB of data.
MySQL is faster, more reliable and cheaper because of its unique storage engine architecture.
Support is readily available whenever necessary.
Their Disadvantages:
2. SQLite
Features
• SQLite is popular choice for the database engine in cellphones, PDAs, MP3 players, set- top
boxes, and other electronic gadgets. SQLite has a small code footprint, makes efficient use
of memory, disk space, and disk bandwidth, is highly reliable, and requires no maintenance
from a Database Administrator.
• Because it requires no configuration and stores information in ordinary disk files, SQLite is
a popular choice as the database to back small to medium-sized websites.
• SQLite is often used as a surrogate for an enterprise RDBMS for demonstration purposes or
for testing. SQLite is fast and requires no setup, which takes a lot of the hassle out of testing
and which makes demos perky and easy to launch.
Their Advantages:
• SQLite is a very light weighted database so, it is easy to use it as an embedded software with
devices like televisions, Mobile phones, cameras, home electronic devices, etc.
• Reading and writing operations are very fast for SQLite database. It is almost 35% faster
than File system.
• SQLite is very easy to learn. You don’t need to install and configure it. Just download
SQLite libraries in your computer and it is ready for creating the database.
Their Disadvantages:
• Oracle DB runs on most major platforms, including Windows, UNIX, Linux and Mac OS.
• Its architecture is split between the logical and the physical. This structure means that for
large-scale distributed computing, also known as grid computing, the data location is
irrelevant and transparent to the user, allowing for a more modular physical structure that
can be added to and altered without affecting the activity of the database, its data or users.
• The sharing of resources in this way allows for very flexible data networks whose capacity
can be adjusted up or down to suit demand, without degradation of service.
• It also allows for a robust system to be devised as there is no single point at which a failure
can bring down the database, as the networked schema of the storage resources means that
any failure would be local only.
Their Advantages:
• Oracle fully supports all industry standards and provides full support to developers.
• Oracle supports online backup and recovery and has a wealth of development tools,
covering various stages of the development cycle.
• Oracle supports large databases, data type support numbers and characters, and it
provides data to support object-oriented database storage.
• An Oracle database has the ability to manage multiple databases using a two-phase
commit protocol.
• Oracle supports cursors, which helps to make programming easier. It also performs each
transaction separately, and the result of each transaction is invisible to other transactions
until it is complete, which increases the security of data.
Their Disadvantages:
• One major disadvantage of Oracle database is its complexity.
• Using Oracle is not ideal if the users lack the technical ability and know-how needed to
work with Oracle databases.
• It is also not ideal to use Oracle if an organization or individual is looking for an easy-to-
use database with basic features.
• It is not ideal for small or mid-sized companies where small databases are needed. In
such cases, using MySQL is more cost effective.
4. Microsoft Access
Microsoft Access is a Database Management System (DBMS) from Microsoft that combines
the relational Microsoft Jet Database Engine with a graphical user interface and software
development tools. It is a member of the Microsoft Office suite of applications, included in
the professional and higher editions.
Features
• Microsoft Access is just one part of Microsoft’s overall data management product strategy.
• Like relational databases, Microsoft Access also allows you to link related information
easily. For example, customer and order data. However, Access 2013 also complements
other database products because it has several powerful connectivity features.
• Access calls anything that can have a name an object. Within an Access desktop database,
the main objects are tables, queries, forms, reports, macros, data macros, and modules.
• With the release of Access 2007, the database file format changed from the previous ".mdb"
to ".accdb". This new format supports more complex data types, but unfortunately is not
compatible with prior versions of the Access software.
Their Advantages:
• Access is a go-to choice for users who plan to develop software using .NET; linking to
Access database. Its graphical user interface also offers easy functionality and set up.
• Microsoft Access is hundreds of dollars more economical than other larger systems;
offering the same functions and usage.
• Access works well with many of the developing software programs based in Windows. It
also can be used in the front-end as back-end tables with products like Microsoft SQL
Server and non-Microsoft products like Oracle and Sybase.
Their Disadvantages:
• SQL for MS Access is not as robust as MS SQL Server or Oracle, to just name a few.
• Technical limit is 255 concurrent users, but real world limit is 10 to 80 (depending on type
of application).
5) IBM DB2
DB2 is a database product from IBM. It is a Relational Database Management System
(RDBMS). DB2 is designed to store, analyze and retrieve the data efficiently. DB2 product
is extended with the support of Object-Oriented features and non- relational structures with
XML.
Features
• Initially, IBM had developed DB2 product for their specific platform. Since year 1990, it decided
to develop a Universal Database (UDB) DB2 Server,
which can run on any authoritative operating systems such as Linux, UNIX, and Windows.
It is designed for mid-size to large-size business organizations. Platform - Linux, UNIX, and
Windows. Table partitioning High Availability Disaster Recovery (HARD) Materialized Query
Table (MQTs) Multidimensional Clustering (MDC) Connection concentrator Pure XML Backup
compression Homogeneous Federations.
It is designed for Workgroup or mid-size business organizations. Using this WSE you can work
with - High Availability Disaster Recovery (HARD) Online Reorganization Pure XML Web Service
Federation support DB2 Homogeneous Federations Homogeneous SQL replication Backup
compression.
It provides all the capabilities of DB2 at zero charge. It can run on any physical or virtual systems
with any size of configuration.
Their Advantages:
Powerful structured query: DB2 has a more powerful Structured Query Language (SQL) dialect
than Microsoft's SQL offering. DB2 has features such as object tables, before triggers, Java method
support, multiple user-defined functions and support for arrays.
Multiple platform support: IBM produces versions of DB2 that run on all available platforms, rather
than just Windows-based platforms. Included in the DB2 list of supported platforms are AIX, HP-
UX, Linux and Sun.
Self tuning memory management: Database tuning is part art and part science, and normally takes a
significant amount of a database administrator's time. Part of this configuration job entails
configuring memory for the various workloads to achieve the best performance.
Their Disadvantages:
It's hard to find good DB2 DBAs quickly for a new project unlike Oracle or SQL- Server DBAs.
Up-skilling Oracle DBAs to DB2 is easy considering the amount of materials and tutorials available
in the internet for DB2.
There are lots of great as well as less efficient monitoring Tools in DB2, but nowhere it's mentioned
which one is recommended by IBM.
Conclusion:
We have learned about various database management systems in detail with their features,
advantages and disadvantages.
EXPERIMENT -2
Aim: To learn about modeling tools like MetaEdit which help in designing models. Problem
Statement: Explain MetaEdit software and its functions.
MetaEdit
MetaEdit is an environment for creating and using Domain specific Modeling languages.
It offers full modeling tool support for your language. Your whole team can immediately start to
edit designs as graphical diagrams, as matrices or as tables, switching between views according to
your needs.
There are two main versions of MetaEdit:
• MetaEdit Workbench, including tools for designing and using modeling languages.
• MetaEdit 2.5 was released in 1996, adding full multi-user facilities and support for Solaris
and HP-UX.
• MetaEdit 3.0 was released in 1999, with support for Linux and significant new functionality
added in three Service Releases over the next few years.
• MetaEdit 4.0 was released in 2004, with new Diagram and Symbol Editors, support for
ports, and interoperability via SOAP and XML. Two Service Releases adding new
functionality and support for Mac OS X.
• MetaEdit 4.5 was released in 2006, adding graphical metamodeling and improving the
metamodel, symbol and generator definition facilities and Diagram Editor.
Functions
• The MetaEdit toolset thus includes generic CASE behavior for objects and
relationships, including a Diagram Editor, Object and Graph Browsers, and property
dialogs. The DSM developer need only specify his modeling language: e.g. creating
a new object type, giving it a name and choosing which property types it has.
• . It allows you to define your object and relationship symbols, or reuse existing
symbols. There is no need for any hand coding, nor is any CASE tool code
generated. The MetaEdit editors simply follow the defined language in a similar way
to how Word follows its templates.
• MetaEdit also includes XML import and export, an API for data and control access
to MetaEdit functions, and a generic code generator. The code generator uses a DSL
that allows the DSM developer to specify how to walk through models and output
their contents along with other text. This makes defining code generators simple,
with one line of a code generator definition corresponding to several lines in the
scripting languages sometimes used for this purpose.
EXPERIMENT 3
DESCRIPTION:
Assume we have the following application that models soccer teams, the games
they play and the players in each team. In the design, we want to capture the following —
1. We have a set of teams, each team has an ID (Unique Identifier), Name, Main Stadium,
and to which City this team belongs.
2. Each team has many players and each player belongs to one team. Each player has a
Number (Unique Identifier), Name, Date of Birth, Start Year and Shirt Number that he
uses.
3. Teams play matches, inn each match there is a Host Team and a Guest Team. The
match takes place in the stadium of the host team.
(iii) The player participated in the match. For each player how many goals he
scored, whether or not he took yellow card & whether or not he took a red card
(iv) During the match one player may substitute another player. We want to
capture this substitution and the time at which it took place
5. Each match has exactly three Referees. For each referee, we have an ID (Unique
Identifier), Name, Date of Birth, Years of Experience,. One referee is the main referee
and the other two are assistant referees.
OUTPUT:
CONCLUSION: Through this experiment, we learnt how to use an ERD Software to make
an ER Diagram and how to interpret a question and turn it into an ER
Diagram.
EXPERIMENT 4
OBJECTIVE: To acquire knowledge of SQL, its merits & demerits and learn about its
commands.
EXPLANATION:
SQL is a standard language for storing, manipulating and retrieving data from
databases. It is a domain-specific language which is used in programming and is
designed for managing data held in a relational database management system, or for
stream processing in a relational data stream management system.
Characteristics of SQL:
• It is an ANSI and ISO standard computer language used for creating and manipulating
databases.
• With the help of SQL language, the users can make different views of database
structure and databases for the different users
• It works with database programs like DB2, Oracle RDBMS, MS Access, Sybase, MS
SQL Server, etc.
Advantages of SQL:
• No coding needed: It is easy to manage the database systems without any need to
write its code by using the standard SQL
• High speed: The users can quickly and efficiently retrieve a large amount of records
from a database
• Well defined standards: There are no standards adhered by the non-SQL databases
• Portability: SQL can be used in the programs in PCs, servers, laptops, and even some
of the mobile phones
• Interactive Language: This domain language can be used for communicating with the
databases and receive answers to the complex questions in seconds
• Multiple data views: With the help of SQL language, the users can make different
views of database structure and databases for the different users
Disadvantages of SQL:
Along with some benefits, the Structured query language also has some certain
disadvantages —
• Difficult Interface: It has a complex interface that makes it difficult for some users to
access it
• Partial control: The programmers who use SQL don’t have full control over the
database because of the hidden business rules
• Cost: The operating cost of some SQL versions make it difficult for some
programmers to access it
2. INSERT - INSERT Statement is used to insert the set of values into the
table.
Eg - DROP Student
In DCL, it defines the control over the data in the database. We have two different
commands. These are —
Syntax -
GRANT privilege_name
ON Object_name
Syntax -
REVOKE privilege_name
ON object_name
In TCL, the commands are used to manage the transactions in the database.
These are the used to manage the changes made by DML statements. It also
allows the statements to be grouped together into logical transactions.
These are —
Syntax -
COMMIT;
Syntax -
ROLLBACK TO savepoint_name;
Syntax -
SAVEPOINT savepoint_name;
CONCLUSION: Here, we learned about SQL and the various commands that we can use
to perform different operations.
EXPERIMENT 5
PROBLEM STATEMENT: Create a table ‘Student’ with attributes — Roll Number, Name,
Date of Birth, Phone Number, Address and Course. Also,
perform operations using INSERT, SELECT and WHERE
commands.
2. INSERT - it is used to insert entries into a table. This command lets the
user insert entries into all attributes or just particularly chosen ones.
3. SELECT - it is used to display entries from the table. It lets the user
display all entries (SELECT * FROM Student) or particular entries
(SELECT Name, Address FROM Student).
OUTPUT:
Creation of Table —
Insertion of Entries
CONCLUSION: Here we learnt how to create a table and perform operations on it like
displaying an entry based on a condition on one of the attributes.
EXPERIMENT 6
1. ALL
2. ALTER TABLE
3. ANY
4. EXISTS
5. GROUP BY
6. FULL JOIN
7. LEFT JOIN
8. RIGHT JOIN
9. ORDER BY
10. UPDATE
1. ALL Operator
ALL operator is used to select all tuples of SELECT statement. It is also used to
compare a value to every value in another value set or result from a subquery.
Here, it selected all the values in Student Table where CourseCode is ‘ECEUG’ and
displayed the Address column only.
ALTER TABLE is used to add, delete (drop) or modify columns in the existing table.
Here, Date of Birth column was added into the table and all the values are set to NULL by
default.
3. ANY Operator
ANY compares a value to each value in a list or results from a query and evaluates
to true if the result of an inner query contains at least one row.
This operator displayed the records in the Course table that have Duration = ‘2 years’.
4. EXISTS Condition
The EXISTS Condition inn SQL is used to check whether the result of a correlated
nested query is empty or not.
This helped us fetch the name of the students whose CourseCode matched with the
CourseCode in the Course table.
5. GROUP BY Statement
The GROUP BY Statement in SQL is used to arrange identical data into groups
with the help of some functions i.e if a particular group has same values in different rows
then it will arrange these rows in a group. It is used the SELECT Statement.
For the table Student, we grouped the data into the Subjects and Year and also displayed
their count.
The LEFT JOIN statement gives all rows in A, plus any common rows in B. If a
record in A doesn’t exist in B, it will return NULL for that row.
Here, since the last four tuples do not exist in the table Joining, their values for the
attributes Name, CourseID and Subject are NULL.
The RIGHT JOIN statement gives all rows in table B, plus any common rows in A. If
a record in B doesn’t exist in A, it will return NULL for that row.
Here, the last three tuples have NULL values since those don’t exist in the table Students.
8. FULL JOIN
MySQL does not support FULL JOIN, so we have to combine RIGHT JOIN,
UNION, LEFT JOIN to get an equivalent. It gives the results of A union B. It returns all
records from both tables. Those columns which exist only in one table will contain NULL
in the opposite table.
Here, the values that don’t exist in the other table have been given NULL values.
9. ORDER BY Clause
The ORDER BY Clause is used for sorting the result set. It allows us to sort a result
set by a single or multiple columns, in ascending or descending order.
The first table shows the table being arranged in Ascending order (Default sorting) by
Names and in the second table they are arranged in Descending order (Done by the
keyword DESC) by Name.
The UPDATE Command is used to modify rows in a table. It can be used to update
a single field or multiple fields at the same time.
EXPERIMENT 7
PROBLEM STATEMENT: Perform Queries on multiple tables, that is, a table ‘Course’
with the following attributes — Course Code (unique identifier), Description, Duration,
Level; and another table ‘Student’ with the attributes — Roll Number, Name, Address,
Phone number, Course (Foreign Key related to Course Code of ‘Course’).
1. The total number of Under Graduate Students and Post Graduate Students
3. List of Students and their course Description for Students of Software Engineering
Department
2. INSERT - it is used to insert entries into a table. This command lets the
user insert entries into all attributes or just particularly chosen ones.
3. SELECT - it is used to display entries from the table. It lets the user
display all entries (SELECT * FROM Student) or particular entries
(SELECT Name, Address FROM Student).
7. INNER JOIN - it selects records that have matching values in two related
tables.
OUTPUT:
CONCLUSION: In this experiment we learnt how to relate two tables and create a Foreign
Key referenced to an attribute of another table and display entries from
both the tables together as one table.
INDENTIFICATION OF ENTITIES:
1. College (college_id, college_name, contact_no, address)
2. Department (dept_id, dept_name, contact_no, hod_no)
3. Courses (courses_id, course_title, year)
4. Faculty (fac_id, fac_name, designation, qualification,
contact_no, address)
5. Student (std_id, std_name, year, admission_date)
6. Progress_report (report_id, year, grade, rank)
INDENTIFICATION OF ENTITIES:
1. College: Department (1: N)
2. Department: Faculty (1: N)
3. Faculty: Courses (M: N)
4. Department: Courses (1: N)
5. Department: Student (1: N)
6. Student: Progress_report (1: N)
2. CLG_CONTACT
3.DEPARTMENT
4. FACULTY
5. COURSES
6. STUDENT
7. PROGRESS_REPORT
8. TEACHES
1. AVG ():
2. COUNT ():
3. SUM ()
4. MAX ():
5. MIN ():
DATE FUNCTIONS
1) SYSTEM DATE
1. List details of all the students who are allotted to some department along with
their department details. (inner join)
2. List all the faculty members of the university along with the courses id they
teach, if they teach any course. (left join)
3. List faculty id, faculty name, course id and course name for all the faculty
members and courses even if the faculty teaches no course or course is taught by
none faculty. (full join)
4. List name and id of faculty with the department name whose hod they are, if
they are. (right join)
DISCUSSION:
CONCLUSIONS: