In essence, Relational Algebra shows the mathematical manner in which a database management system (DBMS) goes about its job. Through the use of Relational Algebra, we can calculate the most efficient way for a DBMS to interact with the database, e.g. updating records, performing a COUNT of the rows in a table etc.
The Relational Algebra for returning the surnames in a table holding details of employees where their salary is greater than 30000 per year, is as follows:
SELECTSurname(PROJECTSalary>30000)
(The SELECT operator is often a Pi symbol, and the PROJECT operator is often a Sigma symbol)
An SQL statement, however, would go something like this:
SELECT Surname
FROM tblEmployee
WHERE Salary>30000
Hopefully you can see the difference. Ultimately, the algebra can be used by mathematicians and DBMS creators to ensure the DBMS works as efficiently as possible in performing tasks required by users. Whilst not really necassary in a small-scale database, clearly in a large, complex database you'll be looking at thousands and thousands of rows that need to be queried, updated etc, so efficiency in getting the data back is very important!
An SQL statement may look similar, but there's no real calculation involved here. It is instead a standardised language allowing database administrators and users to give a set of instructions, telling the DBMS (Oracle, MS Access, MySQL etc.) what you want to do to a database, e.g. query it, update it, delete from it, and so on.
I hope that answers your question!
Chat with our AI personalities
An SQL statement is a complete set of clauses which returns a value and ends with a semicolon(;) A statement is made up of several clauses Ex: select * from person where f_name='me'; In this ex ' select * from person where f_name='me';' is the statement and select*, from person, where f_name= are the clauses
T-SQL is Microsoft's version of the generic SQL langauge to be used with, for example, Microsoft SQL Server.
gand maro...is the answer
Update and Alter are two SQL (Structured Query Language) commands used for modifying databases. Update statement is used to update existing records in a database. Update is a Data Manipulation Language (DML) statement. Alter SQL command is used to modify, delete or add a column to an existing table in a database. Alter is a Data Definition Language (DDL) statement.Commands that are used to define the structure of a database (database schema) are called DDL statements.
in some cease both are the same they use query language but in fact the out puts are very deference