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

Null 17

This document discusses key concepts related to databases including: 1. It defines data and information, and describes what a database system is - a collection of stored coherent data that represents part of the real world. 2. It discusses database languages including DDL for defining schemas, DML for manipulating data, and SDL and VDL. 3. It describes database components like the user interface, data manager, file manager, and disk manager. 4. It covers database design concepts such as the data model, schema, instances, relationships, keys, attributes, and normalization.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Null 17

This document discusses key concepts related to databases including: 1. It defines data and information, and describes what a database system is - a collection of stored coherent data that represents part of the real world. 2. It discusses database languages including DDL for defining schemas, DML for manipulating data, and SDL and VDL. 3. It describes database components like the user interface, data manager, file manager, and disk manager. 4. It covers database design concepts such as the data model, schema, instances, relationships, keys, attributes, and normalization.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Data VS information Database Language Attributes and Keys

Data – row facts about any object (property value) • Data Definition Language (DDL). • Attributes are properties of given entity
• Storage Definition Language (SDL). which used to describe each entity.
Information – processed data • View Definition Language (VDL). • Key attributes must be unique for each
• Data Manipulation Language (DML). entity
What is a Database System? • Keys are used to identify particular entities
DDL
• A Database is Attribute types
Use to define and change database schemas create
Collection of stored coherent data that represent a
table, query, form in data definition language. • Normal attribute
part of the real world (mini world)
• Multi valued attributes
Mainly create alter and drop SQL command used • Derived attributes
Mini world is user depending
under the DDL. • Composite attributes
• A Database system is
DML Relationships
Any SW that facilitate the construction &
manipulation of DB This language is used to insert, edit and delete Relationships indicate a meaningful connection
records is database. As well as it is use to filter the between two entity types
Data Model & DB Schema record in database.
• Relationships  diamond
A data model is a collection of concepts for EX: SQL, MYSQL
describing data in a DB, including • Identifying relationship  double diamond

Components of DBMS Participation and Cardinality


A schema is a description of a particular collection
of data, using a given data model.
• User Interface • Participation and cardinality define
An instance is a particular set of data in the DB. • Data Manager constraints on relationships
• File Manager
The evolution of database technology • Disk Manager
• Participation indicates whether an entity is
• Physical Database
required to take part in a relationship
• Hierarchical Model
• Network Model User Interface Database Design Life Circle
• Relational Model
• Object Oriented Model The user interface is the is way of the user interacts • Requirement Analysis
with the system a particular machine, device,
• Conceptual Database Design
computer programmed or other complex tools.
• Logical Database Design
• Schema Refinement
• Physical Database Design
• Application and security Design
Participation Constraints Data Manager Advantages of Using a DBMS

• Total participation program which allows to process and manipulate • Redundancy Control
• Partial participation data in a easy and logical manner using a graphical • concurrency
interface. • Better security
Cardinality Ratios • Enforcing integrity
Data Manager reads and writes delaminated files • Recovery facility
• Cardinality ratios specify the maximum such • multiple user views
number of relationship instances that an • Self representation of data
entity may participate in File Manager • Access Control

Redundancy Control
Design Decision A file manager or file browser is a computer
program that provides a user interface to work with
A DBMS can assist in controlling redundancy
• Composite and multi value attribute file systems.
• Attribute or Entity Concurrency
• Attribute link to entity or relationship Disk Manager
• Binary or ternary relationships A DBMS supports access by concurrent users
• It is sometimes convenient to name an Disk manager is a simple file system configuration
entity’s role in a relationship. that allows to: Enforce integrity
• Generalization hierarchy
• Automatically detect new partitions at A DBMS supports representation of complex
Regular Entities startup. relationships and integrity constraints
• Fully manage configuration of file system
• Regular entity types become relations Levels of Abstraction
Entity Types
– include all simple attributes • External/Views
– include only components of compound Entity types are similar to classes, • Conceptual schema
attributes • Physical schema
– keys become primary keys
Entity describe potential objects that will appear in
– if multiple keys select a primary key Data Independence
the database

Weak Entities • Data independency


Ex: . Student of technical college.
• physical data independence
• Weak entity types become relations • logical data independence
Employee of food city

– include all simple


– attributes include only components of
compound attributes
Multivalued Attributes Candidate and Primary Keys DDL

• Multivalued attributes must become new • If a relation has more than one minimal super Use to define and change database schemas create
relations key, each key is called a candidate key table, query, form in data definition language.
– FK to associated entity type • One candidate key must be chosen to be the
– PK is whole relation primary key Mainly create alter and drop SQL command used
under the DDL.
Binary 1:1 Relationships Foreign Key
DML
• Chose one of the related entity types to hold • Sometimes the information stored in a
the relationship relation is linked to the information stored in This language is used to insert, edit and delete
another relation. records is database. As well as it is use to filter the
– add primary key of other entity as foreign • This linking process done through some key. record in database.
key to other relation It is called as foreign key.
The Buffer Manager
Binary 1:N Relationships Entity Integrity Constraint
Buffer management is done for the efficient data
• 1:N Relationships become foreign key at N • The entity integrity constraint states that handling in database very large.
side primary keys can't be null.
• A proper value in the primary key field
If database is large than the main memory. Main
– any relationship attributes also go to N memory can’t Access database at same time.
side Referential Integrity
Three Schema Architecture
Binary M:N Relationships • It set between two tables (maintain the
consistency among rows)
The way of design database as three independent
• M:N Relationships must become a new layers call as three schema architecture.
relation The Relational Algebra

• External layers
contains PKs of both related entities • The relational algebra defines mathematical
– • Conceptual layers
– combined PKs become PK for new operations on relations
• Physical layers
relations • These operations define the meaning of SQL
queries
• Query optimization
Relation Schemas

• It is a named collection of attribute with at


least one unique attribute.
• Relation model is a collection of related
relational schemas.
Physical database Normalization Domains
it is collection of coherent data which is
created by mapping the mini word in to • Four normal forms: first, second, third, and • Each attribute has a name and a domain
electronic media. By creating physical data base, Boyce-Codd normal forms (1NF, 2NF, 3NF, and • A domain is a set of possible values.
we can obtain efficient and non-redundant way • All domains are sets of atomic values – RDM
BCNF)
does not allow complex data types
of access data.
• Normalization is a process that “improves” a Tuples
Advantages of SQL database design by generating relations that
are of higher normal forms. • A relation is a set
1. High level programing language compare to
• Attribute values within tuples are ordered
procedure language which provide data
Benefit of Normalization
abstract procedures.
Constraints
2. High speed language to retrieved data
• Aids in database design integration
compare to other languages.
• Ensure precise capture of business logo • Constraints are restrictions on legal relation
3. Less amount of code used. states
• Minimizes redundancy
4. Implementation is independent from the • Domain constraints
• Minimizes need for null values Non-null constraints
language. •
5. SQL application can be used platform
independent or can be easily converted to Functional Dependency Key Constraints
any platform.
6. Easy to handle security. • A functional dependency occurs when the • By definition, all tuples in a relation are unique
value of one (a set of) attribute(s) determines • Often, we want to restrict tuples further such
SQL the value of a second (set of) attribute(s) in that some subset of the attributes is unique
the same table: for all tuples
• Example: in the StockItem relation, no ItemID
Select name, class,/from student/where class=1
and mark<=400; SQL
Keys and Superkeys
Select */form dealer, infor../where ealer.dcode= • INSERT INTO Herd_in_to Values
• Any subset of attributes call key. unique key is
infor.dcode/group by sname ('CO230','C2',2,'Yes'),/ called a superkey
('CO230','C3',6,'Yes'),/('HO180','C3',20,' • A supper key which is no longer unique after
Create quary_04 as/ Yes'), discarding an attribute
• musql –h <localhost> –u <testuser> -
select SName,SAddress,Tel_No,Amount*Unit_Price p…………/
as Total_Price • Delete from customer,/ where
name=’www”;
create table teacher/ tname char(5),/taddress
varchar(15),/tid integer,/ddate date,/primery key
(ITd)

foreign key(icode)references item(icode),/

You might also like