Sql&sybase

Source: Internet
Author: User
Tags sybase sybase database

I. Sybase database Basics 1. Conceptual knowledge

Sybase contains a system database and a user database, which is a multi-library structure.

The database is generally placed on device devices, and the device generally uses the operating hard disk. A library can be placed on multiple devices, and one device can put multiple libraries.

So the general data storage relationship is: data---table--and library----operating system physical files

So the data storage order is: Create a device, create a library, create a table, insert data

2. Create a Device

DISK Init

Name= "Dev_data",

Physname= "D:\DATA\DEV_MyDATA.dat",

Size= "500M",

DISK Init

Name= "Dev_log",

Physname= "D:\DATA\DEV_MyLOG.dat",

Size= "1000M",

3. Create a library

Create DATABASE MYDB

On dev_data=500

Log on dev_log=1000

4. Related Operations of the table

The table includes user tables, system tables, and temporary tables.

Note: There are now non-relational databases, such as NoSQL, MongoDB

4.1 User Tables

Create a user table

Syntax: CREATE TABLE user name

(column 1 data type 1,

Column 2 data type 2,

..... )

Example:

CREATE TABLE Users (
ID integer NOT NULL,
CNAME char () NULL,
URL char () NULL,
father_id integer NULL,
Row_select_flag char (1) default ' 0 ' null,
Seqid char (3) NULL,
Memos varchar (+) NULL
)

Go

Delete a table

Syntax: DROP table name

Example:

if exists (select 1 from sysobjects
WHERE id = object_id (' users ') and type = ' U ')
drop TABLE Users
Go

4.2 System tables

Create system tables?????? It's not clear to understand

4.3 Temporary tables

Create a temporary table

Syntax: Mode one: Create TABLE #表名称

The temporary table created by this method only has current session access and disappears at the end of the session

Mode two: CREATE table tempdb. Table name

Temporary tables created by this method can be shared until the display is deleted or the restart service disappears

5. View

View from a real table

6. Stored Procedures

A stored procedure is a collection of SQL statements and control-flow languages.

All system stored procedures start with sp_

7. Triggers

A trigger is a stored procedure that is triggered when inserted, deleted, or updated in a table, and is often used to perform some automated actions.

8. Business

Need to understand again.

Second, Sybase configuration management

Pending

Third, Sybase configuration tuning

Pending

IV. basic knowledge of SQL

See MySQL must know.

Sql&sybase

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.