SQL is commonly divided into four main subdivisions
, each serving a specific purpose in managing and interacting with relational databases:
Data Definition Language (DDL):
Data Manipulation Language (DML):
Data Control Language (DCL):
Data Query Language (DQL):
Transaction Control Language (TCL): note: 5th component DTL/TCL not an ANSI standard. It is extra in MySQL and Oracle RDBMS.
These subdivisions collectively provide the framework for defining database structures, managing data, securing access, and controlling transactions within SQL-based systems.
Maximum Length:
Allowed Characters:
You can use letters (A–Z, a–z), numbers (0–9), and the underscore (_).
Tablename is case insensitive for MySQL under windows
but case sensitive under Unix/Linux
Tablename has to begin with an alphabet
Special characters $, #, _
allowed
In MySQL, to use reserved characters such as #
in tablename and column name enclose it in backticks EMP#
134 Reserved words not allowed in tablename
Uniqueness:
Each table name must be unique within the same database.
Naming Conventions:
Although not strictly enforced by MySQL, it's common practice to start table names with a letter or underscore rather than a number, and to use lowercase letters for better consistency, especially in cross-platform development.