0% found this document useful (0 votes)
48 views

DATABSE

1. The document discusses different database concepts including data, databases, database management systems (DBMS), data models, relational database terminology, SQL statements, and relational algebra. 2. Key concepts covered include the hierarchical, network, and relational data models; tables, tuples, attributes, domains, and keys in relational databases; DDL, DML, and DQL SQL statements; and relational algebra operations like selection, projection, union, intersection, difference, cartesian product, and join. 3. The document provides definitions and examples to explain database foundations and the relational data model that underpins most modern database systems.

Uploaded by

chiragg642
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views

DATABSE

1. The document discusses different database concepts including data, databases, database management systems (DBMS), data models, relational database terminology, SQL statements, and relational algebra. 2. Key concepts covered include the hierarchical, network, and relational data models; tables, tuples, attributes, domains, and keys in relational databases; DDL, DML, and DQL SQL statements; and relational algebra operations like selection, projection, union, intersection, difference, cartesian product, and join. 3. The document provides definitions and examples to explain database foundations and the relational data model that underpins most modern database systems.

Uploaded by

chiragg642
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

DATABSE

1. Data In simple words data can be facts related to any object in consideration. For example your name, age, height, weight, etc are
some data related to you. A picture , image , file , pdf etc can also be considered data.

2. Database is a systematic collection of data. Databases support storage and manipulation of data. Databases make data
management easy. Let's discuss few examples. Student Record maintain by Class Teacher and Teachers Data Maintain by Principal

3. Database Management System (DBMS) is a collection of programs which enables its users to access database, manipulate data,
reporting / representation of data.It also helps to control access to the database.

DBMS - Data Models: A Database model defines the logical design and structure of a database and defines how data will be stored,
accessed and updated in a database management system. While the Relational Model is the most widely used database model it is
only read in our course , there are other models too.

(i) Hierarchical Model (ii) Network Model (iii)Relational Model

(i) Hierarchical Model: This database model organises data into a tree-like-structure, with a single root, to which all the other data is
linked. The hierarchy starts from the Root data, and expands like a tree, adding child nodes to the parent nodes.

(ii) Network Model : This is an extension of the Hierarchical model. In this model data is organized more like a graph, and are allowed
to have more than one parent node.

(iii) Relational Model: In this model, data is organized in two-dimensional tables and the relationship is maintained by storing a
common field. It has been the most widely used database model, infect, we can say the only database model used around the
world.The basic structure of data in the relational model is tables. All the information related to a particular type is stored in rows of
that table.Hence, tables are also known as relations in relational model. In Class XII we will learn how to design tables and how to use
Structured Query language to access data from tables.

4. Relational Database Terminology:

Relations – Relation is a table . It is a grid made up of rows and columns.


Tuples – A row in a table is known as a record, or a tuple. A tuple holds all the data on a single item.

Attributes – A Column of a Relation id called Field or Attribute.

Domains – All the possible allowable values for an attribute. This is slightly different to the data type of the attribute.

Cardinality – No of Tuple or Record or Row in a Relation is called Cardinality or Arity.

Degree – No of Attributes or Column or Field in a Relation is called Degree.

Primary Key-A Uniquely Indentify attribute in relation is called Primary Key.(Ex. Roll No in Student Record Register)

Candidate Key -Is an attribute or set of attributes that uniquely identifies a record. Among the set of candidate, one candidate key is
chosen as Primary Key (i.e. candidate of Primary Key) .(Ex. Roll No and SRNO in Student Record Register)

Alternate Keys- Are candidate keys that are not selected as primary key. Alternate key is also called “Secondary Key”.

(Ex: Alternate Key= Candidate Key- Primary Key)

Composite key-Iis a combination of more than one attributes that can be used to uniquely identity each record. It is also known as
“Compound” key. (Ex: Roll,Class, Sec in a school Assembly)

Foreign key -Is used to generate the relationship between the tables. Foreign Key is a field in database table that is Primary key in
another table. A foreign key can accept null and duplicate value.

5. Classification of SQL Statements:

SQL Provides many different types of commands used for different purpose. SQL commands can be mainly divided into following
categories

Data Definition Language (DDL) refers to the CREATE, ALTER and DROP statements.

DDL or Data Definition Language actually consists of the SQL commands that can be used to define the database schema. DDL allows
to add / modify / delete the logical structures which contain the data or which allow users to access / maintain the data (databases,
tables).

Data Manipulation Language (DML) refers to the INSERT, UPDATE and DELETE statements

DML allows to add / modify / delete data itself.

Data Query Language (DQL) refers to the SELECT, DESCRIBE and HELP statements (queries)

SELECT is the main DQL instruction. It retrieves data you need.

6. Relational Algebra:

Relational algebra is a procedural query language. It gives a step by step process to obtain the result of the query. It uses operators to
perform queries.

(i) Selection(σ) (ii) Projection (∏) (iii) Union(U) (iv) Intersection(∩) (v) Difference(-) (vi) Cartesian Product(X) (vii) Join(⋈)

Selection(σ): The select operation Selects tuples that satisfy a given predicate. It is denoted by sigma (σ).

Syntax : σ p(r)

σ is used for selection prediction


r is used for relation
p is used as a propositional logic formula which may use connectors like: AND OR and NOT. These relational can use as relational
operators like =, ≠, ≥, <, >, ≤.
Ex: σ roll>50(student)

Projection (∏):This operation shows the list of those attributes that we wish to appear in the result. Rest of the attributes are
eliminated from the table.It is denoted by ∏.

Ex: ∏ name,rollno,class (student)

Union(U):When two or more relation are same domain and same degree then they can called Union Compatible.The union operation
performs the same function as the union operation in the set theory. It is represented by U symbol. If we perform an operation A U B
on table A and B, then the result would include all the tuples that are in table A as well as in table B. This operation removes the
duplicate tuples.

Intersection(∩):When two or more relation are same domain and same degree then they can participate in Intersection operation .The
intersect operation performs the same function as the intersect operation in the set theory. It is represented by ∩ symbol. This
operation selects all those tuples from the relation which are common in both the relation.

Difference(-):When two or more relation are same domain and same degree then they can participate in difference operation.The set
difference operation performs the same function as the set difference operation in the set theory. It is represented by -(minus)
symbol. If we perform an operation A-B on table A and B, then the result would include only those tuples that are in table A but not in
B. This operation removes all those tuples which are common in both table A and B, from A and gives output.
Cartesian Product(X):The Cartesian Product is also an operator which works on two sets. It is sometimes called the CROSS PRODUCT or
C.P.It combines the tuples of one relation with all the tuples of the other relation.

Join (⋈): Join can only be performed if there is a common attribute (column) between the relations. The name and type of the
attribute must be same.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy