You are on page 1of 4

Primary Key – First key that identifies one instance of an entity uniquely.

Foreign Key – Used to point the primary key of another table.


Purpose of primary key-
To extract or archive data from a table that is visited more than once during a process
Purpose of keys in database-
help to uniquely identify a tuple (or row) in a relation (or table). Keys are also used to establish relationships between the different tables and
columns of a relational database.

Data Models:
Conceptual- What the system contains.
Physical- How System is implemented.
Logical- how system should be implemented.

Normalization- process of organizing data in database used to minimize redundancy from relations and divides larger tables
into smaller ones.
Database- Collection of related data organized in a way that data can be accessed easily. It can be software or hardware based
with the purpose of stroking data.
SQL- Structured database language used to maintain and retrieve relational databases.

SQL QUERIES TERMNINORLOGIES


CREATE – Create objects in the database
SELECT – Retrieve data from database.
INSERT – Insert data from database or table
DROP- Delete object in the database.
TRUNCATE- Remove all records including the spaces.
COMMENT- Data Dictionary
UPDATE- Update existing data within the table.
DELETE- Deletes all the record from a table and space for record remain.
-----------------------------------------------------------------------------------------------------------------------

INDEXES-  tool used in the background of a database to speed up querying.

ACID PROPERTIES-

ATOMICITY

CONSISTENCY

DURABUILITY

ISOLATION

More on queries na need mo tandaan :>

(example of queries that might be included in the presentation)


(updating or renaming )
Update job set job_title='IT' where job_id=1
mapapaltan name ng selected row and attribute
(joining tables)
(example lang to :>)
Select u.user_id ,e.exp_id,e.achievements_,e.prev_title,e.company_name_,e.no_years
FROM user u
JOIN experience_ e
ON u.user_id=e.exp_id

majojoin ibang table

(renaming attribute)
SELECT CONCAT(address) AS Address
mapapaltan name ng attribute

(deleting)
Delete from experience where exp_id=1
madedelete buong row
(truncating)
TRUNCATE TABLE (name ng table);
Magdelete ng table.

(selecting)
SELECT (name ng table);
Para maselect buong table.

(drop table) yawa gising


DROP object object_name

Examples:
DROP TABLE table_name;

table_name: Name of the table to be deleted.

(droping database)

DROP DATABASE database_name;

database_name: Name of the database to be deleted.

You might also like