عرض مشاركة واحدة
منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
  #1  
قديم 03-12-2010, 03:14 AM

فـ ج ـر فـ ج ـر غير متواجد حالياً

جامعي

 
تاريخ التسجيل: Dec 2010
نوع الدراسة: إنتظام
المستوى: الرابع
الجنس: أنثى
المشاركات: 2
Skaau.com (10) سؤال داتابيس1 لغة sql -ddl





السلام عليكم ورحمة الله وبركاتة ..


عندي سؤال في مادة داتابيس1

ياليت أحد يشرحه أو يعرف كيف ينحل *_* ! /
نقرتين لعرض الصورة في صفحة مستقلة


Q1: Consider the following relational database:
(EMPLOYEE ( Person_Name, Street, City
(WORKS ( Person_Name, Company_Name, Salary
(COMPANY ( Company_Name, City
(MANAGES ( Person_Name, Manager_Name
1) Give an SQL DDL definition of these database
objects, use appropriate data types and include the following integrity constraints in the DDL definition:
Identify and include referential integrity constraints that should hold in this database.
All cities are mandatory fields and their default value is Riyadh and should be of the same data type.
Salaries should range from 10,000 to 25,000 and the default value of the employee street address is ‘123M.St.’.
Employees cannot be deleted if they are working for a company.
2) After defining these database objects apply and answer the following:
a)
Add a constraint called EmpMgr which ensure that there is no employee managed by manager lives in Riyadh.
b)
Remove the default value for the street address of the employee.
c)
Define a view called SalaryAvg consisting of manager name and the average salary of all employees who work for that manager.
d)
Why the database system should not allow updates to be expresses through
SalaryAvg view? Provide an example



وشكــــــــــراً..
نقرتين لعرض الصورة في صفحة مستقلة
رد مع اقتباس