SQL(Structured Query Language)
SQL is a language that interacts with the database on the server-side. This dynamite duo has changed the structure of the internet forever. Sure, programming languages like PHP, ASP, and ColdFusion made the internet dynamic, but the efficiency of SQL has revolutionized how user's interact with websites.
RDBMS stands for Relational Database Management System. Dbms is Acutaully just collection of file and store data in files, While RDBMS is store data in table format RDBMS is the basis for SQL, and for all modern database systems such as MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access. The data in RDBMS is stored in database objects called tables.
CREATE TABLE TableName
(
ColumnName1 data_type(size) ConstraintName,
ColumnName2 data_type(size) ConstraintName,
....
);
Most Commanly used Constrainta see above-
NOT NULL - Not Null Constraints Indicates that a column cannot store NULL value
UNIQUE - Unique key is that each row for a column must have a unique value
PRIMARY KEY - Primary key is a combination of a NOT NULL and UNIQUE. Ensures that a column (or combination of two or more columns) have an unique identity which helps to find a particular record in a table more easily and quickly
FOREIGN KEY - FOREIGN KEY is Ensure the referential integrity of the data in one table to match values in another table
CHECK - Ensures that the value in a column meets a specific condition
DEFAULT - DEFAULT Specifies Provide default value for a column when specified none for this column.
SQL is a language that interacts with the database on the server-side. This dynamite duo has changed the structure of the internet forever. Sure, programming languages like PHP, ASP, and ColdFusion made the internet dynamic, but the efficiency of SQL has revolutionized how user's interact with websites.
What is SQL?
SQL is Structured Query Language, which is a computer language for storing, manipulating and retrieving data stored in relational database.
SQL is the standard language for Relation Database System. All relational database management systems like MySQL, MS Access, Oracle, Sybase, Informix, postgres and SQL Server use SQL as standard database language.
Why SQL?
- Allows users to access data in relational database management systems.
- Allows users to describe the data.
- Allows users to define the data in database and manipulate that data.
- Allows to embed within other languages using SQL modules, libraries & pre-compilers.
- Allows users to create and drop databases and tables.
- Allows users to create view, stored procedure, functions in a database.
- Allows users to set permissions on tables, procedures, and views
What Can SQL do?
- SQL can execute queries against a database
- SQL can retrieve data from a database
- SQL can insert records in a database
- SQL can update records in a database
- SQL can delete records from a database
- SQL can create new databases
- SQL can create new tables in a database
- SQL can create stored procedures in a database
- SQL can create views in a database
- SQL can set permissions on tables, procedures, and views
History
- 1970 -- Dr. Edgar F. "Ted" Codd of IBM is known as the father of relational databases. He described a relational model for databases.
- 1974 -- Structured Query Language appeared.
- 1978 -- IBM worked to develop Codd's ideas and released a product named System/R.
- 1986 -- IBM developed the first prototype of relational database and standardized by ANSI. The first relational database was released by Relational Software and its later becoming Oracle.
What is RDBMS
RDBMS stands for Relational Database Management System. Dbms is Acutaully just collection of file and store data in files, While RDBMS is store data in table format RDBMS is the basis for SQL, and for all modern database systems such as MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access. The data in RDBMS is stored in database objects called tables.
What is Table ?
Table is Basicaly Store Data in Rows and Columns format known as Table. Just a Collection of Rows and Columns.Constraints
SQL constraints are used to specify rules for the data in a table. If there is any violation between the constraint and the data action, the action is aborted by the constraint. Constraints can be specified when the table is created (inside the CREATE TABLE statement) or after the table is created (inside the ALTER TABLE statement).Constraint Example.
CREATE TABLE TableName
(
ColumnName1 data_type(size) ConstraintName,
ColumnName2 data_type(size) ConstraintName,
....
);
Most Commanly used Constrainta see above-
NOT NULL - Not Null Constraints Indicates that a column cannot store NULL value
UNIQUE - Unique key is that each row for a column must have a unique value
PRIMARY KEY - Primary key is a combination of a NOT NULL and UNIQUE. Ensures that a column (or combination of two or more columns) have an unique identity which helps to find a particular record in a table more easily and quickly
FOREIGN KEY - FOREIGN KEY is Ensure the referential integrity of the data in one table to match values in another table
CHECK - Ensures that the value in a column meets a specific condition
DEFAULT - DEFAULT Specifies Provide default value for a column when specified none for this column.
0 comments :
Post a Comment