0% found this document useful (0 votes)
72 views

Lecture-2: Structured Query Language (Basics)

The document provides an overview of structured query language (SQL) including what SQL is, why it is widely popular, the SQL process, SQL constraints, data integrity, SQL data types, logical operators, and types of SQL commands. SQL is a language used to store, manipulate, and retrieve data from relational databases and offers advantages like allowing users to access, describe, define, and manipulate data within databases. The SQL process involves components like a query dispatcher and optimization engines to determine how to carry out requests.

Uploaded by

Shubham Shukla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views

Lecture-2: Structured Query Language (Basics)

The document provides an overview of structured query language (SQL) including what SQL is, why it is widely popular, the SQL process, SQL constraints, data integrity, SQL data types, logical operators, and types of SQL commands. SQL is a language used to store, manipulate, and retrieve data from relational databases and offers advantages like allowing users to access, describe, define, and manipulate data within databases. The SQL process involves components like a query dispatcher and optimization engines to determine how to carry out requests.

Uploaded by

Shubham Shukla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

LECTURE-2

STRUCTURED QUERY LANGUAGE


(BASICS)

Delivered By:
M r. S h u b h a m S h u k l a
WHAT IS SQL?
SQL is Structured Query Language, which is a computer language for storing,
manipulating and retrieving data stored in a relational database.

Why SQL?
SQL is widely popular because it offers the following advantages:
• Allows users to access data in the relational database management systems.
• Allows users to describe the data.
• Allows users to define the data in a database and manipulate that data.
• Allows to embed within other languages using SQL modules, libraries & pre-
compilers.
• Allows users to create and drop databases and tables.
• Allows users to create view, stored procedure, functions in a database.
• Allows users to set permissions on tables, procedures and views.
SQL Process
• When you are executing an SQL command for any RDBMS, the system
determines the best way to carry out your request and SQL engine figures out
how to interpret the task. There are various components included in this
process.
These components are –
Query Dispatcher
Optimization Engines
Classic Query Engine
SQL Query Engine, etc.
• A classic query engine handles all the non-SQL queries, but a SQL query
engine won't handle logical files.
• Following is a simple diagram showing the SQL Architecture:
SQL CONSTRAINTS
• NOT NULL Constraint: Ensures that a column cannot have a NULL value.
• DEFAULT Constraint: Provides a default value for a column when none is
specified.
• UNIQUE Constraint: Ensures that all the values in a column are different.
• PRIMARY Key: Uniquely identifies each row/record in a database table.
• FOREIGN Key: Uniquely identifies a row/record in any another database
table.
• CHECK Constraint: The CHECK constraint ensures that all values in a
column satisfy certain conditions.
• INDEX: Used to create and retrieve data from the database very quickly.
DATA INTEGRITY
• The following categories of data integrity exist with each RDBMS:
Entity Integrity: There are no duplicate rows in a table.
Domain Integrity: Enforces valid entries for a given column by
restricting the type, the format, or the range of values.
Referential integrity: Rows cannot be deleted, which are used by other
records.
User-Defined Integrity: Enforces some specific business rules that do
not fall into entity, domain or referential integrity.
SQL - DATA TYPES
Character Datatypes:

The following are the Character Datatypes in Oracle/PLSQL:


Numeric Datatypes
The following are the Numeric Datatypes in Oracle/PLSQL:
Date/Time Datatypes
The following are the Date/Time Datatypes in Oracle/PLSQL:
Large Object (LOB) Datatypes
The following are the LOB Datatypes in Oracle/PLSQL:
Rowid Datatypes
The following are the Rowid Datatypes in Oracle/PLSQL:
SQL LOGICAL OPERATORS
TYPES OF SQL COMMANDS:

• Data Definition Language (DDL):


– Commands that define a database - Create, Alter, Drop
• Data Manipulation Language (DML)
– Commands that maintain and query a database.
• Data Control Language (DCL)
– Commands that control a database, including administering privileges and
committing data.
THANK YOU

You might also like