Data is a collection of distinct pieces of information that can be stored and processed digitally. A database is an organized collection of structured data stored digitally. A database management system (DBMS) is software that allows users to define, create, maintain and control access to a database. Common DBMSs include Oracle, SQL Server, and MySQL. Relational databases organize data into tables with rows and columns and allow users to define relationships between tables. Keys like primary keys and foreign keys help define these relationships and uniquely identify rows. Structured Query Language (SQL) is used to communicate with databases to perform operations like querying and updating data.
2. WHAT IS DATA ?
Data is a collection of a distinct small
unit of information. It can be used in a
variety of forms like text, numbers, media,
bytes, etc. It can be stored in pieces of
paper or electronic memory, etc.
Word 'Data' is originated from the word
'datum' that means 'single piece of
information.' It is plural of the word
datum.
In computing, Data is information that can
be translated into a form for efficient
movement and processing. Data is
interchangeable.
3. WHAT IS DATABASE ?
The database is an organized collection of structured data to make
of books of different genres, here the library is database and books are the data.
it easily accessible, manageable and update. In
simple words, you can say, a database is a
place where the data is stored. The best
analogy is the library. The library contains a
huge collection
4. Database
ManagementSystem
A Database Management
System is a collection of
programs that allows users
to specify the structure of a
database, to create, query
and modify the data in the
database and to control
access to it. (e.g. limit
access to the database so
that only relevant staff can
access details of enrolling
students).
5. S o m e o f t h e c o m m o n u s e d D B M S s
a r e :
- O R A C L E , I B M ’ S D B 2 , M i c r o s o f t ’ s S Q L
S E R V E R , M S - A c c e s s A n d I n f o r m i x .
• S o m e o f t h e d e s k t o p b a s e d D B M S s
a r e :
- M i c r o s o f t F o x p r o , B o r l a n d D B A S E
A n d
M i c r o s o f t A c c e s s .
EXAMPLESOF DBMS
6. Controlling Data Redundancy : Data is recorded in
only one place in the database and it is not duplicated.
• Data Consistency : Data item appears only once, and
the updated value is immediately available to all users.
• Control Over Concurrency : In a computer file-based
system in updating, one may overwrite the values recorded by the other.
7. • Backup and Recovery Procedures :
automatically create the backup of data and restore data if
required.
• Data Independence : Separation of data
structure of database from application program that uses
the data is called data independence.
8. Cost of Hardware and Software : Processor with high speed of data
processing and memory of large size is required.
• Cost of Data Conversion : Very difficult and costly method to convert
convert data of data file into database.
• Cost of Staff Training : A lot of amount for the training of staff to run
run the DBMS.
9. •Appointing Technical Staff : Trained technical persons
such as database administrator, application programmers, data
programmers, data entry operators etc. are required to handle
handle the DBMS.
• Database Damage : All data is integrated into a single
database. If database is damaged due to electric failure or
or database is corrupted on the storage media, then your
valuable data may be lost forever.
10. Ø Banking : for transactions.
Ø Airlines : reservation and schedules.
Ø Tele communications : for retrieving data of user.
Ø Credit card : for transactions.
Ø Universities : registration, retrieving marks,
applications, grades.
Ø Human resources : employee records, salaries, tax
deductions
APPLICATIONSOF
RDMS
11. Relational Database Management System(RDBMS)
• • Most popular database system.
• • Simple and sound theoretical basis.
• • Developed by E F Codd in the early 1970's.
• • The model is based on tables, rows and columns and the
manipulation of data stored within.
• • Relational database is a collection of these tables.
12. • • First commercial system: MULTICS in 1978.
• • Has overtaken Hierarchical and Network models.
• • Main feature: Single database can be spread across
several tables.
• • Examples include: Oracle, IBM's DB2, Sybase, MySQL
& Microsoft Access.
14. • EXPANDABILITYIS RELATIVELYEASYTO ACHIEVEBY ADDINGNEWVIEWS OF THEDATAAS THEYARE
REQUIRED.
• SUPPORTONEOFF QUERIESUSINGSQL OR OTHER APPROPRIATELANGUAGE.
• BETTERBACKUP ANDRECOVERYPROCEDURES.
• PROVIDESMULTIPLEINTERFACES.
• SOLVESMANYPROBLEMSCREATEDBY OTHERDATAMODELS.
• THEABILITYTO HANDLEEFFICIENTLYSIMPLEDATATYPES.
• MULTIPLEUSERSCANACCESSWHICHIS NOT POSSIBLEIN DBMS.
15. RDBMS DISADVANTAGES
•Software is expensive.
• Complex software means expensive hardware.
• Requires skilled knowledge to implement.
• Certain applications are slower processing.
• Increased vulnerability.
• More difficult to recover if data is lost.
• Seen as a poor representation of the real world.
• Difficult to represent hierarchies.
• Difficult to represent complex data type.
16. SCHEMA:
-LOGICAL STRUCTURE OF THE
DATABASE.
- DOESN’T SHOW THE DATA IN
DATABASE.
- CLASSIFICATION:- 1. PHYSICAL
2. CONCEPTUAL
3. EXTERNAL
17. Cont…
1. Physical Schema:
-Describes the physical storage of database.
-Not in terms of blocks or devices, but describes
organization of files, access path etc.
2. Conceptual Schema:
-Describes structure of whole database.
-Describes entities their relationships and
constraints.
3. External Schema:
-Provides a user’s view of data.
-Shows relevant info particular to user, hides rest
of the info.
-one or more levels.
4. Instances: Actual data contained in
database at a particular point of time.
18. TABLES
In Relational database model, a table is a collection of data elements organised in
terms of rows and columns. A table is also considered as a convenient representation
of relations. But a table can have duplicate row of data while a true relation cannot
have duplicate data. Table is the most simplest form of data storage.
Below is an example of an Employee table.
19. ES
A SINGLE ENTRY IN A TABLE IS CALLED A TUPLE OR RECORD OR ROW. A TUPLE IN A TABLE REPRESENTS A SET
OF RELATED DATA. FOR EXAMPLE, THE PREVIOUS SLIDE EMPLOYEE TABLE HAS 4 TUPLES/RECORDS/ROWS.
FOLLOWING IS AN EXAMPLE OF SINGLE RECORD OR TUPLE.
1 Adam 34 13000
20. FIELDS / ATTRIBUTES
A database field is a set of data values, of the same data type, in a table. It is also referred to
as a column or an attribute.
Most databases also allow fields to hold complex data like pictures, entire files, and even movie clips. A field that allows the same
data type does not mean it only has simple text values. Some databases allow the data to be stored as a file on the Operating
System, while the field data only contains a pointer or link to the actual file. This is done to keep the database size manageable, given
that smaller database sizes means less time for backups, as well as for searching data within the database.
A simple example is a table that saves employee’s job record. The fields in this table could be the following: Employee ID, Last
Name, First Name, Position, Department, and Hire Date.
Employee ID Last Name First Name Position Department Hire Date
00108 Doe John
Assistant
Manager
Human
Resources
November 16,
2000
00109 Parker Anne Supervisor
Financial
Services
May 1, 2003
21. WHAT ARE KEYS IN DBMS?
KEYS IN DBMS IS AN ATTRIBUTE OR SET OF ATTRIBUTES WHICH
HELPS YOU TO IDENTIFY A ROW(TUPLE) IN A RELATION(TABLE).
THEY ALLOW YOU TO FIND THE RELATION BETWEEN TWO TABLES.
KEYS HELP YOU UNIQUELY IDENTIFY A ROW IN A TABLE BY A
COMBINATION OF ONE OR MORE COLUMNS IN THAT TABLE.
DATABASE KEY IS ALSO HELPFUL FOR FINDING UNIQUE RECORD OR
ROW FROM THE TABLE.
Employee ID FirstName LastName
11 Andrew Johnson
22 Tom Wood
33 Alex Hale
22. PRIMARY KEY
PRIMARY KEY IS A COLUMN OR GROUP OF COLUMNS IN A TABLE THAT UNIQUELY
IDENTIFY EVERY ROW IN THAT TABLE. THE PRIMARY KEY CAN'T BE A DUPLICATE
MEANING THE SAME VALUE CAN'T APPEAR MORE THAN ONCE IN THE TABLE. A
TABLE CANNOT HAVE MORE THAN ONE PRIMARY KEY.
RULES FOR DEFINING PRIMARY KEY:
•TWO ROWS CAN'T HAVE THE SAME PRIMARY KEY VALUE.
•IT MUST FOR EVERY ROW TO HAVE A PRIMARY KEY VALUE.
•THE PRIMARY KEY FIELD CANNOT BE NULL.
•THE VALUE IN A PRIMARY KEY COLUMN CAN NEVER BE MODIFIED OR UPDATED IF
ANY FOREIGN KEY REFERS TO THAT PRIMARY KEY.
23. EXAMPLE OF PRIMARY KEY
INTHE FOLLOWING EXAMPLE, <CODE>STUDID</CODE> ISA PRIMARY KEY
Student ID Roll No First Name LastName Email
1 11 Tom Price abc@gmail.com
2 12 Nick Wright xyz@gmail.com
3 13 Dana Natan mno@yahoo.co
m
24. FOREIGN
KEY
FOREIGN KEY is a column that creates a relationship
between two tables. The purpose of Foreign keys is to
maintain data integrity and allow navigation between two
different instances of an entity. It acts as a cross-reference
between two tables as it references the primary key of
another table.
25. EXAMPLE OF FOREIGN
KEY
Dept. Code Dept. Name
001 Science
002 English
005 Computer
Teacher ID First name Last name
B002 David Warner
B017 Sara Joseph
B009 Mike Brunton
26.
27. SQL
SQL (pronounced "ess-que-el") stands for Structured Query Language. SQL
is used to communicate with a database. According to ANSI (American
National Standards Institute), it is the standard language for relational
database management systems. SQL statements are used to perform tasks
such as update data on a database, or retrieve data from a database. Some
common relational database management systems that use SQL are: Oracle,
Sybase, Microsoft SQL Server, Access, Ingres, etc.
28. Although most database systems use SQL, most of them also have their own
additional proprietary extensions that are usually only used on their system .
However, the standard SQL commands such as "Select", "Insert", "Update",
"Delete", "Create", and "Drop" can be used to accomplish almost everything
that one needs to do with a database.
30. Introduction
to SQL…
Concept of SQL
– The user specifies a certain condition.
– The program will go through all the records in
the database file and select those records that
satisfy the condition.(searching).
– Statistical information of the data.
– The result of the query will then be stored in
form of a table.
32. QUERIES
• At a very high level, a query is a question. When we talk about
queries in relation to other people, we expect some sort of
answer in return. This is no different for computers when we
perform database queries.
• A database query is a similar action that is most closely
associated with some sort of CRUD (create, read, update,
delete) function. A database query is a request to access data
from a database to manipulate it or retrieve it.
33. • This allows us to perform logic with the information we get in
response to the query. There are several different approaches to
queries, from using query strings, to writing with a query
language, or using a QBE like GraphQL or REST.
• With GraphQL, users can query for and receive only the specific
data they’re looking for; not more, not less.