Daniel
Daniel
2
CREATE, READ, UPDATE AND DELETE
Course Code: CPE301
Title: DATABASE MANAGEMENT SYSTEMS I
Section: CPE31FC1
Name: Capa , Ryan Onil D.
1. Objective(s):
The activity aims to demonstrate the insertion of content to database, and retrieving data using specific
criteria.
Data Types
A data type or simply type is a classification identifying one of various types of data.
In MySQL, there are three main types of data: Text, Number and Date/Time types.
To insert data into MySQL table, you would need to use SQL INSERT INTO command. Here is generic SQL
syntax of INSERT INTO command to insert data into MySQL table:
VALUES
( value1, value2,...valueN );
Note that the field1, field2 are attributes in the table. The value1 and value2 are the instances of the
attributes. This indicates that the fields must follow the same order as values.
An alternative way to insert data without using field names is by using this syntax:
VALUES
( value1, value2,...valueN );
This shows that the data does not necessarily require an indication of the respective attributes. This
command inserts data to whichever column is present in the database, as long as the data type matches.
The SELECT statement is used to select data from a database. The result is stored in a result table, called
the result-set. To select all the data from a particular table, the following syntax can be used:
The following syntax, on the other hand, selects only the specific columns of the database.
The UPDATE statement is used to update existing records in a table. The syntax for this command is as
follows:
UPDATE table_name
SET column1=value1,column2=value2,...
WHERE some_column=some_value;
The DELETE statement is used to delete records in a table. The syntax is as follows:
WHERE some_column=some_value;
5. Procedure:
Viewing
Structur Describe drivers;
e of
Table 1
Selectin
g
Specific
Values
from
table 2
Questions:
1. What would the database do when two of the same values are inserted at the database?
2. Why is it necessary to introduce a WHERE clause when updating and deleting data?
3. Supposed you input INTEGER data that is intended for VARCHAR. What happens?
In this activity I gain a knowledge about adding a data inside the data. I applied also what I learned
in the laboratory. And overall I saw the output of what I ded and its so cool for me.
8. Assessment Rubric: