Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

ОБД / лабки / обд14

.docx
Скачиваний:
0
Добавлен:
27.01.2024
Размер:
847.81 Кб
Скачать

Звіт з лабораторної роботи 14

Студента 310 групи

Бойко Є. А.

Лабораторна робота 14

Тема: Реалізація запитів зі з’єднаннями таблиць.

Мета: закріпити навички розроблення запитів до БД з використанням

з’єднання таблиць.

Форма звіту: електронний звіт.

ЗАВДАННЯ

Виконати запити до бази даних student_college2 згідно завданню з

таблиці 1. Результати подати у вигляді змісту запиту, синтаксису запиту та

скрін-шоту результату виконання запиту з екрану.

select employee.first_name,employee.second_name,education.education_name from employee RIGHT join education on employee.employee_id=education.employee_id

select employee.first_name,employee.second_name,education.education_name from employee NATURAL join education

select employee.first_name,employee.second_name,education.education_name from employee join education USING (employee_id)

select employee.first_name,employee.second_name,education.education_name from employee join education on employee.employee_id=education.employee_id

select employee.first_name,employee.second_name, position.position_name from employee natural join position where position.position_name like ("%Develop%")

select employee.first_name,employee.second_name, position.position_name from employee join position USING (position_id) where position.position_name like ("%Develop%")

select employee.first_name,employee.second_name, position.position_name from employee join position on employee.position_id=position.position_id where position.position_name like ("%Develop%")

select position.position_name, structure.structure_name from position left join structure on position.structure_id=structure.structure_id

select position.position_name, structure.structure_name from position RIGHT join structure on position.structure_id=structure.structure_id

select position.position_name, structure.structure_name from position left join structure on position.structure_id=structure.structure_id where position.salary < 4000

select position.position_name, structure.structure_name from structure RIGHT join position on position.structure_id=structure.structure_id where position.salary < 4000

select schedule.schedule_name,schedule.hours from schedule JOIN employee USING (schedule_id) join position USING (position_id) where position.salary<5500

select schedule.schedule_name,schedule.hours from schedule

JOIN employee on schedule.schedule_id=employee.schedule_id

join position on position.position_id=employee.position_id where position.salary<5500

select client.client_name from client RIGHT JOIN project on client.client_id=project.client_id where project.project_type = "local app"

select employee.first_name,employee.second_name from employee RIGHT JOIN schedule on employee.schedule_id=schedule.schedule_id where schedule.hours >100

select project.project_title, documents.title from project LEFT join documents on project.project_id=documents.project_id where project.project_type = "web app"

select employee.first_name,employee.second_name, schedule.schedule_name, schedule.hours from employee RIGHT join schedule on schedule.schedule_id=employee.schedule_id where employee.country = "Украина" ORDER BY schedule.hours

select * from position left join structure on structure.structure_id=position.structure_id GROUP BY structure.structure_name,position.position_name

select * from position join structure on structure.structure_id=position.structure_id GROUP BY structure.structure_name,position.position_name

.

select * from position join structure USING (structure_id) GROUP BY structure.structure_name,position.position_name

Висновок: на лабораторній рототі №14 я закріпив навички розроблення запитів до БД з використанням з’єднання таблиць.

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