Introducing 

Prezi AI.

Your new presentation assistant.

Refine, enhance, and tailor your content, source relevant images, and edit visuals quicker than ever before.

Loading content…
Loading…
Transcript

Select

SELECT FirstName, LastName

FROM Employees

WHERE City = "Reading"

Retrieval of Data

Select

CREATE USER 'daniel'@'localhost'

IDENTIFIED BY 'my_password';

We also use SQL to search for and retrieve specific data from the database.

We use this so we can then produce reports and perform other functions based on the data.

The Select command is used for this.

Administration of Users

Select

RBMSs are often designed to be accessed by many different users.

We use SQL to assign usernames, passwords & priviliges.

The two main commands for this are:

  • Create User - add a user to the current database.
  • Grant - assign access privileges to an existing user.

GRANT ALL ON *.*

TO daniel'@'localhost';

KnowItAllNinja.com

Manipulating Relational Databases

http://www.knowitallninja.com

Update

UPDATE Employees

SET LastName = 'Thompson', City= 'Swindon'

WHERE EmpID = 1

Security, Integrity & Recovery

Update, Insert & Delete

The granting of privileges is important for security as it limits damage that can be caused by an individual user.

There are also SQL commands that are designed to ensure data integrity is maintained & to backup data.

These can be quite different between different RDBMSs though.

Insert

When you want to modify the data being stored in your database you will use:

  • Update - change the data stored in the fields of an existing record.
  • Insert - add a new record into a table of your database.
  • Delete - delete an existing record from your database.

INSERT INTO Employees (FirstName, LastName, Address, City, PostCode)

VALUES ('Michael', 'Cross', '21 Bodmin Road', 'Reading', 'RG4 6XZ');

Delete

DELETE FROM Employees

WHERE EmpID = 1;

Learn more about creating dynamic, engaging presentations with Prezi