Posts

Showing posts from August, 2019

class 5 - SQL Operators

SQL Arithmetic Operators Operator Description Example + Add Try it - Subtract Try it * Multiply Try it / Divide Try it % Modulo Try it SQL Bitwise Operators Operator Description & Bitwise AND | Bitwise OR ^ Bitwise exclusive OR SQL Comparison Operators Operator Description Example = Equal to Try it > Greater than Try it < Less than Try it >= Greater than or equal to Try it <= Less than or equal to Try it <> Not equal to Try it SQL Compound Operators Operator Description += Add equals -= Subtract equals *= Multiply equals /= Divide equals %= Modulo equals &= Bitwise AND equals ^-= Bitwise exclusive equals |*= Bitwise OR equals SQL Logical Operators Operator Description Example ALL TRUE if all of the subquery values meet the condition Try it AND TRUE if all the conditions separated by AND is TRUE Try it ANY TRUE if any of the subquery values meet the condition Try it BETWEEN TRUE if the operand is within the...

class 4 - SQL COMMANDS and sample code to Create tables with constraints

- List of SQL commands SQL, 'Structured Query Language', is a programming language designed to manage data stored in relational databases. SQL operates through simple, declarative statements. This keeps data accurate and secure, and helps maintain the integrity of databases, regardless of size. Here's an appendix of commonly used commands. COMMANDS ALTER TABLE ALTER TABLE table_name ADD column datatype;   ALTER TABLE  lets you add columns to a table in a database. AND SELECT column_name(s) FROM table_name WHERE column_1 = value_1 AND column_2 = value_2;   AND  is an operator that combines two conditions. Both conditions must be true for the row to be included in the result set. AS SELECT column_name AS 'Alias' FROM table_name;   AS  is a keyword in SQL that allows you to rename a column or table using an  alias . AVG SELECT AVG(column_name) FROM table_name;   AVG()  is an aggregate function that return...