SQL Server/T-SQL Tutorial/User Role/CREATE SCHEMA

Материал из SQL эксперт
Перейти к: навигация, поиск

The use of the CREATE SCHEMA statement.

5> CREATE SCHEMA AUTHORIZATION pete
6> GO
8>
9> CREATE TABLE salesman(
10>         no INT NOT NULL UNIQUE,
11>         fname CHAR(20) NOT NULL,
12>         lname CHAR(20) NOT NULL,
13>         product_no CHAR(10))
14> GO
1>
2> CREATE TABLE product(
3>         product_no CHAR(10) NOT NULL UNIQUE,
4>         product_name CHAR(20) NULL,
5>         price MONEY NULL)
6> GO
1>
2> CREATE VIEW product_info
3>         AS SELECT product_no, product_name
4>           FROM product
5> GO
1>
2> drop view product_info;
3> GO
1>
2> drop table project;
3> GO
1>
2> drop table salesman;
3> GO
1>