0% found this document useful (0 votes)
23 views1 page

MySQL Background Theory 12

The document discusses MySQL data types, DDL commands like CREATE, DROP, ALTER and TRUNCATE, DML commands like INSERT, UPDATE and DELETE, and the SELECT command. The DDL commands are used to create and modify database schemas and objects. DML commands deal with data manipulation and include SELECT, INSERT, UPDATE and DELETE. SELECT is used to query data from databases and tables.

Uploaded by

Hi Hlo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views1 page

MySQL Background Theory 12

The document discusses MySQL data types, DDL commands like CREATE, DROP, ALTER and TRUNCATE, DML commands like INSERT, UPDATE and DELETE, and the SELECT command. The DDL commands are used to create and modify database schemas and objects. DML commands deal with data manipulation and include SELECT, INSERT, UPDATE and DELETE. SELECT is used to query data from databases and tables.

Uploaded by

Hi Hlo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

MySQL Background Theory

1. What is My-SQL? Write different data types used in My-SQL. TRUNCATE: The truncate command deletes the data in a table,
MySQL is a popular open-source database management system which is but not the table itself.
used for storing and organizing data. It is used to create and modify Syntax:
databases, tables and other database objects. The different data types TRUNCATE TABLE table_name;
used in MySQL are INT, STRING, VARCHAR, FLOAT, DOUBLE, etc. Example:
2. What are DDL commands? Explain some DDL commands with syntax and TRUNCATE TABLE Categories;
examples. (CREATE, DROP, ALTER, TRUNCATE, RENAME) RENAME: It is used to rename a table:
The DDL commands are the commands that are used to create and Syntax:
modify the schema of the database and its objects. Some DDL commands ALTER TABLE old_name RENAME new_name;
are: Example:
Create command: CREATE is a DDL command used to create ALTER TABLE students RENAME students_info;
databases, tables, triggers and other database objects.
Syntax: CREATE Database Database_Name; 3. What are DML commands? Explain some DML commands with syntax and
Example:
examples. (INSERT, UPDATE, DELETE)
CREATE TABLE Persons (
PersonID int, DML is short name of Data Manipulation Language which deals with
LastName varchar(255), data manipulation and includes most common SQL statements such
FirstName varchar(255), SELECT, INSERT, UPDATE, DELETE, etc., and it is used to store,
Address varchar(255), modify, retrieve, delete and update data in a database. Some DML
City varchar(255) commands are:
); INSERT: It is used to insert data into a table.
DROP: Drop is a DDL command used to delete/ remove the Syntax:
database objects from the SQL database. We can easily remove the INSERT
entire table, view, or index from the database using this DDL UPDATE: It is used to update the existing data into the table.
command. DELELTE: It is used to delete all records from a database table.

Syntax: DROP DATABASE Database_Name;


Example: 4. What is SELECT command? Write and explain some examples of it.
DROP DATABASE ASMITA_THAPA; SELECT command is the command used in My-SQL to select a data
DROP COLUMN Name; from database or a table.
Syntax: SELECT column1, column2, …..
ALTER: ALTER is a DDL commence which changes or modifies FROM table_name;
the existing structure of the database, and it also changes the Example: SELECT PersonID, Address,
schema of database objects. FROM Person;
Syntax:
ALTER TABLE table_name
ADD column_name datatype;
Example:
ALTER TABLE Customers
ADD Email varchar(255);

You might also like