1. RDBMS_SQL
1. RDBMS_SQL
KUAN
COMPUTER SCIENCE
STD. XII
RELATIONAL DATABASE MANAGEMENT
SYSTEM
UNIT III: DATABASE MANAGEMENT 20 MARKS
DATABASE
SQLite
PURPOSE OF DATABASE
RELATIONAL DATABASE MODEL
In relational database model data is organized into table (i.e.
rows and columns).
DEPARTMENT
DEPTNO DNAME LOCATION
10 HR NEW YORK
20 ACCOUNTS BRAZIL
30 SALES CANADA
40 IT INDIA
COMPONENTS OF A TABLE
Byt : group of 8 bits and is used to store a
e character.
Data Item : smallest unit of named data. It
represent one type of information and often referred
to as a field or column information
Informix, SAP
Sybase,
MySQL
Runs on virtually all platforms including Linux, Unix and Windows. Popular for
web based application and online publishing. It is a part of LAMP (Linux,
Apache, MySQL, PHP) stack
SQLite
Relational DBMS but it is not client-server database engine rather, it is
embedded into end program. Arguably the most widely deployed database
engine as it is used by several browsers, OS and embedded
systems(Mobiles).
PostgreSQL
General purpose object-relational DBMS. It is the most advanced open source
database system. It is free and open source i.e. source code is available
under PostgreSQL license, a liberal open source license.
COMMON DBMS TOOLS FOR MOBILE
DEVICES
1) Degree of Table =5
2) Cardinality of Table =4
3) Attributes of Table
4) Tuple
5) Data types of Book Code and Price
CONCEPT OF
KEYS
EMPNO ENAME GENDER DEPTNO SALARY COMM
1 ANKITA F 10 20000 1200
2 SUJEET M 20 24000
3 VIJAYA F 10 28000 2000
4 NITIN M 30 18000 3000
5 VIKRAM M 30 22000 1700
Allows only distinct (no duplicate) values and also forces mandatory entry
(NOT NULL) i.e. we cannot left it blank.
Candidate Key
In a table there can be more than one attribute which contains unique values.
These columns are known as candidate key as they are the candidate for
primary key.
Foreign key
Used to create relationship between two tables.
Foreign key column will for the value in Primary key of another table, if
present then entry will be allowed otherwise data will be rejected.
Primary Key column table from where values will be derived is known as
Primary Table or Master Table or Parent Table and Foreign key column
table will be Foreign Table or Detail Table or Child table
EMPLOYEE
EMPNO ENAME GENDER DEPTNO SALARY COMM
Child
1 ANKITA F 10 20000 1200 Table
2 SUJEET M 20 24000
3 VIJAYA F 10 28000 2000
4 NITIN M 30 18000 3000
5 VIKRAM M 30 22000 1700
DEPARTMEN
T DEPTNO DNAME LOCATION Paren
t
10 HR NEW YORK
Table
20 ACCOUNTS BRAZIL
30 SALES CANADA
40 IT INDIA
From the Above table definition we can observe that the DEPTNO column of
EMPLOYEE table is deriving its value from DEPTNO of table DEPARTMENT. So
we can say that the DEPTNO of EMPLOYEE table is a foreign key whose value is
dependent upon the Primary key column DEPTNO of table DEPARTMENT.
REFERENTIAL INTEGRITY
You cannot enter a value in Child Table which is not available in Master
Table’s Primary key column. However you can enter NULL values in
foreign key
You cannot delete a record from Master Table if matching record exists
in related table
You cannot modify or change the Primary Key value in Master table if its
matching record is present in related table.
BRIEF HISTORY OF MYSQL
The
Server
Listens for client requests in over
coming the
requirements
network and the
and access provide the
database asrequested
per
information to the Client the
The Client
Types
FEATURES OF MYSQL
Security
Offers privileges and password systems that is very flexible
and secure.
Scalability and Limits
Can handle large databases. Some of real life MySQL
databases contains millions of records.
Connectivity
vendors.
Pronounced as SEQUEL
SQL:2008
PROCESSING CAPABILITIES OF
SQL
DML is of 2 type
Procedural DML (in this we specify what data is needed and
how to get it)
Non-Procedural DML (in this we specify what data is
needed without specifying how to get it)