Thursday, 26 January 2023

Structured query language | SQL | mr indian coder |

Structured Query Language (SQL) is a standardized programming language that is used to manage relational databases and perform various operations on the data in them.

 

STRUCTURED QUERY LANGUAGE (SQL)

 

SQL: It is a simple query language used for accessing, handling and managing data in relational databases. Purpose behind learning

 

 

 

SQL: When a user wants to get some information from a database file, it can issue a query. A query is a user request to retrieve data or information with a certain condition. SQL is a query language that allows user to specify the conditions, (instead of algorithms), 

 

 

 

Types of SQL commands

 

 

Data Definition Language Command (DDL Command): All the commands used to create, modify or delete physical structure of an object like table.

e.g. Create, Alter, Drop.

 

• Data Manipulation Language Command (DML. Command): All the commands used to modify contents of a table come under this category.

 

eg, insert, Delete, Update commands. 

 

 

 

• Transaction Control Language Command (TCL Command): These commands are used to control transaction of DML commands.

e.g. Commit, Rollback.

Each field in a SQL database is assigned a data type.

SQL supports following data types.

char(n) - fixed width n character string, varchar(n)- variable width string, int-numbers without decimal.

float-numbers with decimal in base 10 exponential. date- stores date type values.

 

 

Basic structure of an SQL query:

 

• General structure-SELECT ALL/DISTINCT, AS, FROM, WHERE

 

 

Comparison- IN, BETWEEN, Grouping-GROUP BY HAVING, COUNT(), SUM(), AVG(), MAX(), MIN()

 

 

Display order- ORDER BY, ASC/DESC Logical operators- AND, OR, NOT

 

 

Types of Constraints:

Constraint is a condition applicable on a field or group of fields.

 

 

 

⚫Column constraint: Apply only to individual column.

 

 

⚫ Table constraint: Apply to group of columns.

 

7

 

 

ORDER BY Clause: The resulting column can be sorted in ascending and descending order using the ORDER BY clause.

 

 

 

Syntax:

 

 

 

SELECT column-name>[<column-name>1 FROM <table-name>

 

 

 

WHERE conditions ORDER BY <column-name>; > Conditions based on a range: SQL provides a BETWEEN operator that defines a range of values that the column

 

 

 

value must fall for the condition to become true.

 

 

 

Syntax:

 

SELECT <column-name> FROM<table-name>WHERE <column-name> BETWEEN <value>AND<value>; Conditions based on a list: To specify a list of values, IN operator is used.

 

 

 

Tags: -

Mr indian coder

mr indian coder

Structured query language (sql)    

Structured query language pdf    

Structured query language examples    

Structured query language class 11 notes    

Structured query language class 12 notes    

Structured query language in hindi    

Structured query language download    

Structured query language is used to    

Structured query language mStructured query language in dbms

structured query language in dbms:

Structured query language (sql)    

Structured query language examples    

Structured query language in hindi        

Structured query language meaning in telugu    

Structured query language enables data analyst to    

Structured query language meaning in hindeaning in hindi

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home