Data Organization, SQL Server, Interview Preparation Notes

2019年12月15日 7708点热度 0人点赞 3条评论
内容目录

 

Categories of Knowledge Points to Master in T-SQL

  • SQL for executing queries against databases
  • SQL for retrieving data from databases
  • SQL for inserting new records into databases
  • SQL for updating data within databases
  • SQL for deleting records from databases
  • SQL for creating new databases
  • SQL for creating new tables in databases
  • SQL for creating stored procedures in databases
  • SQL for creating views in databases
  • SQL for setting permissions on tables, stored procedures, and views

SQL is an ANSI standard computer language used to access and manipulate database systems. SQL statements are used to retrieve and update data within databases. SQL can work in conjunction with database programs such as MS Access, DB2, Informix, MS SQL Server, Oracle, Sybase, and other database systems.

Unfortunately, there are many different versions of SQL, but to remain compatible with the ANSI standard, they must support some key keywords (such as SELECT, UPDATE, DELETE, INSERT, WHERE, etc.) in similar ways.

Reference: http://www.w3school.com.cn/sql/sql_intro.asp


SQL DML and DDL

SQL can be divided into two parts: Data Manipulation Language (DML) and Data Definition Language (DDL).

SQL (Structured Query Language) is the syntax used for executing queries. However, SQL also contains syntax for updating, inserting, and deleting records.

The query and update commands make up the DML part of SQL:

Summary: Select, Update, Delete, Insert

  • SELECT - retrieve data from database tables
  • UPDATE - update data in database tables
  • DELETE - remove data from database tables
  • INSERT INTO - insert data into database tables

The Data Definition Language (DDL) part of SQL enables us to create or delete tables. We can also define indexes (keys), specify relationships between tables, and enforce constraints between tables.

The most important DDL statements in SQL:

  • CREATE DATABASE - create a new database
  • ALTER DATABASE - modify a database
  • CREATE TABLE - create a new table
  • ALTER TABLE - change the database table
  • DROP TABLE - delete a table
  • CREATE INDEX - create an index (search key)
  • DROP INDEX - delete an index

Learning Website

http://www.w3school.com.cn/sql/ 

Exercise Collection

http://pan.whuanle.cn/index.php?dir=uploads/Sql/

 

痴者工良

高级程序员劝退师

文章评论