SQL means structured query language used in database management systems to store and retrieve data from a relational database. The relational database refers to the data stored in the form of rows and columns, which represent attributes and relations. An attribute refers to any object, and a relation refers to the relationship between two or more objects. To retrieve or store the database, some SQL query statements such as SQL INSERT command to store the data and SELECT command to select the values from the stored database.
SQL implementation involves creating, storing, and retrieving a database. The server machine processes the database queries and retrieves the enquired data in this process. Let us understand SQl by a small example:
Example: Consider a table of data that contains the information of students; the table mainly consists of:
Student Name | Student ID | Student Grade |
Mahesh | 200147 | A |
Rani | 200148 | A+ |
Pooja | 200149 | B |
SELECT * FROM Student Data WHERE Student Grade = ‘A+’;
Rani 200148 A+
If you want to remove “Mahesh” from the table:
This removes the row where the Student Name is “Mahesh.”
The commands which are used to manipulate the data in database management are called SQL commands. These commands are categorised into 5 commands that are:
Data definition language (DDL) refers to SQL commands to design database structures. Database engineers use DDL commands to create and modify database values based on business requirements. For example, the database engineer uses the ALTER to change the structure of an existing database object, such as adding, deleting, or modifying columns in a table.
Data query language (DQL) is similar to DDL but has different commands. It consists of instructions for retrieving data stored in relational database systems. For Example, the SELECT statement retrieves data from a database. You can specify which columns to retrieve, filter records, sort the results, and more.
Data manipulation language (DML) statements write new information or modify existing records in a relational database. For example, an application uses the INSERT command to store a new record in the database.
Database administrators use data control language (DCL) to manage or authorise database access for other users. For example, they can use the GRANT command to permit specific applications to manipulate one or more tables.
The relational engine uses transaction control language (TCL) to make database changes automatically. For example, the database uses the ROLLBACK command to undo an erroneous transaction.
1) What is SQL?
Ans: SQL is a structured query language that stores, retrieves, updates, and deletes data from a database. SQl mainly includes significant categories like DDL, DML, DCL, and DQL.
2) What are the different types of SQL commands?
Ans: DDL, DML, DCL, and TCL are some of the main commands in Structured Query Language
3) What is a primary key?
Ans: A primary key is a unique identifier for each record in a table.
4) What is the difference between WHERE and HAVING clauses?
Ans: The WHERE filters rows before aggregation while HAVING filters rows after aggregation.
5) What is Normalisation?
Ans: Normalisation is a process by which the database is filtered. Some of the different normal forms are (1NF, 2NF, 3NF, and BCNF); it reduces redundancy and dependency in a database.
Checkout the lastest article about: Artificial Intelligence in 2024
You can find updates on the episodes of the popular Indian television drama, Yeh Rishta…
DevOps means [Development and Operations]. It is software development combined with an IT operations automation…
Social media marketing is known as the pillar of online business as it's the most…
Shalini Passi is a trending name on social media. She got much attention after appearing…
The Indian business market is bombarded with opportunities for upcoming entrepreneurs. With a growing middle…
Shadow fight 2 mod APK is a modified version of the original shadow fight edition…