SQL concept

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/yu444/article/details/52964404

SQL tutorial gives unique learning on Structured Query Language and it helps to make practice on SQL commands which provides immediate results.

  • MS SQL Server using T-SQL
  • Oracle using PL/SQL
  • MS Access version of SQL is called JET SQL

When you are executing an SQL command for any RDBMS, the system determines the best way to carry out your request and SQL engine figures out how to interpret the task.

SQL Archetecture
这里写图片描述

Common SQL command:

  • CREATE Creates a new table, a view of a table, or other object in database
  • ALTER Modifies an existing database object, such as a table.
  • DROP Deletes an entire table, a view of a table or other object in the database.
  • INSERT Creates a record
  • UPDATE Modifies records
  • DELETE Deletes records
  • GRANT Gives a privilege to user
  • REVOKE Takes back privileges granted from user
  • SELECT Retrieves certain records from one or more tables

RDBMS stands for Relational Database Management System. RDBMS is the basis for SQL and for all modern database systems like MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access.

Table elements:

  • A field is a column in a table that is designed to maintain specific information about every record in the table.
  • A record, also called a row of data, is each individual entry that exists in a table.
  • A column is a vertical entity in a table that contains all information associated with a specific field in a table.
  • A NULL value in a table is a value in a field that appears to be blank, which means a field with a NULL value is a field with no value.
  • Constraints are the rules enforced on data columns on table. These are used to limit the type of data that can go into a table. This ensures the accuracy and reliability of the data in the database.
  • The DEFAULT constraint provides a default value to a column when the INSERT INTO statement does not provide a specific value.
  • The UNIQUE Constraint prevents two records from having identical values in a particular column.
  • A primary key is a field in a table which uniquely identifies each row/record in a database table. Primary keys must contain unique values. A primary key column cannot have NULL values.
  • A foreign key is a key used to link two tables together. This is sometimes called a referencing key.The relationship between 2 tables matches the Primary Key in one of the tables with a Foreign Key in the second table.

猜你喜欢

转载自blog.csdn.net/yu444/article/details/52964404