0% found this document useful (0 votes)
2 views12 pages

Understanding Data, DBMS, and SQL Concepts

Sql full notes
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views12 pages

Understanding Data, DBMS, and SQL Concepts

Sql full notes
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SQL

12 May 2025 09:11

1. What is Data ?

Ans :
Data is a raw fact which describes the attributes of an entity

=======================================================================

2. What is Database ?

Ans:

Database is a place or medium in which we can store the data in a systematic and
Organized manner.

The basic operations that can be performed on the database are Create,Read,Update And
Delete.

=======================================================================

3. What is DBMS ?

Ans:

-> DBMS stands for database management system

-> DBMS is a software which is used to maintain and manage the database

The two important features provided by the DBMS are

[Link]
[Link]

-> To communicate or interact with dbms we are using "QUERY LANGUAGE"

-> By using DBMS we can store the data in the form of files
=======================================================================

4. What is RDBMS ?

Ans:

-> RDBMS stands for Relational database management system

-> RDBMS is a type of dbms software which is used to maintain and manage the database

The two important features provided by the RDBMS are

[Link]
[Link]

-> To communicate or interact with rdbms we are using "Structured QUERY LANGUAGE"

-> By using RDBMS we can store the data in the form of tables

=========================================================================

[Link] is SQL ?

Ans:

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.

=========================================================================

6. List the Rules of E.F Codd ?

Ans:

Rules of E.F Codd


[Link] data entered into the cell must be a single valued data
[Link] rdbms we can store everything in the form of tables including meta data

metadata -> The details about a data is known as metadata

[Link] to E.F codd we can store the data in multiple tables if necessary we can
establish the connection between the tables with the help of key attributes (primary key
and foreign key)
[Link] data entered into the cell must be validated in two ways
[Link] using datatypes
[Link] using constraints

=======================================================================

7. What is Datatype and List the types

Ans :

Datatypes are used to specify what type of data or what kind of data can be stored in the
Memory location

Datatypes can be classified into 5 types

[Link]
[Link]/VARCHAR2
[Link]
[Link] OBJECT
->CHARACTER LARGE OBJECT
->BINARY LARGE OBJECT
[Link]

=======================================================================

8. What is Constraints and List the types


Ans :

Constraints are the rules which are assigned for each and every column for validating the
data

Constraints can be classified into 5 types

[Link]
[Link] NULL
[Link]()
[Link] KEY
[Link] KEY

=======================================================================

9. Explain about Primary Key

Ans :

Primary key is a constraint which is used to identify the records uniquely from the
table.

Characteristics of Primary Key


==========================
Primary key will not accept null
Primary key will not accept duplicate or repeated values
Primary key is the combination of UNIQUE and NOT NULL constraints
There can be only one primary key in the table
Primary key is not mandatory but highly recommended

=======================================================================

10. Explain about Foreign Key

Ans :

Foreign key is a constraint which is used to established the connection between the tables.

Characteristics of Foreign Key


==========================
Foreign key will accept null
Foreign key will accept duplicate or repeated values
Foreign key is not a combination of UNIQUE and NOT NULL constraints
There can be multiple foreign key in the table
foreign key is also known as referential integrity constraint

=======================================================================

11. List the statements in SQL

Ans:

[Link] Definition Language (DDL) statement


[Link] Manipulation Language (DML) statement
[Link] Control Language (TCL) statement
[Link] Control Language (DCL) statement
[Link] Query Language (DQL) statement

==========================================================================

12. What is DQL ?

Ans:
DQL is used to retrieve the data from the database

DQL contains 4 statements, they are

[Link]
[Link]
[Link]
[Link]

===========================================================================

13. What is Projection ?

Ans:
It is a process of retrieving the data from the table by selecting only
the columns is known as Projection

=========================================================================

14. Explain about DISTINCT clause ?

Ans:

Distinct clause is used to remove the duplicate values or repeated values


in the result table

==========================================================================

15. What is SELECTION ?

Ans:

The process of retrieving the data from the table by selecting both rows and
columns is Known as SELECTION

===========================================================================

16. Explain about WHERE clause ?

Ans:

WHERE clause is to filter the records


============================================================================

17. What is Function ?

Ans :

Functions are the block of code or set of instructions which are given to
perform a specific Task.

============================================================================
18. What is HAVING clause ?

Ans:

Having clause is used to filter the groups

=========================================================================

19. What is Group By Clause ?

Ans:

Group By clause is used to group the records

==========================================================================

20. What is Subquery and List the types

Ans:

Subquery
=========

A query written inside another query is known as sub query

We are having 2 types of Subquery

[Link] row subquery


[Link] row subquery

[Link] row subquery


==================

If the inner query returns exactly only one record then it is known as
single row subquery
[Link] row subquery
=================

If the inner query returns more than one record then it is known as
multi row subquery

=====================================================================

21. What is nested sub query ?

Ans :

A subquery written inside another subquery is known as nested subquery

=====================================================================

22. What is JOINS ? And Mention the types

Ans :

The process of retrieval of data from multiple tables simultaneously is known


As JOINS

1. CARTESIAN JOIN / CROSS JOIN:

A record from table one will be merged with all the records of table 2.

2. INNER JOIN:

It is used to obtain only matching records.

3. OUTER JOIN:

It is used to obtain unmatched records.

A. Left Outer Join:

It is used to obtain unmatched record from left table along


with matching records.
B. Right Outer Join:

It is used to obtain unmatched record from right table along


with matching records.

C. Full Outer Join:

It is used to obtain unmatched records from both tables along with matching
records.

4. NATURAL JOIN: It is a combination of Inner Join & Cartesian Join.

5. SELF JOIN: It is used to join the table by itself.

=====================================================================

23. Explain about DDL ?

Ans:

DDL
===
DDL is used to construct an object in the database and deals with the structure
of the Object

It has 5 statements
================
CREATE
RENAME
ALTER
TRUNCATE
DROP

[Link] : IT IS USED TO BUILD/CONSTRUCT AN OBJECT

[Link] : IT IS USED TO CHANGE THE NAME OF THE OBJECT

3. ALTER : IT IS USED TO MODIFY THE STRUCTURE OF THE TABLE


[Link] : IT IS USED TO REMOVE ALL THE RECORDS FROM THE TABLE
PREMANENTLY

[Link]: IT IS USED TO REMOVE THE TABLE FROM THE DATABASE

=====================================================================

24. Explain about DML?

Ans:

It is used to Manipulate the Object by performing insertion , updating and deletion .

It has 3 statements

[Link]
[Link]
[Link]

[Link] : It is used to insert / create records in the table

[Link] :It is used to modify an existing value

[Link] : It is used to remove a particular record from the table .

=====================================================================

24. Explain about TCL ?

Ans:
TCL
====
"It is used to control the transactions done on the database "

IT HAS 3 STATEMENTS
[Link]
[Link]
[Link]

[Link]
===========
This statements is used to save the transactions into the database

[Link]
============
This statement is used to Obtain only the saved data from the DB .

[Link]
===========
This statement is used to mark the positions or restoration points . (nothing related
to DB ) .

======================================================================

25. Explain about DCL ?

Ans:

"This statement is used to control the flow of data between the users ".

We have 2 statements :

[Link]

2. REVOKE

GRANT : THIS STATEMENT IS USED TO GIVE PERMISSION TO A USER .

REVOKE :THIS STATEMENT IS USED TO TAKE BACK THE PERMISSION FROM THE USER
====================================================================

You might also like