Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE T1 (
- subd_id NUMBER(3) NOT NULL PRIMARY KEY ,
- subd_name VARCHAR( 20 ) NOT NULL ,
- subd_type VARCHAR( 20 ) NOT NULL ,
- subd_firm VARCHAR( 30 ) NOT NULL
- );
- INSERT INTO T1 (subd_id, subd_name, subd_type, subd_firm)
- VALUES(1, 'Access', 'Реляц', 'Microsoft');
- INSERT INTO T1 (subd_id, subd_name, subd_type, subd_firm)
- VALUES(2, 'FoxPro', 'Реляц','Microsoft');
- INSERT INTO T1 (subd_id, subd_name, subd_type, subd_firm)
- VALUES(3,'Oracle7', 'Реляц', 'Oracle');
- INSERT INTO T1 (subd_id, subd_name, subd_type, subd_firm)
- VALUES(4,'Orion3', 'OO',' Orion');
- INSERT INTO T1 (subd_id, subd_name, subd_type, subd_firm)
- VALUES(5,'Orion4', 'OO','Orion');
- INSERT INTO T1 (subd_id, subd_name, subd_type, subd_firm)
- VALUES(6,'Delpi', 'OO','Microsoft');
- INSERT INTO T1 (subd_id, subd_name, subd_type, subd_firm)
- VALUES(7,'Essbase1', 'Многом','Arbor');
- INSERT INTO T1 (subd_id, subd_name, subd_type, subd_firm)
- VALUES(8, 'Essbase2', 'Многом','Arbor');
- INSERT INTO T1 (subd_id, subd_name, subd_type, subd_firm)
- VALUES(9,'Orion5', 'Многом','Orion');
- INSERT INTO T1 (subd_id, subd_name, subd_type, subd_firm)
- VALUES(10,'Oracle8', 'Многом','Oracle');
- SELECT COUNT(*) FROM T1
- WHERE (subd_name != '&1');
- ACCEPT v CHAR PROMPT '1 или 2:'
- IF v = 1 THEN
- (SELECT * FROM T1
- WHERE subd_type != (SELECT MIN(subd_type) FROM T3));
- ELSE (SELECT * FROM T1
- WHERE subd_type != (SELECT MAX(subd_type) FROM T3));
- SELECT * FROM T1
- WHERE subd_firm NOT IN
- (SELECT subd_firm FROM T1
- WHERE subd_type = '&1');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement