Программирование >>  Руководство по sql 

1 ... 93 94 95 [ 96 ] 97 98 99 ... 105


royshed

titlejd

lorange

hirange

royalty

char(6)

float

not null

null

null

null

index

rstidind

BUllll

4000

0,100000

BUllll

4001

8000

0.120000

BUllll

8001

50000

0.140000

MC2222

2000

0.100000

MC2222

2001

4000

0.120000

MC2222

4001

8000

0.140000

MC2222

8001

12000

0.160000

TC7777

5000

0.100000

TC7777

5001

15000

0.120000

TC4203

2000

O.IOOOOO

TC4203

2001

8000

0.120000

TC4203

8001

16000

0.140000

BU7832

5000

0.100000

BU7832

5001

50000

0.120000

PS1372

50000

0.100000

ОПЕРАТОРЫ CREATE И INSERT ДЛЯ БАЗЫ ДАННЫХ

BOOKBIZ

Для воссоздания базы данных bookbiz вы можете использовать приведенный ниже код (для Sybase Anywhere). Мы не гарантируем его правильную работу в других версиях SQL.

Для SQL Anywhere 3/1/96 */

set option date format=Minm dd yyyy hh:mmaa go

set option date order = MDY go

set option scale = 2 go

drop table authors go

create table authors

(au id char(11) not null, au lname varchar(40) not null, au fname varchar(20) not null, phone char(12) null, address varchar(40) null, city varchar(20) null, state char(2) null, zip char(5) null)

grant select on authors to public go

drop table publishers go

create table publishers

(pub id char(4) not null.



pub name varchar(40) null, address varchar(40) null, city varchar(20) null, state char(2) null)

grant select on publishers to public go

drop table roysched

create table roysched

(title id char(6) not null, lorange int null, hirange int null, royalty float null)

grant select on roysched to public go

drop table titleauthors go

create table titleauthors

(au id char(11) not null, title id char(6) not null, au ord tinyint null, royaltyshare float null)

grant select on titleauthors to public go

drop table titles go

create table titles

(title id char(6) not null, title varchar(80) not null, type char(12) null, pub id char(4) null, price money null, advance money null, ytd sales int null, contract bit not null, notes varchar(200) null, pubdate date null)

grant select on titles to public go

drop table editors go

create table editors

(ed id char(11) not null, ed lname varchar(40) not null, ed fname varchar(20) not null, ed pos varchar(12) null, phone char(12) null, address varchar(40) null, city varchar(20) null.



state char(2) null, zip char(5) null)

grant select on editors to public go

drop table titleditors go

create table titleditors

(ed id char(11) not null, title id char(6) not null, ed ord tinyint null)

grant select on titleditors to public go

drop table sales go

create table sales

(sonum int not null, stor id char(4) not null, ponum varchar(20) not null, sdate date null)

grant select on sales to public go

drop table salesdetails go

create table salesdetails

(sonum int not null, qty ordered smallint not null, qty shipped smallint null, title id char(6) not null, date shipped date null)

grant select on salesdetails to public go

create unique index pubind on publishers

(pub id)

create unique index auidind

on authors (au id)

create index aunmind

on authors (au lname, au fname)

create unique index titleidind

on titles (title id)

create index titleind on titles (title) go

create unique index taind

on titleauthors (au id, title id)



1 ... 93 94 95 [ 96 ] 97 98 99 ... 105

© 2006 - 2024 pmbk.ru. Генерация страницы: 0.001
При копировании материалов приветствуются ссылки.
Яндекс.Метрика