تحليل وتصميم قواعد بيانات
Открыть в Telegram
هذا القروب يهتم بقواعد البيانات database oracle access mysql ومناقشة الافكار والمخططات وحل المشاكل البرمجية وتبادل الافكار والمعلومات وكذلك تصميم وتطوير مواقع الويب Html css javascript Jquery ajax Php
БольшеИракКатегория не указана
4 077
Подписчики
Нет данных24 часа
Нет данных7 дней
Нет данных30 дней
Архив постов
حل اختبارات مهارات العربي
كما نعمل جميع البحوث
بحث تاريخي
بحث ديني
بحث علمي
بحث قانوني
بحث اداري
عقود المقاولات
كما نلخص جميع المواد
وحل اختبارات الثقافة والعربي
وحل جميع الواجبات
وحل واجبات الانقليزي
للتواصل معنا على الخاص
كما نحل مواد اختبارات الثقافة الإسلامية والمهارات العربية
نضمن لك فيهم درجة فل مارك
دكتور/ عبادي
للتواصل مع الدكتور
@Hhhrjjr
09 нояб. 2022, 12:01
@AbdulrahmanAlshujaa [
1391791964] 🔗
💢 ممــنوع إرسال الروابــط هنا🚫
💢الرجاء إزالة الرابط من الرسالة.
💢 وإلا ساضطر لتقييدك من النشر!.
🔘العقوبــة محظور 🚷 حتى 27/12/2021 16:10.27 дек. 2021, 09:10
The "works" table is as follows:
Works (Working number, employee number, company number, salary)
In this table, the superkey is the combination of all attributes: (Working number, employee number, company number, salary). It uniquely identifies each row in the table.
The primary key in the "works" table is the Working number attribute. It uniquely identifies each row in the table.
The foreign keys in the "works" table are the employee number and company number attributes. They refer to the Employee table and Company table, respectively.
To apply entity, referential, and general integrity constraints for the "works" table, we can use the following:
Entity Integrity Constraint: This ensures that the primary key attribute is unique and not null. In the "works" table, the primary key attribute Working number should be unique and not null.
Referential Integrity Constraint: This ensures that foreign key references are valid and that no referencing rows are deleted. In the "works" table, the foreign key attributes employee number and company number should reference valid values from the Employee table and Company table, respectively.
General Integrity Constraints: These constraints define additional rules or conditions that the data must satisfy. For example, a general integrity constraint for the "works" table could be a constraint on the salary attribute to ensure it is a positive value.
Expressions in SQL for the provided queries:
a) Create "works" table:
sql
CREATE TABLE works ( Working_number INT PRIMARY KEY, Employee_number INT, Company_number INT, Salary DECIMAL(10,2), FOREIGN KEY (Employee_number) REFERENCES Employee(Employee_number), FOREIGN KEY (Company_number) REFERENCES Company(Company_number) );
b) Insert data into "works" table:
sql
INSERT INTO works (Working_number, Employee_number, Company_number, Salary) VALUES (1, 1001, 2001, 5000), (2, 1002, 2001, 5500), (3, 1003, 2002, 6000);
c) Delete data from "works" table:
sql
DELETE FROM works WHERE Working_number = 2;
d) Find the names of all employees who work for First Bank Corporation:
sql
SELECT e.employee_name FROM works w JOIN employee e ON w.employee_number = e.employee_number JOIN company c ON w.company_number = c.company_number WHERE c.company_name = 'First Bank Corporation';
e) Find all employees in the database who live in the same cities as the companies for which they work:
sql
SELECT e.employee_name FROM works w JOIN employee e ON w.employee_number = e.employee_number JOIN company c ON w.company_number = c.company_number WHERE e.city = c.city;
f) Find all employees who earn more than the average salary of all employees of their company:
sql
SELECT e.employee_name FROM works w JOIN employee e ON w.employee_number = e.employee_number JOIN company c ON w.company_number = c.company_number WHERE w.salary > ( SELECT AVG(salary) FROM works WHERE company_number = w.company_number );
19 мая 2023, 02:40
