0% found this document useful (0 votes)
18 views19 pages

Introduction To DBMS: Friday, March 14, 2008

The document provides an introduction to database management systems (DBMS). It discusses what a DBMS is, its goals of efficiently storing and retrieving data, and common examples like Oracle, DB2, Microsoft SQL Server. It also describes database concepts like tables that contain data, entity relationships between tables, attributes that describe entities, keys that uniquely identify records, and the structured query language SQL that is used to perform queries, insertions, deletions and updates of data in a database.

Uploaded by

Syed Irfan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views19 pages

Introduction To DBMS: Friday, March 14, 2008

The document provides an introduction to database management systems (DBMS). It discusses what a DBMS is, its goals of efficiently storing and retrieving data, and common examples like Oracle, DB2, Microsoft SQL Server. It also describes database concepts like tables that contain data, entity relationships between tables, attributes that describe entities, keys that uniquely identify records, and the structured query language SQL that is used to perform queries, insertions, deletions and updates of data in a database.

Uploaded by

Syed Irfan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 19

Introduction to DBMS

ASP.NET
http://sdetu/courses/sdetc101/
Lecture 12
Friday, March 14, 2008
Story So Far…

 What is Object?

 What is class?

 Core ASP.NET Objects

14 March 2008 ASP.NET 2


Introduction to DBMS
 A database management system (DBMS) is computer software designed for the
purpose of managing databases. Typical examples of DBMSs include Oracle,
DB2, Microsoft Access, Microsoft SQL Server,

 Collection of interrelated data & a set of program to access those data.

 Goal is to provide way to store and retrieve data in an efficient and convenient
manner.

 Word MANAGEMENT means- to provide mechanism for:


• Defining structure for storage of information.
• Providing mechanism for manipulation of stored data.
 Safety Mechanism
14 March 2008 ASP.NET 3
Database System App.
 Banking

 Airlines

 Universities

 Credit card transactions

 Finance

 Manufacturing

 Human resources

 Sales…

14 March 2008 ASP.NET 4


Tables

 Databases consists of many related tables.

 Table contains a part of data.

 Table can be thought of as a class.

 Each row can represent the instances of the class.

14 March 2008 ASP.NET 5


Entity Relationships
 A database can be modeled as:
• a collection of entities,
• relationship among entities.
 An entity is an object that exists and is distinguishable from
other objects.
• Example: specific person, company, event, plant
 Entities have attributes
• Example: people have names and addresses
 An entity set is a set of entities of the same type that share
the same properties.
• Example: set of all persons, companies, trees, holidays

14 March 2008 ASP.NET 6


Attributes
 An entity is represented by a set of attributes, that is descriptive
properties possessed by all members of an entity set.

Domain – the set of permitted values for each attribute


 Attribute types:
• Simple and composite attributes.

• Single-valued and multi-valued attributes

 E.g. multivalued attribute: Degree : BA, BSc, PhD


• Derived attributes
 Can be computed from other attributes

 E.g. age, given date of birth

14 March 2008 ASP.NET 7


Composite Attributes

14 March 2008 ASP.NET 8


Relationship

 A relationship is an association among several entities


A relationship is a logical association between two types of
entities.
 Consider books and bookstores:
• Bookstore orders books
• Bookstore displays books
• Bookstore stocks books
• Bookstore sells books
• Bookstore returns books

14 March 2008 ASP.NET 9


Relationship…
• One to One

• One to Many

• Many to Many

14 March 2008 ASP.NET 10


Keys
 Primary Key
The primary key is an attribute or a set of attributes that uniquely identify
a specific instance of an entity. Every entity in the data model must have
a primary key whose values uniquely identify instances of the entity.

To qualify as a primary key for an entity, an attribute must have the


following properties:
• It must have a non-null value for each instance of the entity
• The value must be unique for each instance of an entity
• The values must not change or become null during the life of each
entity instance

 Candidate Key
Any key or minimum set of keys that could be a primary key is called a
candidate key.
14 March 2008 ASP.NET 11
Keys…
 Composite Keys
Sometimes it requires more than one attribute to uniquely
identify an entity.

A (primary) key that made up of more than one attribute is


known as a composite key.

 Foreign Keys
An attribute that appears as a nonprimary key attribute in one
relation and as a primary key attribute (or part of a primary
key) in another relation.

14 March 2008 ASP.NET 12


SQL

 SQL stands for Structured Query Language


 SQL allows you to access a database
 SQL can execute queries against a database
 SQL can insert, delete, update & retrieve data from a
database
 SQL works with databases like MS Access, DB2, MySql, MS
SQL Server, Oracle, etc
 SQL is easy to learn…..

14 March 2008 ASP.NET 13


SQL Database Tables
 A database most often contains one or more tables.
 Table is identified by a name (e.g. "Customers" or "Orders")
 Tables contain records (rows) with data.
 Example: Persons

LastName FirstName Address City

Hansen Ola Timoteivn 10 Sandnes

Svendson Tove Borgvn 23 Sandnes

Pettersen Kari Storgt 20 Stavanger

14 March 2008 ASP.NET 14


SQL Queries
 With SQL, we can query a database and have a result set returned.
 A query like this:
• SELECT LastName FROM PersonsGives a result set like this:

LastName

Hansen

Svendson

Pettersen

14 March 2008 ASP.NET 15


SQL Queries…
 SQL Queries are categorized into :
• SQL Data Definition Language (DDL)
• SQL Data Manipulation Language (DML)

14 March 2008 ASP.NET 16


SQL Data Definition Language (DDL)

 The Data Definition Language (DDL) part of SQL permits database tables
to be created or deleted.
 We can also define indexes (keys), specify links between tables, and
impose constraints between database tables.
 The most important DDL statements in SQL are: 

• CREATE TABLE - creates a new database table


• ALTER TABLE - alters (changes) a database table
• DROP TABLE - deletes a database table
• CREATE INDEX - creates an index (search key)
• DROP INDEX - deletes an index

14 March 2008 ASP.NET 17


14 March 2008 ASP.NET 18
14 March 2008 ASP.NET 19

You might also like