Hostgre


HomeReferenceArchive by category "SQL"

SQL


Nov
16
2018
10:14 pm

SQL IN Operator

The IN operator allows you to specify multiple values in a WHERE clause. The IN operator is a shorthand for multiple OR conditions. IN Syntax SELECT column_name(s) FROM table_name WHERE column_name IN (value3, value4, ...); or: SELECT column_name(s) FROM table_name WHERE column_name IN (SELECT STATEMENT); Demonstration Here is a selection from the "Customers" table in the sample database: CustomerID CustomerName ContactName Address City PostalCode Country 1 Antoniev[continue...]


Nov
16
2018
9:54 pm

SQL MAX() and MIN() Functions

The MAX() function finds the largest value of the selected column. The MIN() function finds the smallest value of the selected column. MAX() Syntax SELECT MAX(column_name) FROM table_name WHERE condition; MIN() Syntax SELECT MIN(column_name) FROM table_name WHERE condition;   Demonstration Here is a selection from the "Products" table in the sample database: ProductID ProductName SupplierID CategoryID Unit Price 1 Whey Protein[continue...]


Nov
04
2018
6:42 pm

SQL UNIQUE Constraint

The unique constraint ensures that all values in a column are totally different.Both the unique and primary KEY constraints give a guarantee for singularity for a column or set of columns.A PRIMARY KEY constraint automatically contains a unique constraint.However, you'll be able to have several unique constraints per table, however only 1 PRIMARY KEY constraint per table. SQL unique Constraint on create TABLE The following SQL creates a unique constraint on the "ID" column once the "Persons" table is created: SQL Server / Oracle / MS Access: CREATE TABLE Persons (ID[continue...]


Nov
04
2018
5:49 pm

SQL Hosting

If you wish your site to be ready to store and retrieve information from a database, your internet server should have access to a database-system that uses the SQL language. If your web server is hosted by an internet Service provider (ISP), you will need to explore for SQL hosting plans. The most common SQL hosting databases are MySQL, MS SQL Server, MS Access and Oracle. MySQL MySQL is a preferred database software for internet sites. Could be a very powerful, strong and full featured SQL database system. Is an affordable alternative to the costly Microsoft[continue...]


Nov
04
2018
5:20 pm

SQL Reference

SQL Statement Syntax AND / OR SELECT column_name(s)FROM table_nameWHERE conditionAND|OR condition ALTER TABLE ALTER TABLE table_nameADD column_name datatypeorALTER TABLE table_nameDROP COLUMN column_name AS (alias) SELECT column_name AS column_aliasFROM table_nameorSELECT column_nameFROM table_name  AS table_alias BETWEEN SELECT column_name(s)FROM table_nameWHERE column_nameBETWEEN value1 AND value2 CREATE DATABASE CREATE DATABASE database_name CREATE TABLE CREATE TABLE table_name(column_name1 data_type,column_name2 data_type,column_name3 data_type,...) CREATE[continue...]