0% found this document useful (0 votes)
28 views7 pages

Dbms

database management system notes

Uploaded by

nkanha037
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)
28 views7 pages

Dbms

database management system notes

Uploaded by

nkanha037
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
You are on page 1/ 7

What is SQL?

SQL stands for Structured Query Language. SQL is a computer language


used to interact with relational database systems. SQL is a tool for
organizing, managing, and retrieving archived data from a computer
database.
When data needs to be retrieved from a database, SQL is used to make
the request. The DBMS processes the SQL query retrieves the requested
data and returns it to us. Rather, SQL statements describe how a
collection of data should be organized or what data should be extracted
or added to the database.

What are the characteristics of SQL?


• SQL may be utilized by quite a number of users, which include
people with very little programming experience.
• SQL is a non-procedural language.
• We can without difficulty create and replace databases in SQL.
It isn’t a time-consuming process.
• SQL is primarily based totally on ANSI standards.
• SQL does now no longer have a continuation individual.
• SQL is entered into the SQL buffer on one or more lines.
• SQL makes use of a termination individual to execute
instructions immediately. It makes use of features to carry out a
few formatting.
• It uses functions to perform some formatting.
Advantages of SQL :
SQL has many advantages which makes it popular and highly demanded. It is a
reliable and efficient language used for communicating with the database. Some
advantages of SQL are as follows:

1. Faster Query Processing –


Large amount of data is retrieved quickly and efficiently. Operations like
Insertion, deletion, manipulation of data is also done in almost no time.

2. No Coding Skills –
For data retrieval, large number of lines of code is not required. All basic
keywords such as SELECT, INSERT INTO, UPDATE, etc are used and
also the syntactical rules are not complex in SQL, which makes it a user-
friendly language.

3. Standardized Language –
Due to documentation and long establishment over years, it provides a
uniform platform worldwide to all its users.

4. Portable –
It can be used in programs in PCs, server, laptops independent of any
platform (Operating System, etc). Also, it can be embedded with other
applications as per need/requirement/use.

5. Interactive Language –
Easy to learn and understand, answers to complex queries can be
received in seconds.

6. Multiple data views –


7. Scalability: SQL databases can handle large volumes of data and can be
scaled up or down as per the requirements of the application.
8. Security: SQL databases have built-in security features that help protect
data from unauthorized access, such as user authentication, encryption,
and access control.
9. Data Integrity: SQL databases enforce data integrity by enforcing
constraints such as unique keys, primary keys, and foreign keys, which
help prevent data duplication and maintain data accuracy.
10. Backup and Recovery: SQL databases have built-in backup and
recovery tools that help recover data in case of system failures, crashes,
or other disasters.
11. Data Consistency: SQL databases ensure consistency of data across
multiple tables through the use of transactions, which ensure that
changes made to one table are reflected in all related tables.

Disadvantages of SQL :
Although SQL has many advantages, still there are a few disadvantages.
Various Disadvantages of SQL are as follows:

Complex Interface –
SQL has a difficult interface that makes few users uncomfortable while dealing with the database.

• Cost –
Some versions are costly and hence, programmers cannot access it.
• Partial Control –
Due to hidden business rules, complete control is not given to the
database.
• Limited Flexibility: SQL databases are less flexible than NoSQL
databases when it comes to handling unstructured or semi-structured
data, as they require data to be structured into tables and columns.
• Lack of Real-Time Analytics: SQL databases are designed for batch
processing and do not support real-time analytics, which can be a
disadvantage for applications that require real-time data processing.
• Limited Query Performance: SQL databases may have limited query
performance when dealing with large datasets, as queries may take
longer to process than in-memory database

Program -1
Write a program to create a table

Syntax : create table <table name>(column_name1


datatype(size),column_name2 datatype size()......);
PROGRAM 2
Create a program to insert the values in the table.

Syntax : insert into <table_name> values (value 1,value


2,....,value n);

PROGRAM 3
Create a program to display all the values in the table.

Syntax : select *from <table name>;


PROGRAM 4
Create a program to delete the value in the table.

Syntax : delete from <table_name>


where <Condition> ;

Table after deleting the value :

PROGRAM 5
Create a program to modify in the table by adding the new
column in the above table.
Syntax : alter table <table_name> add(column_name1
datatype(size), column_name2 datatype(size),.....
column_name n datatype(size));

Table after adding the colomn :

PROGRAM 6
Create a program to update the values of in the table.

Syntax : update <table_name> set column 1=expression


where <condition>;
PROGRAM 7
Create a program to drop a table.

Syntax : drop database( databasename)

You might also like