Using the relational schema for the College Applications
database, write relational algebra expressions
that perform the following problems. Complete 5 out of 6 for full
credit.
Apply(sID, cName, major, decision)
Student(sID, sName, GPA, sizeHS)
College(cName, state, enrollment)
1. List the ids and names of the students that applied to the CS Dept at MIT.
2. For students that have applied to a college, list the
student’s id, name and number of different
colleges the students has applied to.
3. List the ids of all students who were accepted to a CS major
at a college with an enrollment over
25,000.
4. List the names and ids of the students that applied to both OSU
and U of O.
5. List the names and ids of the students that applied to OSU but did not apply to U of O.
6. List the ids of students who applied to all of the colleges.
Answer is as follows :
As defined we answer the 5 queries :

if there is any query please ask in comments..
Using the relational schema for the College Applications database, write relational algebra expressions that perform the...
Give the following queries in the relational algebra using the following relational schema: Student (sid, name, age, address, email, cgpa) enrolledIn (sid, modulecode, grade) module (modulecode, modulename, credits, lecturername) a) What are the names of students enrolled in module code “cs3020”? b) Give the module code of all the modules that are taught by the teacher named “Altaf”? c) Who teaches the module with code”cs1500”? d) Give the name of all the teachers teaching the student with id”12f6778”.
2. The following figure shows an ER schema for a university database. a) Map this schema into a relational schema b)Show the SQL statements needed to create the relations, using proper constraints. If your translation cannot capture any constraints in the ER diagram, explain why. COffice CName CPhone COLLEGE 0. 1 D Rank Office IName IPhone INSTRUCTOR D EAN (0.NO CStartDate (0.1) <ADMINS . CHIAR (1,1) EMPLOYS (MName FName LName (SName DOB DName Sid IO.NO Name Poate DEPT on H...
5.10 Express each of the following queries in relational algebra and (ii) SQL using the Student Registration System schema of Figure 3.4. a. List all courses that are taught by professors who belong to the EE or MGT departments. Exercises 189 b. List the names of all students who took courses both in spring 1997 and fall 1998 38 CHAPTER 3 The Relational Data Model FIGURE 3.4 Fragment of the Student Registration database schema STUDENT (Id:INTEGER, Name:STRING, Address:STRING, Statu PROFESSOR...
Given the following relational database schema: Student = (SSN, Name, Major) Course = ( CourseNumber , CourseTitle, NumberOfUnits, RoomNumber, DayTime), where DayTime is of the form MW 1:0-2:00. Enrollment = (SSN , CourseNumber, Grade) Express the following queries using SQL statements with minimum number of tables and operations. a. List the SSN and Name of every student who has no grade in at least one course. b. List the name of every student who enrolled in at least two courses....
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...
Given the following relational database schema (primary keys are bold and underlined). Answer questions 2.1 to 2.4 Orders(orderld, customerld, dateOrdered, dateRequired, status) Customer(customerld, customerLastName, customerStreet, customerCity, customerState, customer Lip OrderDetails(orderld.productld, quantity, lineNumber, amount) Products(productld, name, description, quantity, unitPrice) Account(accountNumber, customerld, dateOpened, creditCard, mailingStreet, mailingCity, mailingState, mailingZip) 2.1 (2 Points) List all possible foreign keys. For each foreign key list both the referencing and referenced relations. 2.2 (2 Points) Devise a reasonable database instance by filling the tables with data of...
Relational algebra (RA) For the database schema shown below, write RA query for each of the following. (State any reasonable assumptions only if necessary) employee (person_name, street, city) works(person_name, company_name, salary) company (company_name, city) Questions: Find person names, streets and cities of employees who work for two different companies. For each company, find person name, salary, street and city for the highest paid employee of that company. For each company, find total number of employees and total number of cities...
using the University database we have provided you with the creation script using the relational schema of a University as shown below. You should run this script in MySQL Workbench and use this database to extract the necessary information. The script is based on the following relational schema: Subject (subjectCode, departmentName) TeachingStaff (employeeNumber, firstName, surname, departmentName) Instructs (employeeNumber, subjectCode, studentID, position) Student (studentID, studentSurname, studentInitials, gender) TeachingCredentials (employeeNumber, degreecode, uni, awardYear) Enrolment (studentId, degreeCode, year, uni, timeMode, placeMode, completed) Grades...
Consider the database schema of college database. Students have a major department and take classes where faculty can be met. Student (cwid int, name, text, age int, majorDept text) Department (name text, chair text) Faculty (name text, deptName text) Enrollment (facName text, studID int) Note that the underlined attributes are primary keys. studID, chair, deptName of Faculty, facName and majorDept of Student are foreign keys to cwid, name of Faculty, name of Department, name of Faculty and also name of...