WELCOME TO THE WORLD OF
database
management system
Find all the study materials for DBMS subject in one place.
Code Snippets
Code spinnets for better understanding
SQL Tables
Learn about how to create a table and insert data in it.
CREATE TABLE tb_name(
column1 datatype constraint;
column2 datatype constraint;
...
);
To insert data in the table INSERT INTO query is used.
INSERT INTO table_name (column1, column2, ...)
VALUES
(value1, value2, ...);
The DROP TABLE statement is used to drop an existing table in a database.
DROP TABLE table_name;
The TRUNCATE TABLE statement is used to delete the data inside a table, but not the table itself.
TRUNCATE TABLE table_name;
Constraints
The following constraints are commonly used in SQL:
- NOT NULL - Ensures that a column cannot have a NULL value
- UNIQUE - Ensures that all values in a column are different
- PRIMARY KEY - A combination of a NOT NULL and UNIQUE. Uniquely identifies each row in a table
- FOREIGN KEY - Prevents actions that would destroy links between tables
- CHECK - Ensures that the values in a column satisfies a specific condition
DDL, DML, DCL and TCL Commands
- DDL (Data Definition Language) actually consists of the SQL commands that can be used to define the database schema.
- The SQL commands that deal with the manipulation of data present in the database belong to DML (Data Manipulation Language) and this includes most of the SQL statements.
- DCL includes commands such as GRANT and REVOKE which mainly deal with the rights, permissions, and other controls of the database system.
- TCL (Transaction Control Language): Transactions group a set of tasks into a single execution unit. Each transaction begins with a specific task and ends when all the tasks in the group are successfully completed. If any of the tasks fail, the transaction fails.
MySQL Workbench Installation Steps
1
Download MySQL Workbench
Visit the MySQL Workbench Downloads page and select your operating system, then download the installer.
2
Run the Installer
Once downloaded, run the installer and select the "MySQL Workbench" component during the installation process.
3
Choose Setup Type
Select the installation type based on your preference (Typical, Custom, or Complete).
4
Install MySQL Workbench
Click the "Install" button to start the installation. Wait until the process completes.
5
Launch MySQL Workbench
After the installation is complete, launch MySQL Workbench and set up a connection to your MySQL server.
Start Coding
Enhance your skills by practicing what you've learnt by coding...