SQL Queries
SQL Queries
SQL
Structured query language
• SQL is a programming language for storing and
processing information in a relational database.
• Select - It is used to select the attribute based on the condition described by WHERE
clause.
1. Data Definition Language (DDL)
• DDL are normally not used by end-users.
• The syntax of the SQL CREATE
DATABASE statement is:
• COMMIT;
• ROLLBACK;
• To create a SAVEPOINT :
• SAVEPOINT savepoint_name;
• SAVEPOINT RollNo;
• To release a SAVEPOINT :
2. Integrity constraints get removed in the Integrity constraint doesn’t get removed in
DROP command. the Truncate command.
3. The structure of the table does not exist. The structure of the table exists.
4. Here the table is free from memory. Here, the table is not free from memory.
ALTER command will perform all the actions UPDATE command will perform all the
in the table at a structural level. actions in the table at the data level.
It is used for adding, deleting, and modifying It is used for updating the data (records) in
attributes of the table in the database. the existing table.
Example: ALTER TABLE Movies ADD COLUMN Example: UPDATE Movies SET Movierate = 4
Movierate int(5); WHERE Moviename='Spiderman';