Common database objects

Source: Internet
Author: User
Tags first row access

Database objects are part of a database and are common in the following ways:

3.3.1 Tables (table)
The tables in the database are similar to the tables we use in our daily lives, and are made up of rows (row) and columns (column). The white-white portion of the black background in figure 3-1 is called a row, and the black-and-white part of Figure 3-2 is called a column. Columns are made up of similar information, each column is called a field, and the title of each column is called the field name. A row includes several column information items. A row of data is called one or a record, and it conveys a meaningful combination of information. A database table consists of one or more records, and a table without records is called an empty table. Each table typically has a primary key that uniquely identifies a record, such as the emp_id column in Figure 3-1. The first record in Figure 3-1, the first row of data, is the message: 10010001 of the employee named John, sex male, was born on February 14, 1968, work level of 1, workers
The department number is 1001, the date of employment is August 2, 1996, the monthly salary is 8000 yuan.


3.3.2 Indexes (Index)
Indexes are in the order in which they are set up according to the specified database table columns. It provides a quick way to access the data and supervises the data in the table so that the data in the column to which the index points is not duplicated. As shown in Figure 3-3.


3.3.3 View
The view looks exactly like the table, has a set of named fields and data items, but it is actually a virtual table that is not actually stored in the database. The view is generated by the Query database table, which restricts the data that users can see and modify. This shows that the view can be used to control user access to the data and to simplify the display of data, that is, through the view only the data information needed. For example:
From Figure 3-2, extract the field employee number emp_id, employee name E_name, employee department number dept_id, member
Wage e_wage form an employee payroll information sheet. As shown in Figure 3-4.

Extract data from figure 3-2 to form an employee information table with a work level (Job_level) of 2. As shown in Figure 3-5.


3.3.4 Chart (Diagram)
The diagram in SQL Server is actually a diagram of the relationship between database tables. It allows you to edit the relationship between tables. As shown in Figure 3-6.


3.3.5 defaults (default)
The default value is to give a predefined value to a column or column data item that does not specify its specific value when you create a column or insert data in a table. As shown in Figure 3-7.


3.3.6 Rules (rule)
A rule is a restriction on the data information in a database table. It defines the columns of the table. As shown in Figure 3-8.


3.3.7 triggers (Trigger)
A trigger is a collection of user-defined SQL transaction commands. This set of commands is automatically executed when a table is inserted, changed, and deleted. As shown in Figure 3-9.


3.3.8 stored Procedures (Stored Procedure)
A stored procedure is a set of SQL program statements that are pooled together to accomplish specific functions, and are compiled into SQL programs stored in the database. As shown in Figure 3-10.


3.3.9 Users (user)
The so-called user is the person who has access to the database.
There are a lot of database objects



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.