0% found this document useful (0 votes)
2 views3 pages

COMPUTER 3rd Prelim

The document explains Data Manipulation Language (DML), which allows users to manipulate data in a database through four main commands: INSERT, UPDATE, DELETE, and SELECT. It provides syntax and examples for each command, demonstrating how to add, modify, remove, and retrieve data from database tables. Additionally, it includes instructions for viewing all data in a table and selecting specific columns.

Uploaded by

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

COMPUTER 3rd Prelim

The document explains Data Manipulation Language (DML), which allows users to manipulate data in a database through four main commands: INSERT, UPDATE, DELETE, and SELECT. It provides syntax and examples for each command, demonstrating how to add, modify, remove, and retrieve data from database tables. Additionally, it includes instructions for viewing all data in a table and selecting specific columns.

Uploaded by

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

COMPUTER

Data Manipulation Language (DML) will enable you to view, filter, insert, delete, and update data in
your database.
DML is a family of computer languages that includes commands permitting users to manipulate data
in a database.

THE FOUR POWERFUL COMMANDS OF DML:


 INSERT
 UPDATE
 DELETE
 SELECT

INSERT
This command adds one or more records in a database table.
This adds one or more records to a database table.
SYNTAX:
USE [database name]
INSERT INTO [table name][column(s)]
VALUES [value(s)]
Example:
USE SJS_Enrollments
INSERT INTO studentprofile
(
studentnumber,
Slastname,
Sfirstname,
Smiddlename,
)
VALUES
(
‘1008’,
‘vergra’,
‘Adrielle john’,
‘mapanoo’,
)

UPDATE
This command that will allow you to edit or modify the content of your table.
This command modifies data of one or more records.
SYNTAX:
USE [database name]
UPDATE [table name]
SET [column name = value]
WHERE [condition]

Example:
USE SJS_Enrollments
UPDATE SY_2023_2024
SET Flastname = ‘Fandivila’
WHERE Flastname = ‘Fandavilla’;
DELETE
Is another DML statement/command which will allow you to remove unnecessary data inside
your table.

SYNTAX:
USE [database name]
DELETE FROM [table name]
WHERE [condition]

Example:
USE SJS_Enrollments
DELETE FROM SPC
WHERE Age = ‘14’;

SELECT
This DML command will allow you to view contents of your table.
This command is used to retrieve rows from a table.
This command is the most widely used DML command in SQL.

SYNTAX:
USE [database name]
SELECT [column name]
FROM [table name]
WHERE [conditions]

Example:
USE SJS_Enrollments
SELECT Lastname
FROM SY_2023_2024
WHERE Lastname = ‘Fandivila’;

VIEWING ALL DATAS IN A TABLE

SYNTAX:
USE [database name]
SELECT * FROM [table name]
Example:
USE SJS_Enrollments
SELECT * FROM SY_2023_2024

VIEWING SPECIFIC MULTIPLE COLUMNS

Syntax:
USE [database name]
SELECT [column],[column],[column]
FROM [table name]
Example:
USE SJS_Enrollments
SELECT ID_number, Firstname, Age
FROM SY_2023_2024
VIEWING MULTIPLE COLUMNS IN ONE COLUMN

Syntax:
USE [database name]
SELECT
[column],
[column1] + ‘,’ + [column2] + SPACE(1) + [column3]
AS [new column name]
FROM
[table name]
Example:
USE SJS_Enrollments
SELECT
ID_number,
UPPER(Lastname) + ‘,’ + UPPER(Firstname) + SPACE(1) + UPPER(Middlename)
AS [Fullname]
FROM
SY_2023_2024

You might also like