Date post: | 10-Dec-2023 |
Category: |
Documents |
Upload: | independent |
View: | 0 times |
Download: | 0 times |
OBJECTIVE
To understand the main concept of data base management system and what data base is all
about.
To exhibit how data’s are been categorized in IPL using data base management system.
INTRODUCTION TO DBMS Data base is a vital part of any organization.
It needs to be stored, organized, managed, accessed, protected and manipulated.
The database is used to keep track of things unlike a list or spreadsheet, a database may store information that is more complicated than a simple list.
PURPOSE OF DATABASE
In early days, database applications were built on top of file systems.
The difficulties faced in file system was that,
• Multiple file format• Duplication of information in different files• Integrity problems• Atomicity of updates• Security problems
TYPES OF DATABASE
Operational database End – User database Centralized database Distributed database Personal database Commercial database
APPLICATION OF DATABASE Numeric and Textual Database Multimedia Database Geographic Information Systems Data Warehouse and OLAP Real – time and Active Database
ADVANTAGES OF DATABASE Minimal data redundancy Improved data consistency Improved data sharing Enforcement of standards Improved data quality Improved data accessibility Reduced program maintenance
DIS-ADVANTAGES OF DATABASEo Initial installment is high
o Training is required
o Unauthorized access
o Complex recovery
DATABASE SECURITYTypes Of Security:
Legal and ethical issues Policy issues System-related issues The need to identify multiple security levels
TYPES OF SECURITY
Legal and ethical issues:This is regarding the right to access
certain information. Some information may be deemed to be private and cannot be accessed legally by unauthorized persons. Policy issues:
At the governmental, institutional, or corporate level as to what kind of information should not be made publicly available.
Continued…...
System-related issues:Issues such as the system level at which
various security functions should be enforced like hardware level or DBMS level or OS level. The need to identify multiple security levels:
In some organizations there is a need for multiple security levels and to categorize the data and users based on these classifications like top secret, secret, confidential.
SOME IMPORTANT TERMS RELATING TO DBMS:
Data modeling:Data modeling refers to on what type of
data should be stored on the database and how to process the data.
Entities: Entities are the main data objects through which we can collect information. Any occurrence of an entity is called an entity instance.
Continued….
Attributes:Attributes are the behaviors of entities
which provide detailed information about them. Key attribute is used to identify a unique instance of an entity.
Relationships:A relationship represents the association
between one or more entities. Types of relationship are one to-one, many-to-one, one-to-many and many-to-many.
Team Owner Captain Coach Home Ground
GMR Group Jean Paul Duminy
Paddy Upton Feroz Shah Kotla,Delhi
Reliance Industries
Rohit Sharma
Ricky Ponting
Wankhede Stadium
Sanjiv Goenka
M.S.Dhoni Stephen Fleming
Maharashtra Cricket
Stadium, Pune
Red Chillies Entertainme
nt,Juhi
Chawla, Mehta Group
Gautam Gambhir
Jacques Kallis
Eden Gardens Kolk
ata
Team Owner Captain Coach Home Ground
P.Zinta,N.Wadia
M.Burman The Oberoi Grp Karan
Paul
Murali Vijay Sanjay Bangar
Vidarbha Cricket
Association Stadium,Nag
pur
Kalanidhi Maran (Sun Network)
David Warner
Tom Moody Rajiv Gandhi International
Cricket Stadium, Hy
derabadUnited Spirits
Virat Kohli Daniel Vettori
M.Chinnaswamy Stadium
Keshav Bansal (Intex Technologies
)
Suresh Raina Brad Hodge Saurashtra Cricket
Association Stadium, Raj
kot
DATABASE OBJECTS
OBJECT DESCRIPTIONTable Basic unit of storage,
composed of rowsView Logically represents
subsets of data from one or more tables
Sequence Generate numeric valuesIndex Improves the
performance of some queries
Synonym Gives alternative name to an object
E-R Diagram
Table: Ground
Ground Id Ground Name
Team NameLocation
Table: Team List
Team IdTeam Name
OwnerCaptain IdCoach Id
Ground ID
Table: CaptainsCaptain Id
NameTeam Name
Nationality Id
Table: CoachCoach Id
Coach NameTeam Name
Nationality Id
Table: NationalityNationality IdNation Name
ICC ODI RankingICC T20 RankingICC Test Ranking
SQL COMMANDS
• Number :Numeric values with or with out decimal points.
• Varchar :Accepts alphanumeric type of data. • Date :Stores calendar data's
DDL DML TCL DCL
CREATE INSERT COMMIT GRANTALTER SELECT ROLLBACK REVOKE
TRUNCATE UPDATEDROP DELETE
Basic Data Types
CREATE Create command is used to create table in
database.Syntax:CREATE TABLE table name (col1 data type (size),col2….);Eg: CREATE TABLE team (team_id NUMBER(5) PRIMARY KEY,
team_name VARCHAR2(20),owner VARCHAR(20),captain_id NUMBER(10) UNIQUE,coach_id NUMBER(10) UNIQUE,ground_id NUMBER UNIQUE(5));
Column Name Constraints Data Type
Team Id Primary key / Unique
Number(5)
Team Name Varchar2(20)
Owner Varchar2(20)
Captain Id Unique Number(10)
Coach Id Unique Number(10)
Ground Id Unique Number(5)
STRUCTURE - TEAM
INSERT
Used to insert records into a table. Syntax :
INSERT INTO table_name (COL1,COL2,…)
VALUES(VAL1, VAL2…);
E.g.:
INSERT INTO team VALUES(01,’Mumbai Indians’,’Reliance’,101,501,1002);
01 Mumbai Indians Reliance 101 501 1002
SELECT To retrieve record from a table.Eg: SELECT Captain_Name FROM captains;
Captain_Name
M.S DhoniGautham GambhirRohit SharmaJ.P DuminyMurali VijayVirat KohliSuresh RainaDavid Warner
SELECT * FROM team ;
Team Id
Team Name Owner Captain Id
Coach Id
Ground Id
01 Mumbai Indians Reliance 101 501 1002
02 Delhi Daredevils GMR Group 102 502 1001
03 Kolkata Knight
Riders
Red Chillies
Entertainmen
t
108 505 1003
TABLE 1- TEAM
Ground Id Ground Name Team Name Location
1001 Feroz Shah Kotla Delhi Daredevils Delhi
1002 Wankhede Mumbai Indians Mumbai
1003 Eden Gardens Kolkata Knight Riders
Kolkata
TABLE 2 - GROUND
Captain Id Captain Name Team Nationality id
101 Rohit Sharma Mumbai Indians 901
102 J.P.Duminy Delhi Daredevils 902
108 Gautam Gambhir
Kolkata Knight Riders
901
TABLE 3 - CAPTAIN
Player Id
Name Matches
Runs Average
Strike Rate
H. Score
101 R. Sharma 5 167 41.25 137.50 84*102 A.Rayudu 5 127 31.75 107.62 54103 Jos Butler 5 96 19.20 137.14 41104 P. Patel 4 72 18.00 107.46 34105 K.Pandya 3 69 ---- 176.92 49*106 Harbhajan 5 54 54.00 117.39 45*107 K.Pollard 4 43 21.50 138.70 40*108 T.Southee 4 25 25.00 227.27 25109 M.McClen 5 11 22.00 220.00 20110 V.Kumar 1 12 12.00 109.09 12111 L.Simmons 1 8 8.00 100.00 8112 S.Gopal 1 2 2.00 12.50 2113 M.Guptill 1 2 2.00 50.00 2
TABLE 4 - MUMBAI INDIANS
CONSTRAINTS
Ensures data integrity. Helps to prevent invalid entry into
tables. Enforces rules on the data in a table
whenever a row is inserted, updated or deleted from that table.
Prevent deletion of table if there are dependencies from other table
CONSTRAINT TYPE’S • Not Null Constraint: Specifies that the column cannot
contain a null value• Check constraint: Specifies a condition that must be
true• Unique constraint:• Specifies a column or combination of columns whose
values must be unique for all rows in the table.• Primary Key: Uniquely identifies each row of the table• Foreign Key: Used for referencing data