Basic questions about relational database standard language SQL

Source: Internet
Author: User
Tags create index table definition

1 . The characteristics of SQL language are discussed.

For:

The

(L SQL  definition language   DDL  manipulating language   Span style= "font-family: ' Times New Roman ';" >dml   , data control language   DCL   function in one.

(2) high degree of non-process. data operations in the SQL language, as long as the "What to do", without indicating "how", so there is no need to understand the access path, the choice of Access path and The operation of the SQL statement is automatically completed by the system.

(3) set-oriented operation mode. the SQL language takes a collection operation, not only manipulating objects, finding results can be a collection of tuples, but also an object of one insert, delete, update operation can be a set of tuples.

(4) to provide two ways of using the same grammatical structure. SQL language is both a self-contained language and an embedded language. As a self-contained language, it can be used independently of the way online interaction is used, and as an embedded language, it can be embedded in a high-level language program for programmers to use when designing programs.

(5) Simple language, easy to learn and easy to use.

2 .  the definition function of SQL is discussed in this experiment.

SqlThe data definition feature package includes defining tables, defining views, and defining indexes . SQLlanguage UseCREATE TABLEstatement to create a basic table,ALTER TABLEstatement to modify the base table definition,DROP TABLEstatement to delete the base table;CREATE INDEXstatement to create an index,DROP INDEXstatement to delete an index;CREATE VIEWstatement to establish a view,DROP VIEWstatement to delete a view.

3. What is a basic table? What is a view?

For:

What are the differences and connections between the two? A base table is a table that exists independently of itself, and a relationship in SQL corresponds to a table . A view is a table that is exported from one or several basic tables . The view itself is not stored independently in the database, and is a virtual table . That is, the database stores only the definition of the view without storing the data for the view, which is still stored in the base table of the exported view. Views are conceptually equivalent to basic tables, and users can use views as if they were basic tables, and they can then define views on the view.

4 . The advantages of the view.

For

(l ) The view simplifies the user's operation; (2 ) The view enables the user to see the same data in multiple angles; (3 ) The view provides a certain degree of logical independence to the reconstructed database; (4 view to provide security protection for confidential data.

5 . Can all views be updated? Why?

Answer :

No. Views are virtual tables that do not actually store data, so updates to the view are eventually converted to updates to the base table. Not all views are updatable because some view updates cannot be converted to the only meaningful changes to the corresponding base tables .

6 . What kind of view can be updated? What kind of view is not updatable? One example shows.

A: The subset view of the base table is generally updatable. If a view's properties come from a set function, an expression , the view must not be updated.

7. Describe the concept of the relational model, define and interpret the following terms: (L ) relationship ( 2 ) attribute ( 3 ) domain ( 4 ) tuple (5 ) main code ( 6 ) component ( 7 ) Relationship mode

For:

The relational model consists of three parts: relational data structure, relational operation set and relationship integrity constraint . In the user's view, the logical structure of data in a relational model is a two-dimensional table, which consists of rows and columns.

(l ) Relationship: A relationship corresponds to a table usually said;

(2 ) attribute: A column in a table is an attribute;

(3 ) domain: The value range of the attribute;

(4 ) tuples: A row in a table is a tuple;

(5 ) Main code: an attribute group in a table that can uniquely determine a tuple;

(6 ) Component: A property value in a tuple;

(7 ) Relational mode: A description of a relationship, typically expressed as a relationship name (attribute 1 , attribute 2 , ..., attribute N)

8 . The composition of the database system is discussed.

A: Database systems are generally composed of databases, database management systems (and their development tools), Application Systems, database administrators, and users .

Basic questions about relational database standard language SQL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.