SQL 1
SQL 1
SQL 1
SQL
Status In progress
❔ Interview Questions
Data
Data is a rawfact (real/pure information) which describes the
attribute (properties) of an entity (object).
Database
It is a place/container used to store data in a systematic and organized
manner.
SQL 1
It is an operation used to create, read, update & delete the database.
Types of DBMS
SQL 2
Relational DBMS (RDBMS)
A DBMS which communicates through query language called SQL and
stores the data in table format is known as RDBMS.
It can handle large data and is secure in most cases since it is just the
data written in table format.
Characteristics of DBMS
SQL
Examples-
Oracle - MySQL
Microsoft - MS SQL
Amazon - MongoDB
SQL 3
What is the difference between excel and SQL?
Relational Model
E. F. CODD RULE
Rule no. 1: Data entered into the cell should be single-valued or atomic
data.
Rule no. 2: We can store the data in multiple tables & also establish
connections through key attributes.
Rule no. 3: To validate the data entered into the cell use datatype &
constraints (validation for unique value).
Datatypes
Datatype is a type of data or a kind of data used to store in memory.
SQL 4
Character datatype
Syntax : Char( );
Use case - Can be used when the length of the entry is defined.
Variable datatype
Syntax : Varchar( );
SQL 5
Shows slower data processing due to its dynamic length.
Use case - Can be used when the length of the entry is not defined.
Object datatype
Syntax: CLOB;
example:
ORACLE: 4 GB
MySQL: 12-14 GB
Syntax: BLOB;
max size- 4 GB
Date datatype
Syntax: Date;
SQL 6
Number datatype
range: 1- 38
range: 0- 38
Constraints
Constraints are the set of conditions or the set of rules which
are used to validate the data entered into the cell.
Types of constraints
Unique constraint
Syntax- Unique( );
SQL 7
Not Null
Restricts NULL value from being inserted into a column.
Use case - Can be used for mandatory entries such as Name, E-mail,
address and contact which can’t be kept null.
5+0=5
5 + NULL = NULL
Check constraint
Verifies that all values in a field satisfy a condition.
For example :
Salary condition
Primary Key
Primary key is a key which uniquely identifies row or a column in a
table.
SQL 8
Characteristics :
1. It should be unique.
Foreign Key
Ensures referential integrity for a record in another table.
It can be unique.
Primary key of one table should be the foreign key of another table.
SQL 9