SQL Introduction
What is SQL
Stands for Structured Query Language it lets you Access and manipulate databases
What Can SQL do
- Create new databases
Syntax: CREATE DATABASE database_name - create new tables in a database
Syntax: CREATE TABLE table_name (column1 datatype, column2 datatype, column3 datatype,); - Insert records in a database
Syntax: INSERT INTO table_name VALUES (value1, value2, value3, ...); - Retrieve data from a database
Syntax: SELECT * FROM table_name;
NOTE: insted of * you can use fileds which fileds we want retrive. - Delete records from a database
Syntax: DELETE FROM table_name WHERE condition; - Update records in a database
Syntax: UPDATE table_name SET column1 = value1, column2 = value2, WHERE condition;
- Execute queries against a database
- Create stored procedures in a database
- Create views in a database
- Set permissions on tables, procedures, and views
- However, to be compliant with the ANSI standard, they all support at least the major commands (such as SELECT, UPDATE, DELETE, INSERT, WHERE) in a similar manner.
Using SQL
To build a web site that shows data from a database, you will need:
An RDBMS database program (i.e. MS Access, SQL Server, MySQL)
An RDBMS database program (i.e. MS Access, SQL Server, MySQL)
What is an Operator in SQL
An operator is a reserved word or a character used primarily in an SQL statement's WHERE clause to perform operation(s), such as comparisons and arithmetic operations. These Operators are used to specify conditions in an SQL statement and to serve as conjunctions for multiple conditions in a statement.
- Arithmetic operators
- Comparison operators
- Logical operators
- Operators used to negate conditions
Comments
Post a Comment