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.
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, I
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...
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...
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...
Database concepts Find the names and ids of the students who have taken at most one course in the Spring 2010 semester. Notice, at most one means one or zero. So, the answer should include students who did not take any course during that semester The data: create table classroom (building varchar(15), room_number varchar(7), capacity numeric(4,0), primary key (building, room_number) ); create table department (dept_name varchar(20), building varchar(15), budget numeric(12,2) check (budget > 0), primary key (dept_name) ); create...
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)))
II. Fill in the blanks: (30 The relational database schema of Course Management System are defined as follows: Department (ID, Name, Head) Teacher (ID, Name, Position, DeptID) Student (ID, Name, Gender, Birthday, DeptID) Course (ID, Name, Room, TeacherID) Enroll (StudentID, CourseID, Grade) Please fill the blanks in the following SQL statements. 1. Create the Enroll table. CREATE TABLE Enroll ( char (8) NOT NULL StudentID [1] char (4) NOT NULL CourseID [2] int Grade CHECK (Grade IS NULL OR (Grade>-0...
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...
Question: Use the technique of normalization to validate the structure of your relational schema. Demonstrate that each of your relations is in third normal form (3NF) by displaying the functional dependencies between attributes in each relation. Note, if any of your relations are not in 3NF, this may indicate that your ER model is structurally incorrect or that you have introduced errors in the process of deriving relations from your model. The Relational Schema is as follows: Department (deptName, phone,...
Consider the below schema of the university database (keys are in bold and underline): Students(stuID: Integer, stuName: String, gender: String, age: Integer, gpa: Float) Departments(deptName: String, numPhDs: Integer) ProfessorWorks(profID: Integer, profName: String, deptName: String) CoursesOffer(cNo: String, cTitle: String, deptName: String) Majors(deptName: String, stuID: Integer, degreeProgram: String; attendYear: String, attendSemester: String) Sections(cNo: String, academicYear: String, semester: String, sectNo: Integer, profID: Integer) Enrolls(stuID: Integer, cNo: String, academicYear: String, semester: String, sectNo: Integer, grade: String) Write the following queries in Relational algebra. Print...