Consider the following collection of relation schemes:
instructor (ID, name, dept_name, salary)
teaches (ID, course id, sec id, semester, year)
Using the above relations, write an equivalent relational algebra expression for the following:
∏name (sinstructor.ID =teaches.ID (sdept_name =“Physics” (instructor × teaches)))
Let us first decode the given relational algebra expression
∏name (σinstructor.ID =teaches.ID (σdept_name =“Physics” (instructor × teaches))
Give name of those Instructor who teaches “Physics”
Equivalent for the above can be
∏name(instructor)(σdept_name=“Physics” ( σ instructor.ID=teaches.ID (instructor x teaches)))
Select instructors which have dept_name as physics
Project or display name from instructor whose dept_name = “Physics”
We can simply use this also to display name from instructor whose dept_name = “Physics”
∏name(instructor)(σdept_name=“Physics”)
Consider the following collection of relation schemes: instructor (ID, name, dept_name, salary) teaches (ID, course...
Consider the Schema diagram for a university database
a. Find the IDs of all students who have taken all of the CMPSC
courses. Use the division operation.
b. Do the same operation as in problem a, using only fundamental
operations.
student takes ID course id sec id semester 1er 4112 dept_name tot cred grade advisor section course_id sec id semester year building TOOM_10 time_slof_id course course id title dept name credits department dept name building budget time slot time slot...
SQL question, you can right-click the picture and select
open in a new tab for a better-looking experience.
Write an SQL query using the university schema to find the ID of each student who has never taken a course at the university. Do this using no subqueries and no set operations (use an outer join) University Schema student takes ID ID пате course_id sec id semester уеar grade dept_name tot_cred section course |department course id sec_id semester advisor course_id title...
Assume that the takes relation has not yet been defined. Give an
SQL statement that adds the takes relation to the database.
Assume that:
•Id is an integer
•course_id is a string of up to10 characters.
•sec_id should be a non-negative integer.
•the semester is a one-character field, equal to either ‘F’ or
‘S’, and the
•year is an integer.
•grade can be null, but if not, it should be a letter in the
string ‘ABCDF’.
Your statement must ensure...
employee(employee-id, employee-name, street, city) works(employee-id, company-id, salary) company(company-id, company-name, city) manages(employee-id, manager-id) Consider the data base above where the primary keys are in bold For each of the questions give the following. (NOTICE the Relations on the given database it isn't like the ones that are commonly posted they are slightly different) (1) a relational algebra expression, (2) a tuple relational calculus expression, and (3) a domain relational calculus expression. f. Find all employees in the database who do not...
Consider the following relations for course-enrollment database in a university: STUDENT(S-ID,S-Name, Department, Birth-date) COURSE(C-ID, C-Name, Department) ENROLL(S-ID, C-ID, Grade) TEXTBOOK(B-ISBN, B-Title, Publisher, Author) BOOK-ADOPTION(C-ID, B-ISBN) (a) Draw the database relational schema and show the primary keys and referential integrity constraints on the schema. (b) How many superkeys does the relation TEXTBOOK have? List ALL of them. (c) Now assume each COURSE has distinct C-Name. (i) If C-ID is a primary key, what are the candidate keys and the unique keys...
Relational Schema: Department(Department_Name: String, Building:String, Budget:Double) Course(Course_ID:String, Course_Title:String, Department_Name:String, Credits:Integer) Prereq(Course_ID:String, Prereq_ID:String) Instructor(Instructor_ID:Integer, Instructor_Name:String, Department_Name: String, Salary:Double) Teaches(Instructor_ID:String, Course_ID, Section_ID:String, Semester:String, Year:YEAR) Student(Student_ID:Integer, Student_Name:String, Department_Name:String) Takes(Student_ID, Course_ID, Section_ID:String, Semester:String, Year:YEAR, Grade:Character(2)) Classroom(Classroom_ID:Integer, Building:String, Room_Number:String, Capacity:Integer) Section(Course_ID:String, Section_ID:String, Semester:String, Year:YEAR, Classroom_ID:Integer, Time_Slot_ID: String) TimeSlot(Time_Slot_ID:Integer, Day:String, Start_Time:Time, End_Time:Time) 3. Write an expression using relational algebra to list all course id and course title that are offered in Fall or Spring between 9 AM and 11 AM by Biology department.
This is database system concept. 1.Find the ids of instructors who are also students using a set operation. Assume that a person is identified by her or his id. So, if the same id appears in both instructor and student, then that person is both an instructor and a student. Remember: set operation means union, intersect or set difference. 2.Find the ids of instructors who are also students using the set membership operator. 3.Find the ids of instructors who are...
Please clear and direct answer Consider the following SQL query and related relations SELECT P.Name FROM Players P, Games G WHERE P.Id = G.PlayerId AND P.Game = 'Football' AND G.Season ='2019' where: Players (Id, Name, Game) Games (PlayerId, GameCode, Season) Translate the above SQL query to a relational algebra expression. Draw the Query tree for above relational algebra expression in part (a).
1- Consider the following SQL query and related relations SELECT P.Name FROM Players P, Games G WHERE P.Id = G.PlayerId AND P.Game = 'Football' AND G.Season ='2019' where: Players (Id, Name, Game) Games (PlayerId, GameCode, Season) A- Translate the above SQL query to a relational algebra expression. B- Draw the Query tree for above relational algebra expression in part (a). Note: Please no screenshot
What is the normalized form of the following relation? Student Enrollment Student ID Last Name First Name Course 11111 Bond James Algebra, Calculus 22222 Aniston Jennifer English, History 33333 Eistein Albert Chemistry, Biology A. Student Enrollment Student ID Course 11111 Algebra 11111 Calculus 22222 English 22222 History 33333 Chemistry 33333 Biology Student Student ID Last Name First Name 11111 Bond James 22222 Aniston Jennifer 33333 Eistein Albert B. Student Enrollment Student ID Last Name First Name Course 1 Course 2...