Skip to main content

What are the fundamental operations of SQL?

Fundamental Operation of SQL

SQL in data definition


Data is defined or defined using SQL through the CREATE statement. An example is given below

CREATE TABLE Employee()

Emp_No NUMBER (5) NOT NULL

Name CHAR (20)

Skill CHAR (20)

pay_rate NUMBER (10, 2);


Explanation of the statement:

(i) A table named Employee can be created through this SQL. The table will have four fields named Emp_No, Name, Skill and Pay_rate.

(ii) Emp_No field will be NUMBER type data and this field will never be empty as it is declared as NOT NULL.

(iii) Name field will be Character tight data and its length will be 20.

(iv) The Skill field will be Character tight data and its length will be 20.

(v) Pay_rate field will be NUMBER data type and its length will be 10 and 2 digits after decimal.


Now let's say we want to add a new field to this table. Then type the following command:

ALTER TABLE Employee

ADD Phone_No NUMBER (10);

Now type the following command to delete the Employee table.

DROP TABLE Employee.

SQL in Data Manipulation:


(1) Delete Operation: The delete command is used to delete one or more records. For example, the following command is used to delete the record named Ranjan:

DELETE Employee

WHERE Name = 'Ranjan',

(2) Insert Operation: Insert command is used to create one or more documents. For example, the following command is used to create a record named Ranjan:

INSERT INTO Employee

Values ​​(12345, 'Ranjan', 'Professor' 12345, 98765431):


(3) Update Operation: Update command is used to update one or more records. For example, the salary of the record named "Ranjan" in the Employee table is updated to Rs. 15000. UPDATE Employee

SET SALARY = 15000

WHERE Name = "Ranjan",

SQL to retrieve data:


The use of SQL as a data query language is very important for data retrieval. Data query language is used to query the required data from the database.

In SQL, data is retrieved using a single SELECT statement. Data manipulation is done using more clauses with Select. An example is given below-

Select Name, Emp_No, Skill, Pay_rate FROM EMPLOYEE

WHERE Name = 'Ranjan',

Through this SQL all information of Employee named Ranjan in EMPLOYEE table like Emp_No, Skill and Pay_rate etc. can be known. Below are two SQL examples


Example-1:

SELECT Customer_name FROM Customer WHERE Customer_city = 'Tangail',

Through this SOL, the names of all the customers of Tangail city in the Customer table can be extracted. If Gazipur or Dhaka is written instead of Customer city Tangail then the name of all customers of Dhaka or Gazipur will be available.


Example-2:

SELECT Loan_number FROM Loan

WHERE branch_name = Bajitpur' AND amount >= 20000

Through this SQL, all those Loan_numbers of the Loan table can be extracted, whose branch_name = 'Bajitpur' Loan amount is equal to 20000 or more.

 

 

 

 

 

 

 

Comments

Popular posts from this blog

Unlocking Online Success: Why Justoctane SEO Services are the Best Choice for Businesses in Boca Raton, Florida.

Best Justoctane SEO Services Boca Raton in Florida Are you looking for the best SEO services in Boca Raton, Florida? Look no further than Justoctane SEO services. As a leading provider of SEO services, Justoctane has helped numerous businesses in the Boca Raton area achieve top rankings on search engine results pages. In this blog post, we will explore why Justoctane is the best choice for SEO services in Boca Raton. Experience and Expertise Justoctane has a team of experienced and highly skilled SEO professionals who have a deep understanding of search engine algorithms and the latest SEO techniques. Their expertise allows them to create customized SEO strategies that are tailored to the specific needs of each client. The Justoctane team has worked with businesses in various industries and niches, providing them with a wealth of knowledge and experience to draw from when creating effective SEO strategies. Comprehensive Services Justoctane offers a wide range of SEO services, incl...

What is computer outsourcing and freelancing? What are the work areas of outsourcing and freelancing?

Outsourcing Computer Outsourcing: The word outsourcing information freelancing basically means free profession. That is, a profession to earn income by working freely. And a little more simply. In other words, different organizations do different types of work through the Internet system. By someone else outside your organization. Outsourcing is called outsourcing. Those who do outsourcing work are called freelancers. Jobs in multimedia, outsourcing sites or online marketplaces are divided into different categories, such as web development, software. Development, networking and information systems, writing and translation, administrative support, design and customer service, sales and marketing business services, etc. It is possible to earn online only if all these tasks are done through the internet system. There are also many other types of work available in the outsourcing world. . Freelancing Freelancing  means working independently without being under a specific person or orga...

What is the purpose of operating system? Basic concepts of operating system?

Basic concepts of operating system The main purpose of the operating system is to-- • Creation of working environment: The operating system that creates a better working environment, the better and improved the operating system. • Coordinator: It coordinates between hardware and software. It acts as a coordinator between user tasks and all devices. • Automatic management: When a problem arises, it automatically understands what to do. If the appropriate solution is not provided, the operating system may automatically shut down the computer by itself. • Control of computer operations: The objective of the operating system is to control the speed of input/output operations by programs. • Memory management: helps the computer to work faster in stages by storing different files so that they can be found easily. this • Working based on priority: All the tasks that are directed to the computer are carried out based on priority. • Input/Output Management (I/O Management): It is the task o...