SQL commands are instructions. It is used to communicate with the database. It is also used to perform specific tasks,
functions, and queries of data.
SQL can perform various tasks like create a table, add data to tables, drop the table, modify the table, set permission for users.
Types of SQL Commands
There are five types of SQL commands: DDL, DML, DCL, TCL, and DQL.
1. Data Definition Language (DDL)
o DDL changes the structure of the table like creating a table, deleting a table, altering a table, etc.
o All the command of DDL are auto-committed that means it permanently save all the changes in the database.
Here are some commands that come under DDL:
o CREATE
o ALTER
o DROP
o TRUNCATE
2. Data Manipulation Language
o DML commands are used to modify the database. It is responsible for all form of changes in the database.
o The command of DML is not auto-committed that means it can't permanently save all the changes in the database. They can be rollback.
o INSERT o UPDATE o DELETE
3. Data Control Language
DCL commands are used to grant and take back authority from any database user. Here are some commands that come under DCL:
o Grant
o Revoke
4. Transaction Control Language
TCL commands can only use with DML commands like INSERT, DELETE and UPDATE only.
These operations are automatically committed in the database that's why they cannot be used while creating tables or dropping them.
Here are some commands that come under TCL:
o COMMIT
o ROLLBACK o SAVEPOINT
5. Data Query Language
DQL is used to fetch the data from the database.
It uses only one command:
o SELECT
I will discuss each command in detail in upcoming post:) STAY TUNED....
Pages and Layouts in Nextjs- When building projects with Next.js, we typically create an entire user interface by assembling isolated components. However, some parts of the interface require the same code snippets across multiple routes — for example, the navigation header, footer, and sidebar. To manage this, we use layouts to structure the interface in a way that contains shared code snippets. Next.js recommends starting a new project with the App Router. However, we’ll discuss how to implement layouts and nested layouts with the Pages Router for users who have yet to migrate to the new Next.js routing system.
How to Parse JSON in Dart/Flutter Parsing JSON is a very common task for apps that need to fetch data from the Internet. And depending on how much JSON data you need to process, you have two options: write all the JSON parsing code manually automate the process with code generation Encoding and Decoding JSON When a JSON response is sent over the network, the entire payload is encoded as a string. But inside our Flutter apps, we don't want to extract the data from a string manually: