Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
BD / Labs / English / Lab4-SELECT statement basic features.doc
Скачиваний:
28
Добавлен:
20.02.2016
Размер:
347.14 Кб
Скачать
    1. Вариант 18

1) По каждому преподавателю выведите его имя и разность между датой приема на работу и деления ставки на надбавку (столбец с именем «Выражение»). Что получается в результате вычисления hiredate - (Salary/Commission)?

2) По каждой аудитории корпуса 6 вывести ее номер и названия кафедр, на которых проволятся занятия в этой аудитории студентам 1 курса.

3) Вывести названия факультетов, студентам которых преподают преподаватели кафедры ИПО

4) Вывести названия факультетов, преподаваетели-профессора которых имеют занятия на парах в диапазоне 2-6

5) Вывести номера аудиторий и их корпуса, в которых преподаватели-ассистенты проводят занятия типа 'лабораторная' в один из следующих дней: понедельник, середа, четверг, суббота.

6) Вывести пары имен преподавателей, удовлетворяющих следующему условию: первый преподаватель является куратором группы, имеющей рейтинг больше, чем в два раза, рейтинга группы, куратором которой является второй преподаватель

7) Вывести имена преподавателей и дату поступления их на работу, которые НЕ удовлетворяют следующему условию:

их ставка (salary) больше 2000 или их надбавка (commission) больше одной четвертой части ставки И

их непосредственный руководитель был принят на работу либо в диапазоне дат 01.01.1995-31.12.1996 либо в диапазоне дат 01.01.1998-07.08.1999 И

их непосредственный подчиненный либо является ассистентом либо имеет зарплату (salary+commission) в диапазоне 2000-3000

  1. Control questions

Please, give answers to the following questions:

1) How can you specify output of all columns of the table?

2) Why it is necessary to qualify column names? How it is done?

3) Does query result contain duplicate values? How can you delete duplicate values of query result?

  1. What is the value of an expression with null value?

  2. Why it is necessary to qualify table names in FROM query? How it is done?

  3. The following statement are not correct. Why?

a) Select *

b) Select * from teacher

c) select name post salary FROM teacher;

  1. What output the following query:

SELECT *

FROM TEACHER

WHERE Salary < 300 OR NOT(Hiredate = '17.06.2002' AND Post != 'professor');

  1. How can you join two or more tables.

  2. What is an outer join? Formulate and write query with outer join.

  3. What is the DUAL table?

  4. Show truth tables of logical operators NOT, AND, OR.

  1. Appendices

    1. Appendix a. Sql Oracle operators

An operator manipulates individual data items and returns a result. Data items are called operands or argu­ments. Operators are represented by special characters or by keywords. For example, the multiplication opera­tor is represented by an asterisk (*) and the operator that tests for nulls is represented by the keywords IS NULL.

      1. Unary and binary operators

The two general classes of operators are:

unary

A unary operator operates on only one operand. A unary operator typically appears with its operand in this format: operator operand.

binary

A binary operator operates on two operands. A binary operator appears with its operands in this format:operand1 operator operand2.

Other operators with special formats accept more than two operands. If an operator is given a null operand, the result is always null. The only operator that does not follow this rule is concatenation (||).

Соседние файлы в папке English