Structure query Language class 12
Structure query Language class 12
Advantages:
1. Ease of Use: SQL is designed to be user-friendly and declarative, meaning you specify
what you want (queries) rather than how to get it (procedural languages).
2. Scalability: SQL databases can handle large amounts of data and scale effectively as the
size of the database grows.
3. Standardization: SQL is an ANSI/ISO standard, which ensures that SQL queries will
work on any SQL-compliant database system.
4. Portability: SQL databases are portable across different platforms and systems, allowing
easy migration from one database system to another.
5. Integration: SQL databases can easily integrate with other databases and applications,
making it versatile for various business needs.
6. Security: SQL databases offer robust security features to control access to the data at
various levels (user, group, role-based access controls).
7. Transaction Control: SQL databases provide ACID (Atomicity, Consistency, Isolation,
Durability) properties to ensure reliable transactions.
Disadvantages:
1. Complexity: Writing complex SQL queries can be challenging, especially for beginners,
and optimizing them for performance can require deep understanding.
2. Performance: While SQL databases are generally efficient, poorly designed databases or
queries can lead to performance bottlenecks.
3. Scaling Limitations: Horizontal scaling (scaling out) can be more challenging with SQL
databases compared to NoSQL databases designed for distributed architectures.
4. Schema Rigidity: SQL databases typically require a predefined schema, which can be
inflexible when dealing with unstructured or rapidly changing data.
5. Cost: Some SQL database systems can be expensive to license and maintain, especially
for large-scale enterprise deployments.
6. Concurrency: Handling concurrent users and transactions can be complex, especially in
high-traffic applications, though this depends on the database system and its concurrency
control mechanisms.
7. Not Ideal for Big Data: While SQL databases can handle large datasets, they may not be
the best choice for storing and processing unstructured "big data" due to schema
requirements and scalability issues.
SQL is made of three sub languages: DDL, DML and DCL
DDL Statements
Syntax:
Field1 data_type,
Field2 data_type,
………………….
Fieldn data_type,
);
Example:
Sid int,
Name CHAR(20),
CLASS VARCHAR(12),
);
2. ALTER statement: ALTER statement is used to add, delete or
modify culumns in an existing table.
Syntax:
Syntax: