Consider the following instance of relation Sells(book_title, library, price): Sells book_title library price The grand design Noura 20,000 Brief history of time Noura 15,000 The grand design Malik's 18,000 Brief history of time Malik's 16,000 Quantum çomputers Malik's 25,000 Brief history of time Al Dirasat 21,000 What this query is trying to find? Select book_title from sells s1 where EXISTS (select * from sells where book_title = s1.book_title and library != s1.library) Select one: O a. Books sold by exactly one library O b. Books sold by more than one library O c. Books sold by one library or more. O d. Books not sold by any library
Q: Consider the given relational schema: Suppliers(sid:integer, sname:string, city:string,…
A: To Do: To choose the correct option.
Q: Consider the following two relations for Millennium College:STUDENT(StudentiD…
A: A)StudentID in STUDENT_TBecause it is a primary key and the index would enforce uniqueness of the…
Q: Consider the following relation: Customer (CID, name, email, address) Now write Mysql query to…
A: CREATE TRIGGER trg_EMAIL ON EMAIL_CHANGE AFTER INSERT, UPDATE AS IF ( UPDATE (cid, oldemail,…
Q: Consider the follow relations’ schemas to answer the following question: Student (sid, name,…
A: Convert SQL to relational algebra expression
Q: Consider the relations Courses1.Courses Enrollment and Students. Location b) Courses1-Courses2 (1)…
A: As per the answering guidelines solving the first 3 sub question completely. 1) Here selection…
Q: Given the relation schema R(A, B, C) and S(C, D, E), please match each of the following relational…
A: ANSWER:
Q: Consider the following instance of relation Sells(book_title, library, price): book_title The grand…
A: Answer: Books sold by more than one library
Q: Consider the following scenario: you have a relation that contains x, y coordinates, and the names…
A: Introduction: Consider the names of the restaurants and the x and y coordinates associated with the…
Q: Consider the bank database of Figure 15.14, where the primary keys are underlined, and the following…
A: Explanation: The below expression performs the theta join on the smallest amount of data…
Q: ver All the questions: Consider the below Student table and write the appropriate relational algebra…
A: Here we need to use selection operator to select only those tuple whose city is not equal to muscat.…
Q: Consider the following SQL query on the university schema: select avg(salary)-(sum(salary)…
A: For numeric values it will always be zero. But when there is a null value the answer will be…
Q: Consider the following SQL query ‐ select U.userID, U.Name, UE.gradYear from Users U, UserEducation…
A: Relational Algebra Expression: RELATIONAL ALGEBRA is a procedural query language that is commonly…
Q: Q1. Create these two relations, then insert the tuples. (Instructor relation: ID is PK, dept_name is…
A: Answer
Q: Consider the relations r(A, B, D), and s(B, D, F), in which A, B, D and F are their attributes. The…
A: Here in the query, I have taken the 'some' part as s.B, But you can modify it according to your…
Q: The following functional dependencies describe a relation that is in 2NF. Customer_ID, Store_ID ->…
A: Definition of 2NF is => There should not be any partial dependency. Partial Dependency means Part…
Q: TUDENT Student# Std-Name Address 1 Smith Jeddah 2 Bob Buraidah 3 Alice Dammam…
A: The code has given
Q: The following question is based upon the Patient-Treatment relation which records the details of…
A: the Patient-Treatment relation which records the details of transactions occurring in a medical…
Q: Consider the following Relation instance of Students: ID firstNamelastName GPA Address 123 Albertson…
A: Given: What will be the result of given SQL query? SELECT ID,firstName FROM Students WHERE…
Q: QUESTION 5 Consider the following tables: BOOKS (BookNo, Title, Author, ISBN, Stock, Price, Tax)…
A: It is defined as a collection of information that is organized so that it can be easily accessed,…
Q: How did you normalize the following relation? When the PK is (Room#, Reservation#). Name Phone email…
A: Normalization is the most common way of rearranging information in a data set with the goal that it…
Q: Consider two relations Reserves and Sailors and statistical data are as follows: Reserves: Each…
A: According to the information given:- We have to describe the mentioned two relations Reserves and…
Q: Consider the following schema: Suppliers (sid, sname, city) Parts (pid, pname, color) Catalog…
A: Here there are multiple questions so i have answered 1st 3 questions below.
Q: Consider the following schema: Suppliers (sid, sname, city) Parts (pid, pname, color) Catalog (sid,…
A: Suppliers (sid, sname, city) Parts (pid, pname, color) Catalog (sid, pid, price)
Q: Given the relation schema R(A, B, C) and S(C, D, E), please match each of the following relational…
A: 1-G 1. R U S === G. (From the given quetion) SELECT * FROM R UNION SELECT * FROM S;
Q: Consider the relations: • PROJECT(proj#, proj_name) EMPLOYEE(emp#, emp_name) ASSIGNED(proj#, emp#)…
A: The SELECT statement is used to select data from a database. In order to show employee name and…
Q: Consider the following instance of relation Sells(book_title, library, price): Sells book_title…
A: Answer:- iii. b) SELECT distinct library from sells WHERE library not in (select library from sells…
Q: Suppose a single relation (table) is used to record the information about students’ enrollment in…
A: Actually, given question regarding normalization.
Q: 1.Write a SELECT query to find all the data of students with name Anum.
A: Select * from Student where Name="Anum"
Q: Consider the following schema: Suppliers (sid, sname, city) Parts (pid, pname, color) Catalog (sid,…
A: Answer :
Q: Given the following relation vendor order (vendor no, order no, vendor name, qty supplied ,…
A: Composite Key: A composite primary key is the where more than one column in a table is used to…
Q: 1st Normal Form (1NF) Consider the Students table, with the primary key underlined, and the…
A: First Normal Form (1NF): => If a table includes a composite or multi-valued attribute, it…
Q: voice No Client-No Client Name ProductNo 1244 Product Name Poduct vice Screen Case 1234 4321 R4 000…
A: Normalization is a technique to remove anomalies and undesirable characteristics. In normalization,…
Q: The following question is based upon the Patient-Treatment relation which records the details of…
A: I) Data repetition or copy information: As we notice the table cautiously, we notice that the table…
Q: Student ID Student_name Cource_ID Cource_name Grade 22 Noor НTML B+ C++ А- JAVA C++ 25 Ali A JAVA…
A: Provided the solution for all the above given questions with detailed step by step explanation as…
Q: Consider the following instance of relation Sells(book_title, library, price): Sells book_title…
A: Answer: Books sold by more than one library
Q: Given the relation schema R(A, B, C) and S(C, D, E). please match each of the following relational…
A: ANSWER: 1 -> G 2 -> H 3 -> A 4 -> B 5 -> not applicable any option. But the only…
Q: Consider the two relations with their schemas as listed below: Employee(name, suriR birtbRats…
A: The FOREIGN KEY CONSTRAINT IN SQL is used to ensure the referential integrity of the data in one…
Q: The following question is based upon the Patient-Treatment relation which records the details of…
A: Step 1:- Note:- I am giving the solution to the 1 question only. The given question contains the…
Q: Consider the following SQL query on the university schema:select avg(salary) - (sum(salary) /…
A: The AVG function calculates the AVG of the data by ignoring the null values in it. So, the possible…
Q: Consider the following relations about NBA: P LAY ER(pid, pname, nation). Each tuple describes a…
A: 1 Select t.tname,r.year from TEAM t join REGISTER r on t.tid = r.tid join PLAYER on p.pid= r.pid…
Q: Consider the following table schemas (primary keys are underlined): Company (cID, name, location)…
A: Solution: Given Schema, Company (cID, name, location) Flight (cID, fnumber, departure,…
Q: 4. Find the sids of suppliers who supply every part. please only answer point number 4
A: Suppliers (sid, sname, city) Parts (pid, pname, color) Catalog (sid, pid, price)
Q: Consider the following relation which has been designed to store data about medical doctors,…
A: Assumptions The patient is given an appointment with doctor The patient always visits same clinic.…
Q: S, (3) C in U is a foreign key to T, (4) these relations do not contain size (i.e., the number of…
A: Here below, I am unable to use the join symbol used in the question. Hope you are able to…
Q: Reserves: 5:2/05/2 Each tuple is 40 bytes long, 100 tuples per page, 1000 pages. Let's say there are…
A: Select s.name FROM Sailors S ,Reserves R, Boats B WHERE S.sid=R.sid And R.bid And B.color='RED'
Q: The following question is based upon the Patient-Treatment relation which records the details of…
A: Answer : In the above tabular representation of the data there are several problems…
Q: Consider the following relation. Instructor (ID , name, dept – name, salary) Department (dept – name…
A: 1) SELECT name FROM Instructor WHERE salary= MAX(salary) GROUP BY dept-name; 2) SELECT dept-name…
Q: Let T(a,b,c) be a relation in which attribute a is not NULL. Consider the SQL query: SELECT * FROM T…
A: We are given a relational query and we are going to find its equivalent sql query. Note: Not In…
Q: 1.Write a SELECT query to find all the data of students with name Anum. 2. Find rollno of students…
A: FOR GIVEN RELATION - Student(Name, rollno, cgpa, adress, phone) Suppose a table structure like…
Q: ) Write a prolog query to indicate whether two persons are in-relation or not. Two persons are in…
A: Here we write prolog code to get the answer: ==============================
Step by step
Solved in 2 steps
- ) Consider the relations r(A, B, D), and s(B, D, F), in which A, B, D and F are their attributes. Thefollowing SQL query based on these two relations has a nested subquery. Provide an equivalent SQL querywhich does not have any nested subquery.select A, Bfrom rwhere r.B < some (select Bfrom swhere s.D= r.D)Consider the following relations for a university: Student (sid: integer, sname: string(100 chars), GPA: real, dateOfBirth: date, Did: integer, FirstYear: integer)Department (did: integer, dname: string(30 chars), capacity: integer)Course (cid: integer, cname: string(50 chars), credit: integer)Enroll (studentID: integer, courseID: integer, departmentID: integer, enrollmentDate: date, finalGrade: real) studentID, courseID, and departmentID in Enroll are foreign keys referencing the primary keys of the student, course, and department relations, respectively. Did in Student is a foreign key referencing the primary key of the department relation. 1) For each student with GPA between 2.5 (included) and 3.5 (included), display the student’s name, GPA,and his/her department ID. Sort the results by the students’ IDs in descending order. 2) For each student who joined the Computer Science department between 2018 (included) and 2020(included), display the…EmployeeID is the primary key for the relation below. Which column violates a rule (characteristic) of a relation? Employee Relation EmployeeID Department PhoneNum PhoneNum 300 Finance 321-299-1234 407-999-2300 200 Sales 407-222-9090 321-365-0912 400 Sales 407-807-1124 407-453-2294 100 HR 321-934-2034 Group of answer choices The column named PhoneNum because you can’t have two columns with the same name. All the columns are valid. The EmployeeID column because the ID numbers are not in order. The Department column.
- Student ID | Student_name | Cource ID | Cource name | Grade 2 Noor 1 HIML B+ 7 C++ A 3 JAVA B 25 Al 2 C+ A 3 JAVA B 27 Sara 1 HIML A 3 JAVA A 28 Abmed 2 C++ B+ 1. What update anomalies may occur in the selation? 2. In which normal form (NF) the above relation? Provide an explanation to support your answer. 3. Decompose the relation so that the resut relations are in the third normal form (3NF).Given the following relation that stores details about students' activities: StudentID StudentName Activity ActivityFee AmountPaid 100 Jones Golf 65.00 65.00 100 Jones Skiing 200.00 0.00 200 Davis Skiing 200.00 0.00 200 Davis Swimming 50.00 50.00 300 Garrett Skiing 200.00 100.00 300 Garrett Swimming 50.00 50.00 400 Jones Golf 65.00 65.00 400 Jones Swimming 50.00 50.00Table_1 below has a primary key of column1. Which column(s) from this relation could be a foreign key in another, related relation? Check all that qualify. Generic Relation column1 column2 column3 column4 100 19.99 cde A 200 23.78 klj D 300 77.43 qnw B Group of answer choices column2 any of the columns in the table could be a foreign key column4 column3 column1
- Question 2: Consider the following relations: Student(snum: integer, sname: string, major: string, level: string, age: integer) Class(name: string, meets at: string, room: string, fid: integer) Enrolled(snum: integer, cname: string) Faculty(fid: integer, fname: string, deptid: integer) Write the following queries in SQL. No duplicates should be printed in any of the answers. Find the names of all Juniors (level = JR) who are enrolled in a class taught by Teach. Find the age of the oldest student who is either a History major or enrolled in a course taught by I. Teach. Find the names of all classes that either meet in room R128 or have five or more students enrolled. Find the names of all students who are enrolled in two classes that meet at the same time. Find the names of faculty members who teach in every room in which some class is taught.Question 2: Consider the following relations: Student(snum: integer, sname: string, major: string, level: string, age: integer) Class(name: string, meets at: string, room: string, fid: integer) Enrolled(snum: integer, cname: string) Faculty(fid: integer, fname: string, deptid: integer) Write the following queries in SQL. No duplicates should be printed in any of the answers. Find the names of all Juniors (level = JR) who are enrolled in a class taught by Teach. Find the age of the oldest student who is either a History major or enrolled in a course taught by I. Teach. Find the names of all classes that either meet in room R128 or have five or more students enrolled. Find the names of all students who are enrolled in two classes that meet at the same time. Find the names of faculty members who teach in every room in which some class is taught. I need last 2 subparts answerSuppose you have a relation containing the x, y coordinates and names ofrestaurants. Suppose also that the only queries that will be asked are of the following form: The query specifies a point and asks if there is a restaurant exactly at that point. Which type of index would be preferable, R-tree or B-tree? Why?
- Consider the following SQL query that seeks to find a list of titles of all coursestaught in Spring 2017 along with the name of the instructor.select name, titlefrom instructor natural join teaches natural join section natural join coursewhere semester = 'Spring' and year = 2017What is wrong with this query?SQL allows a foreign-key dependency to refer to the same relation, as in thefollowing example:create table manager(employee ID char(20),manager ID char(20),primary key employee ID,foreign key (manager ID) references manager(employee ID)on delete cascade )Here, employee_ID is a key to the table manager, meaning that each employeehas at most one manager. The foreign-key clause requires that every manageralso be an employee. Explain exactly what happens when a tuple in the relationmanager is deleted.You are given this table: Registration SID CourseID SemID Instructor Grade 282712 ENGL210 201701 H. Zacny B+ 362112 CS101 201701 K. Ross C 652123 CS403 201701 K. Ross A 362112 CS403 201701 K. Smith C+ 282712 BIO101 201601 I. Olsen C What will the result of the following query be? select sid, count(*)from registrationgroup by sid Select one: a. The entire table sorted by sid b. No results due to an error c. 282712 2362112 2652123 1 d. 282712 1362112 1652123 1