Summary
Keywords
Full Transcript
SQL stands for Structured Query Language (pronounced sequel) is the standard language for accessing and manipulating data in a relational database. A SQL statement is code that is made up of keywords or clauses, such as SELECT columns FROM table WHERE condition. For example, SELECT name FROM friends WHERE age = 21. The SELECT clause gets the names, the FROM clause looks for the names in the Friends database table, and the WHERE clause filters them by a condition where age is 21. So this SQL statement will results showing the names of all your friends that are 21. SQL statements also contain identifiers, such as the table names and column names, and also contain literals, such as 21 in our example. SQL commands are grouped into 5 categories depending on their functionality. They are also called the 5 sublanguages. 1) Data Definition Language (DDL) 2) Data Manipulation Language (DML) 3) Transaction Control Language (TCL) also called the Data Transaction Language (DTL) 4) Data Control Language (DCL) 5) Data Query Language (DQL) Data Definition Language (DDL) include commands: CREATE ALTER DROP RENAME TRUNCATE Data Manipulation Language (DML) include commands: UPDATE – update an existing record DELETE – delete a record INSERT – add a new record Transaction Control Language (TCL) include commands: COMMIT – save database changes ROLLBACK – revert your changes back SAVEPOINT – create a savepoint to rollback too Data Control Language (DCL) include commands: GRANT – give permission REVOKE – stop giving permission Data Query Language (DQL) include commands: SELECT – selects data from tables or views Subscribe to Appficial for more programming videos coming soon. Also, don't forget to click LIKE and comment on the video if it helped you out!
