Kartik Dbms File
Kartik Dbms File
Kartik Dbms File
On
DATABASE MANAGEMENT SYSTEM
PAPER CODE: ETEC-455
Submitted for
Bachelor of Technology
In
ELECTRONICS AND COMMUNICATION
Network Model
• It supports the One-To-One and One-To-Many types only. The basic objects in this model
areData Items, Data Aggregates, Records and Sets.
• It is an improvement on the Hierarchical Model. Here multiple parent-child relationships areused.
• Rapid and easy access to data is possible in this model due to multiple access paths to thedata
elements.
Relational Model
• Does not maintain physical connection between relations.
• Data is organized in terms of rows and columns in a table.
• The position of a row and/or column in a table is of no importance.
• The intersection of a row and column must give a single value.
Features of an RDBMS
• The ability to create multiple relations and enter data into them.
• An attractive query language.
• Retrieval of information stored in more than one table.
• An RDBMS product has to satisfy at least Seven of the 12 rules of Codd to be acceptedas a full-
fledged RDBMS.
1 Rahul Satelite
2 Sachin Ambawadi
3 Saurav Naranpura
1 78 89 94
2 54 65 77
3 23 78 46
Here, both tables are based on students details. Common field in both tables is Rollno. So we
can say both tables are related with each other through Rollno column.
Degree of Relationship
11
One student has only one Rollno. For one occurrence of the first entity, there can be, at the mostone
related occurrence of the second entity, and vice-versa.
1M
As per the Institutions Norm, One student can enroll in one course at a time however, in onecourse, there
can be more than one student.
For one occurrence of the first entity there can exist many related occurrences of the secondentity and for
every occurrence of the second entity there exists only one associated occurrenceof the first.
MM
The major disadvantage of the relational model is that a clear-cut interface cannot be
determined.Reusability of a structure is not possible. The Relational Database now accepted model on
whichmajor database system are built.
E. F. Codd Rules
1. The Information Rule
Every item in a table must be logically addressable with the help of a table name.
inapplicable information.
According to the rule the system must support data definition, view definition, data
operations.
All views that are theoretically updatable are also updatable by the system.
This rule indicates that all the data manipulation commands must be operational
Application programs must remain unimpaired when any changes are made in storagerepresentation or
access methods.
The integrity constraints should store in the system catalog or in the database.
The system must be access or manipulate the data that is distributed in other systems.
If a RDBMS supports a lower level language then it should not bypass any
Oracle8 and later versions are supported object-oriented concepts. A structure once created can bereused
is the fundamental of the OOP’s concept. So we can say Oracle8 is supported ObjectRelational model,
Object - oriented model both. Oracle products are based on a concept known asa client-server technology.
This concept involves segregating the processing of an applicationbetween two systems. One performs all
activities related to the database (server) and the otherperforms activities that help the user to interact with
the application (client). A client or front-enddatabase application also interacts with the database by
requesting and receiving information fromdatabase server. It acts as an interface between the user and the
database.The database server or back end is used to manage the database tables and also respond to
clientrequests.
AIM:Installation of MySQL .
PROCEDURE : Steps for installing MySQL
Step1: “https://dev.mysql.com/downloads/installer/” . Go through this link &
install the MYSQL installer 8.0.21 (windows 32 bit MSI Installer).
Step2:This is MySQL Server 8.0 setup wizard. The setup wizard will install
MySQL Server 8.0 release 8.0.21 on your computer. To continue, click next.
Step4:The program features you selected are being installed. Please wait while the
setup wizard installs MySQL 8.0. This may take several minutes.
Step5:To continue, click next. Wizard Completed. Setup has finished installing
MySQL 8.0. Check the configure the MySQL server now to continue. Click
Finish to exit the wizard
Step7: this method asking for authentication method (prefer the legacy of MYSQL
5.x Compatibility)
TO CREATE A DATABASE
1.1 Objective 1.2 Theory 1.3 Program 1.4 Software Required 1.5 Result 1.6 Pre-Requisite 1.7 Post-
Requisite
1.2. THEORY:
A database is a shared, integrated computer structure the stores a collection of:
1. End-user data, that is, raw facts of interest to the end user.
2. Metadata or data about data, through which the end-user data are integrated and managed.
A DBMS can support many different kinds of databases. Database can be classified according to
the number of users, the database locations, and the expected type and extent of use. The number
of users determines whether the database is classified as single-user or multi-user. A single-user
database supports only one user at a time. In other words, if user A is using the database, users B
and C must wait until user A is done. I contrast, a multiuser database supports multiple users at the
same time.
1.3. PROGRAM:
create database corporation;
create table company
(
cmp_idvarchar(5) primary key,
cmp_namevarchar(30) not null,
no_of_studint
);
1.5. RESULT:
1.7. POST-REQUISITE:
TO APPLY CONSTRAINTS
2.1 Objective 2.2 Theory 2.3 Program 2.4 Software Required 2.5 Pre-Requisite 2.6 Post-Requisite
2.1. OBJECTIVE: Apply the constraints like Primary Key, Foreign Key, NOT NULL to the tables.
2.2. THEORY:
Constraints are conditions that must hold on all valid relation instances.
Primary Key: If an attribute is chosen to be a primary key it means that its values must not
change. Primary keys cannot be duplicate. In a primary key all the record in that column must be
unique and no NOT NULL value. A primary key is a minimum super key.
Foreign Key: Sometimes the information stored in a relation is linked to the information stored
in another relation. A foreign key is an attribute whose values match the primary key values in the
related table. A foreign key is a copy of primary key of another table. This key connects to
another table when a relationship is being established.
NOT NULL: When this constraint is applied to an attribute this means the records can be
duplicate but there cannot be a NULL value in the column.
2.3. PROGRAM:
MySQL on Ubuntu
2.5.RESULT:
2.7.POST-REQUISITE:
Experiment No. 5
3.1 Objective 3.2 Theory 3.3 Program 3.4 Software Required 3.5 Result 3.6 Pre-Requisite 3.7 Post-
Requisite
3.1. OBJECTIVE: Write a SQL statement for implementing ALTER, UPDATE and DELETE.
3.2. THEORY:
Data Definition Language (DDL) is the part of SQL that allows the database user to create and
restructure database objects, such as ALTER command is used to modify an existing table.
Data Manipulation Language (DML) is the part of SQL used to manipulate data within objects of a
relational database. Basic commands of DML are UPDATE command which is used to change or
modify values in a table and DELETE command which is used.
3.3. PROGRAM:
updateTnp
setsal=’200000’
wherestud_id=’2563’;
order by asc;
modify(stud_idvarchar(5));
wherestud_id=’2563’;
3.4.SOFTWARE REQUIRED:
MySQL on Ubuntu.
3.6. PRE-REQUISITE:
Experiment No. 6
TO IMPLEMENT JOINS
4.2. THEORY:
The SQL JOIN clause is used to combine from two or more tables in a database. A JOIN is a means
for combining fields from two tables by using values common to each.
If a SQL JOIN condition is omitted or invalid it will result in a Cartesian product.
There are different types of joins available in SQL:
• INNER JOIN
• LEFT JOIN
• RIGHT JOIN
• FULL JOIN
• SELF JOIN
• CARTESIAN JOIN
4.3. PROGRAM:
whereTnp.cmp_id=company.cmp_id;
4.5. RESULT:
Experiment No. 7
5.1 Objective 5.2 Theory 5.3 Program 5.4 Software Required 5.5 Result 5.6 Pre-Requisite 5.7
Post-Requisite
5.1. OBJECTIVE: Write the queries to implement the following functions: MAX (), MIN (), AVG (),
COUNT().
5.2. THEORY:
• MAX (): This function chooses the maximum value among the values in the attribute chosen.
• MIN (): This function chooses the least value among all the values in the attribute chosen.
• AVG (): This function calculates the average of the attribute chosen.
• COUNT (): This function counts the number of tuples for a given attribute.
5.3. PROGRAM:
MySQL on Ubuntu.
6.1 Objective 6.2 Theory 6.3 Program 6.4 Software Required 6.5 Result 6.6 Pre-Requisite 6.7 Post-
Requisite
6.1. OBJECTIVE: Write the queries to implement the concept of integrity constraints.
6.2. THEORY:
Integrity constraints ensure that changes made to the database by authorized users do not result in a
loss of data consistency. The allowed integrity constraints are:
• Not null: This make the records in a particular attribute not have a null value
• Unique: This makes the records to not have duplicate values and null value also used only
once.
• Check: This checks a given condition specified by the user
6.3. PROGRAM:
MySQL on Ubuntu
6.6. PRE-REQUISITE:
7.1 Objective 7.2 Theory 7.3 Program 7.4 Software Required 7.5 Result 7.6 Pre-Requisite 7.7 Post-
Requisite
7.2. THEORY:
A view is nothing more than a SQL statement that is stored in the database with an associated name.
A view is actually a composition of a table in the form of a predefined SQL query. A view can
contain all rows of a table or select rows from a table. A view can be created from one or many tables
which depends on the written SQL query to create a view.
So, a view is a virtual table, through which a selective portion of the data from one or more tables can
be seen. Views do not contain data of their own.
7.3. PROGRAM:
7.5. RESULT:
Q 1. What is view?
Q 2. What are the advantages of creating a view?
8.1 Objective 8.2 Theory 8.3 Program 8.4 Software Required 8.5 Result 8.6 Pre-Requisite 8.7 Post-
Requisite
8.1. OBJECTIVE: Perform the following operation for demonstrating the insertion, updation and
deletion using the referential integrity constraints.
8.2. THEORY:
Referential integrity refers when we want to ensure that a value that appears in one relation for a
given set of attributes also appears for certain set of attributes in another relation.
8.3. PROGRAM:
whereTnp.cmp_id=company.cmp_id;
8.5. RESULT: