What is SQL? Data Definition Commands | Set operations | Aggregate functions | Null values

preview_player
Показать описание
Welcome back MechanicaLEi, did you know that SQL was one of the first commercial languages written for relational model based upon relational algebra and tuple relational calculus? This makes us wonder, What is SQL? Before we jump in check out the previous part of this series to learn about What relational Algebra is? Now, SQL or Structured Query Language, is a computer language for storing, manipulating and retrieving data stored in a relational database. All the Relational Database Management Systems like MySQL, MS Access, Oracle etcetera, use SQL as their standard database language. Data definition commands are used to create, modify and remove database objects such as schemas, tables, etcetera. The following are the Common Data Definition commands: First is the Create command. The main use of CREATE command is to create a new table in the database. It has a predefined syntax in which we specify the columns and their respective data types. Second, comes the alter command. An existing database object can be modified using this command. Third is the Drop command. This command can delete an index, table or view. Forth comes the Truncate command. Using this command, all the records in a database are deleted, but the database structure is maintained. Fifth and last is the rename command. It renames an object. Set operations as the name suggests, allow the results of multiple queries to be combined into a single result set. They are of three types: First is the UNION operator. the UNION operator combines the results of two SQL queries into a single table of all matching rows. Second, comes the INTERSECT operator. This operator takes the results of two queries and returns only rows that appear in both result sets. Third and last is the EXCEPT operator. EXCEPT operator takes the distinct rows of one query and returns the rows that do not appear in a second result set. An aggregate function is a function where the values of multiple rows are grouped together as input on certain criteria to form a single value of more significant meaning. A few examples of aggregate functions are Count, Sum, Avg, Min, max etcetera. In SQL, NULL is the term used to represent a missing value. A NULL value in a table is a value in a field that appears to be blank. It is very important to understand that a NULL value is different than a zero value or a field that contains spaces. Hence, we first saw what SQL and Data definition commands are and then went on to see what Set operators, Aggregate functions and null values are?
In the next episode of MechanicaLEi find out What data manipulation commands in SQL are?

Attributions:

Рекомендации по теме
Комментарии
Автор

Hey MechanicaLEi
Check out this video of what SQL and Data definition commands are and then what Set operators, Aggregate functions and null values are, then tell us what you think.

MechanicalEI
welcome to shbcf.ru