SlideShare a Scribd company logo
RDMS AND SQL
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.
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
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).
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
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.
• 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.
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.
•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.
Ø 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
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.
• • 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.
RDBMS ADVANTAGES
• INCREASESTHE SHARINGOF DATAANDFASTERDEVELOPMENTOF NEWAPPLICATIONS.
• SUPPORTA SIMPLEDATASTRUCTURE, NAMELYTABLESOR RELATIONS.
• LIMITREDUNDANCYOR REPLICATIONOF DATA.
• BETTERINTEGRITYAS DATAINCONSISTENCIESARE AVOIDEDBY STORINGDATAIN ONEPLACE.
• PROVIDEPHYSICAL DATAINDEPENDENCESO USERSDO NOTHAVETO BE AWAREOF UNDERLYINGOBJECTS.
• OFFERLOGICAL DATABASEINDEPENDENCE - DATACANBE VIEWEDIN DIFFERENTWAYSBY DIFFERENTUSERS.
• EXPANDABILITYIS RELATIVELYEASYTO ACHIEVEBY ADDINGNEWVIEWS OF THEDATAAS THEYARE
REQUIRED.
• SUPPORTONEOFF QUERIESUSINGSQL OR OTHER APPROPRIATELANGUAGE.
• BETTERBACKUP ANDRECOVERYPROCEDURES.
• PROVIDESMULTIPLEINTERFACES.
• SOLVESMANYPROBLEMSCREATEDBY OTHERDATAMODELS.
• THEABILITYTO HANDLEEFFICIENTLYSIMPLEDATATYPES.
• MULTIPLEUSERSCANACCESSWHICHIS NOT POSSIBLEIN DBMS.
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.
SCHEMA:
-LOGICAL STRUCTURE OF THE
DATABASE.
- DOESN’T SHOW THE DATA IN
DATABASE.
- CLASSIFICATION:- 1. PHYSICAL
2. CONCEPTUAL
3. EXTERNAL
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.
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.
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
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
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
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.
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
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.
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
RDMS AND SQL
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.
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.
–WHENAUSERWANTSTOGETSOMEINFORMATIONFROMA
DATABASEFILE,HECAN
ISSUEAQUERY.
–AQUERYISAUSER–REQUESTTORETRIEVEDATAOR
INFORMATIONWITHACERTAIN
CONDITION.
–SQLISAQUERYLANGUAGETHATALLOWSUSERTOSPECIFYTHE
CONDITIONS.(INSTEADOF
ALGORITHMS)
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.
z
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.
• 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.
EXAMPLE OF DATABASE QUERY
MADE BY – SATWIK KUMAR MEHTA

More Related Content

PPTX
Introduction to databases
PDF
Chapter 6 Database SC025 2017/2018
PPT
Database Concept by Luke Lonergan
PPT
Week 4 The Relational Data Model & The Entity Relationship Data Model
PPT
overview of database concept
PPT
Database intro
PPTX
PDF
Unit 3 rdbms study_materials-converted
Introduction to databases
Chapter 6 Database SC025 2017/2018
Database Concept by Luke Lonergan
Week 4 The Relational Data Model & The Entity Relationship Data Model
overview of database concept
Database intro
Unit 3 rdbms study_materials-converted

What's hot (19)

DOCX
Database
PPT
PDF
Unit 2 rdbms study_material
PPTX
Basic Concept of Database
PPTX
Database Concepts and Components
PPT
Lecture 01 introduction to database
PPT
A short introduction to database systems.ppt
PDF
Unit 4 rdbms study_material
PPTX
Database Part 2
PPTX
Intro To DataBase
PDF
Unit1 rdbms study_materials
PPT
Info systems databases
ODP
PDF
Introduction to Database
PPTX
Database Design
PPTX
Introduction to database
PPT
Electronic Databases
PPTX
Database Part 1
PPT
Database structure
Database
Unit 2 rdbms study_material
Basic Concept of Database
Database Concepts and Components
Lecture 01 introduction to database
A short introduction to database systems.ppt
Unit 4 rdbms study_material
Database Part 2
Intro To DataBase
Unit1 rdbms study_materials
Info systems databases
Introduction to Database
Database Design
Introduction to database
Electronic Databases
Database Part 1
Database structure
Ad

Similar to RDMS AND SQL (20)

PPTX
Database Management System Part-1.pptx
PPT
DBMS Full.ppt
PPTX
IET MySQL PPT Ver9ZESXRDCTFYVGBUHNIJOMK.pptx
PDF
03-database-management-system-revision-notes.pdf
PPTX
Ch 2-introduction to dbms
PPTX
Access
PPTX
DBMS (1).pptx
PDF
database1.pdf
PPTX
Chapter 7 Basic Data Storage.pptx
PPTX
DATABASE-1.pptx
PPT
Database and Database Management (DBM): Health Informatics
PDF
PPSX
PPTX
Data resource management and DSS
PPTX
MIS-3rd Unit.pptx
PPTX
MIS-3rd Unit.pptx
PPTX
IP-Lesson_Planning(Unit4 - Database concepts and SQL).pptx
DOC
Ms access Database
Database Management System Part-1.pptx
DBMS Full.ppt
IET MySQL PPT Ver9ZESXRDCTFYVGBUHNIJOMK.pptx
03-database-management-system-revision-notes.pdf
Ch 2-introduction to dbms
Access
DBMS (1).pptx
database1.pdf
Chapter 7 Basic Data Storage.pptx
DATABASE-1.pptx
Database and Database Management (DBM): Health Informatics
Data resource management and DSS
MIS-3rd Unit.pptx
MIS-3rd Unit.pptx
IP-Lesson_Planning(Unit4 - Database concepts and SQL).pptx
Ms access Database
Ad

Recently uploaded (20)

PDF
Business Ethics Teaching Materials for college
PDF
Insiders guide to clinical Medicine.pdf
PDF
Pre independence Education in Inndia.pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PDF
RMMM.pdf make it easy to upload and study
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PDF
Classroom Observation Tools for Teachers
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
Business Ethics Teaching Materials for college
Insiders guide to clinical Medicine.pdf
Pre independence Education in Inndia.pdf
O5-L3 Freight Transport Ops (International) V1.pdf
TR - Agricultural Crops Production NC III.pdf
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Module 4: Burden of Disease Tutorial Slides S2 2025
Week 4 Term 3 Study Techniques revisited.pptx
RMMM.pdf make it easy to upload and study
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
Classroom Observation Tools for Teachers
01-Introduction-to-Information-Management.pdf
Pharma ospi slides which help in ospi learning
Renaissance Architecture: A Journey from Faith to Humanism
PPH.pptx obstetrics and gynecology in nursing
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester

RDMS AND SQL

  • 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.
  • 13. RDBMS ADVANTAGES • INCREASESTHE SHARINGOF DATAANDFASTERDEVELOPMENTOF NEWAPPLICATIONS. • SUPPORTA SIMPLEDATASTRUCTURE, NAMELYTABLESOR RELATIONS. • LIMITREDUNDANCYOR REPLICATIONOF DATA. • BETTERINTEGRITYAS DATAINCONSISTENCIESARE AVOIDEDBY STORINGDATAIN ONEPLACE. • PROVIDEPHYSICAL DATAINDEPENDENCESO USERSDO NOTHAVETO BE AWAREOF UNDERLYINGOBJECTS. • OFFERLOGICAL DATABASEINDEPENDENCE - DATACANBE VIEWEDIN DIFFERENTWAYSBY DIFFERENTUSERS.
  • 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
  • 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.
  • 31. z
  • 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.
  • 35. MADE BY – SATWIK KUMAR MEHTA