0% found this document useful (0 votes)
33 views3 pages

EXPERIMENT10

ism project

Uploaded by

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

EXPERIMENT10

ism project

Uploaded by

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

EXPERIMENT10

Q 1. a) What is SQL? What are the different data types used in SQL.

SQL, or Structured Query Language, is a standard programming language used for managing
and manipulating relational databases. It allows users to create, read, update, and delete (CRUD)
data within a database. SQL is widely used for tasks such as querying data, creating and
modifying database schemas, and managing user access.

Common SQL Data Types

SQL data types can vary slightly between different database management systems (DBMS), but
here are some of the most commonly used categories:

1. Numeric Data Types:


o INT: Integer values (e.g., -2147483648 to 2147483647).
o SMALLINT: Smaller range of integer values (e.g., -32,768 to 32,767).
o BIGINT: Larger range of integer values.
o FLOAT: Floating-point numbers.
o DOUBLE: Double-precision floating-point numbers.
o DECIMAL (or NUMERIC): Exact numeric values with defined precision and
scale.
2. String Data Types:
o CHAR(n): Fixed-length character string.
o VARCHAR(n): Variable-length character string.
o TEXT: Large variable-length string (used for longer texts).
3. Date and Time Data Types:
o DATE: Date values (year, month, day).
o TIME: Time values (hours, minutes, seconds).
o DATETIME: Combines date and time.
o TIMESTAMP: Similar to DATETIME, but often includes time zone
information.
4. Binary Data Types:
o BINARY(n): Fixed-length binary data.
o VARBINARY(n): Variable-length binary data.
o BLOB: Binary Large Object, used for storing large amounts of binary data, such
as images or files.
5. Boolean Data Type:
o BOOLEAN: Represents true/false values (availability may vary by DBMS).
6. Other Data Types:
o ENUM: A string object with a value chosen from a list of permitted values.
o SET: A string object that can have zero or more values, each of which must be
chosen from a list of permitted values.
b) Explain the different SQL statements.

SQL statements can be categorized into several types based on their functionality. Here’s an
overview of the main types of SQL statements:

1. Data Definition Language


DDL or Data Definition Language actually consists of the SQL commands that can be
used to define the database schema. It simply deals with descriptions of the database
schema and is used to create and modify the structure of database objects in the database.
DDL is a set of SQL commands used to create, modify, and delete database structures but
not data. These commands are normally not used by a general user, who should be
accessing the database via an application
2. Data Manipulation Language
The SQL commands that deal with the manipulation of data present in the database
belong to DML or Data Manipulation Language and this includes most of the SQL
statements.
It is the component of the SQL statement that controls access to data and to the
database. Basically, DCL statements are grouped with DML statements.
3. Transaction Control Language
Transactions group a set of tasks into a single execution unit. Each transaction begins
with a specific task and ends when all the tasks in the group are successfully completed.
If any of the tasks fail, the transaction fails.
Therefore, a transaction has only two results: success or failure. You can explore more
about transactions
4. Data Control Language
DCL includes commands such as GRANT and REVOKE which mainly deal with the
rights, permissions, and other controls of the database system.
.

You might also like