What is SQL (Structured Query Language)?
- Use pascal notation for object name. Example: Products, Customers
- Use the singular form of nouns for the Column name. Example: FirstName, Address
- Each table must have a primary key.
- Use upper case for all SQL keywords. Example: SELECT, UPDATE, INSERT, DELETE
- Do not use white space in identifiers.
- Use parentheses to increase readability.
- Indent code to improve readability.
- Use ANSI joins instead of old-style joins.
- Do not use SELECT *
- Always use table aliases when your SQL statement involves more than one table.
- Do not use column numbers in the ORDER BY clause.
- Always use column list in INSERT statements.
Components of SQL.
- CREATE: used to create new Database objects like table, view, and stored procedure.
- ALERT: used to modify the existing structure of the database objects.
- TRUNCATE: used to remove all the data from database objects.
- DROP: used to remove the database object from the database.
- RENAME: used to change the name of the existing object.
- INSERT: used to insert data into a table.
- UPDATE: used to update existing data within a table.
- DELETE: used to delete records from the table.
- COMMIT: used to end the current transaction by making all pending data changes permanent.
- ROLLBACK: used to ends the current transaction by discarding all pending data changes.
- SAVEPOINT: used to mark a savepoint within the current transaction.
- GRANT: used to give user access privilege to the database.
- REVOKE: used to revert back the user access privilege to the database.
Trends is an amazing magazine Blogger theme that is easy to customize and change to fit your needs.