R Vector A vector is a collection of elements, all the same type (similar to an array in other programming languages but more versatile). When using R, you will frequently encounter the four basic vector types viz. logical, character, integer and double (often called numeric). Create a vector In R, there are several ways to …
SQL DELETE Statement The DELETE statement is used to delete data from a table. It can be used in two ways: To delete specific rows from a table To delete all rows from a table Now let’s take a look at each of these in detail. Syntax DELETE FROM table_name WHERE condition; Sample Table To …
SQL UPDATE Statement The UPDATE statement allows you to update existing rows with new values. With it, you can change the value of one or more columns in each row that meets the search condition of the WHERE clause. Syntax The UPDATE statement is made up of three parts: The table you want to update …
SQL INSERT SELECT Statement INSERT statement is commonly used to insert a row into a table using specified values. There is a second form of INSERT that inserts the result of a SELECT statement in a table, known as INSERT SELECT. As its name suggests, it is made up of an INSERT statement and a SELECT …
SQL INSERT INTO Statement The INSERT INTO statement allows you to insert one or more new rows into a table. Using the INSERT INTO statement, it is possible to insert a complete row, a partial row, multiple rows or rows generated as the result of a query. Let’s now take a look at each of …
SQL HAVING Clause In addition to creating groups using GROUP BY clause, you can also decide which groups to include in the output and which to exclude. For example, you might want a list of jobs for which more than one employee is hired. To get this kind of data you have to filter by …
SQL Aggregate Functions It is often necessary to summarize data for analysis and reporting purposes. Be it determining the number of rows in a table, obtaining the sum of column’s values, or finding the column’s highest, lowest, or average value. Aggregate functions are used for this type of retrieval. Although each DBMS has its own …
SQL LIKE Operator Until now you have been using operators such as conditional operators (for testing equality), BETWEEN operator (for checking against a range of values) or IN operator (for checking against a set of values) in which one thing is common; They all search for an exact match. Filtering data that way is all well and good. But sometimes a …
SQL IN Operator The IN operator allows you to test whether a value falls within a set of values. A set can be a list of literal values, or the result of a subquery. Syntax The IN operator must be followed by a comma-delimited list of valid values enclosed within parentheses. SELECT column_name(s) FROM table_name …
SQL BETWEEN Operator In addition to checking whether an expression is equal to another expression, you can build conditions that check whether an expression falls within a certain range. This type of condition is used when working with numerical or temporal data (data related to date and time), for example, to check for all products …
SQL WHERE Clause Database tables usually contain large amounts of data, and you rarely need to retrieve all the rows in a table. More often than not, you will want to retrieve the subset of the table’s data as needed for specific operations or reports. Retrieving the desired data involves specifying search criteria, also known …
SQL SELECT Statement The SQL statement that you will probably use most often is the SELECT statement. Its purpose is to retrieve data from one or more tables of the database (or even several databases) and display it. The result of a SELECT statement is another table, also known as a result set. Syntax The …