SQL Notes Chapter 1
SQL Notes Chapter 1
SQL stands for Structured Query Language, and it is used to communicate with the
Database. This is a standard language used to perform tasks such as retrieval,
updating, insertion and deletion of data from a database.
Data
It is a raw fact which describes the attributes/properties of an entity.
Raw fact→unchanged
Entity→Object (living or non-living)
Database
It is place or medium which is used to store the data in a systematic and organized
manner.
Data
Database
File
Query
Language Database
DBMS
Data
Table
Database
Structured query
RDBMS
language
Difference between DBMS and RDBMS
DBMS RDBMS
1. Data will be stored in file format. 1. Data will be stored in table
format.
2. We use Query language to 2. We use Structured query
communicate with DBMS. language to communicate with
RDBMS.
3. Little bit difficult to store and 3. Easy to store and access the data.
access the data as compared to
RDBMS.
Relational model
➢ Relational model is invented by a data scientist E F Codd (Edgar Frank Codd).
➢ He gave the main rule as,
In RDBMS, we have to store the data in Table format.
Columns/Attributes/Fields
Rows/record/tuple
Cell
Table: A logical organization of rows and columns is called as table
Cell: The smallest unit of the table which is used to store the data is known as Cell.
The intersection of rows and columns creates a cell.
Rules of E F Codd
1. The data enter into a cell should be a single valued data.
2. In RDBMS, we store the data in table format including meta data.
Metadata: The data which describes another data is known as meta data.
Meta data are stored in meta tables which is automatically generated by the
compiler.
3. According to E F Codd, we can store the data in multiple tables, if required we
can establish the connection between 2 tables.
4. We can validate the data by 2 steps
1. By assigning datatypes.
2. By assigning constraints.
Note: Datatypes are mandatory and constraints are optional.