Professional Documents
Culture Documents
Margaret boadi-tackie
Define data definition language and data manipulation language
SQL is a language that splits neatly into two parts. There is the Data Definition Language
(DDL) section and the Data Manipulation Language (DML) section. The Data Definition
Language (DDL) is used to create and destroy databases and database objects such as
tables. These commands will primarily be used by database administrators during the
setup and removal phases of a database project. In practice, people often use a GUI for
creating tables and so on, so it is less common to hand-write DDL statements than it used
to be. The DML section is used to manipulate the data such as querying it. Data
manipulation language comprises the SQL data change statements, which modify stored
data but not the schema or database objects. Data manipulation language is that
of Structured Querying Language (SQL), which is used to retrieve and manipulate data in
a relational database.
What commands falls under each of them.
The commands the fall under DDL are:
CREATE
The CREATE command can be used to establish each of these databases on your
platform. For example, the command:
CREATE DATABASE employees.
It creates an empty database named "employees" on your DBMS.
ALTER
The ALTER command allows you to make changes to the structure of a table without
deleting and recreating it. For example, the command:
ALTER TABLE personal_info
ADD salary money null
This example adds a new attribute to the personal_info table -- an employee's salary.
DROP
DROP, allows us to remove entire database objects from our DBMS. For example, if we
want to permanently remove the personal_info table that we created, we'd use the
following command:
DROP TABLE personal_info
The command below would be used to remove the entire employees database:
DROP DATABASE employees
The commands that fall under DML are:
INSERT
The INSERT command in SQL is used to add records to an existing table. The command
is: INSERT INTO.VALUES
.
SELECT
It allows database users to retrieve the specific information they desire from an
operational database. The command is: SELECTFROM.
UPDATE
The UPDATE command can be used to modify information contained within a table,
either in bulk or individually. The command is:
UPDATE..SET.WHERE.
DELETE
The DELETE command with a WHERE clause can be used to remove his record from
the personal_info table:
DELETE FROM ..WHERE.....
FIND THE COMMAND TO MYSQL FROM THE COMMAND PROMPT
C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld
GIVE EXAMPLES OF OTHER SYNTAX UNDER DATA MANIPULATON
LANGUAGE
INSERT
The INSERT command in SQL is used to add records to an existing table. Let's imagine
that our course rep needs to add a new member to their database. They could use a
command:
INSERT INTO personal_info VALUES (peggy,benson,10015328)
These correspond to the table attributes in the order they were defined: first_name,
last_name and student_id
SELECT
It allows database users to retrieve the specific information they desire from an
operational database. The command below limits the attributes that are retrieved from the
database.
SELECT last_name
FROM personal_info
This command list of the last names of all students in the class.
The WHERE clause can be used to limit the records that are retrieved to those that meet
specified criteria. The command is:
SELECT last_name
FROM personal_info
WHERE last_name= benson
DELETE
The DELETE command with a WHERE clause can be used to remove his record from
the personal_info table:
Name
Card #
number
Name
Address
Address
Doctor
Patient
License#
History
Current
Prognosis
Illness
Gender
CHAR
(2) NOT NULL;
Phone no
INTEGER (10) NOT NULL;
Availability BOOLEAN (5) NOT NULL;
);
iii.
iv.