Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Use the given
For these queries you need the student, takes, section, and teaches tables. I gave you all the resources you need.
a.)
SELECT ∗
FROM Student AS S, Takes AS T
WHERE S.ID = T.ID AND T.semester = 'Fall';
b.)
(SELECT S.course id, S.semester, S.year
FROM Section AS S
WHERE S.room number = 101)
INTERSECT
(SELECT T.course id, T.semester, T.year
FROM Teaches AS T
WHERE T.ID = 83821);
c.)
SELECT T.course id
FROM takes AS T
WHERE T.semester IN
(SELECT Z.semester
FROM teaches AS Z
WHERE Z.ID = 10101)
OR
T.semester IN
(SELECT X.semester
FROM section AS X
WHERE X.time slot id ='B');
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 7 steps with 14 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- True or False below: Given two relations named A and B, if we q-JOIN A and B, the maximum number of attributes in the result relation could be (the number of attributes of A) times(*) the number of attributes of B). * in an SQL SELECT statement means “all the tuples”. In relational algebra, Cartesian Product (X) can be implemented using the q-JOIN operator. Cartesian Product ISA q-JOIN where q-condition always evaluates to true. SQL is based on Predicate Calculus. A query in SQL always specifies what should be included in the query result.arrow_forwardExpress the following SQL code in Relational Algebra form.SELECT *FROM COURSEWHERE (COURSE.COLLEGE <> ’Business’OR COURSE.COLLEGE <> ’Engineering’)AND COURSE.CREDIT = ’U’;arrow_forwardNeed help writing SQL statements for these, I'm having trouble with my returns. Explanation would help a lot.arrow_forward
- Based on SQL query knowledgearrow_forwardWorksOn Database: Employee (EmployeeNumber, EmployeeName, BirthDate, Title, Salary, DepartmentNumber) Project (ProjectNumber, ProjectName, Budget, DepartmentNumber) Department (DepartmentNumber, DepartmentName, ManagerNumber) WorksOn (EmployeeNumber, ProjectNumber, Responsibility, Hours) Questions: 1) Write an SQL query that returns the project number and name for projects with a budget no greater than $1,050,000. 2) Write an SQL query that returns all works on records where hours worked is less than 5 and the responsibility is 'Manager'. 3) Write an SQL query that returns the employees (number and name only) who have a title of 'EE' or 'SA' and make more than $50,000. 4) Write an SQL query that returns the employees (name and salary only) in department 'D1' ordered by decreasing salary. 5) Write an SQL query that returns the departments (all fields) ordered by descending department name.arrow_forwardMy SQL WORKBENCH **Please note that you may actually use as many tables as you need. You are not limited to use only twotables.Example:SELECT *FROM DEPARTMENTS;SELECT *FROM EMPLOYEES;Now join departments and employees tables.SELECT FIRST_NAME, DEPARTMENT_NAMEFROM EMPLOYEES, DEPARTMENTSWHERE EMPLOYEES.DEPARTMENT_ID = DEPARTMENTS.DEPARTMENT_ID;NOTE: If you omit the join condition, the result will be the Cartesian Product of the two tables. A CartesianProduct joins all rows of the first table with all rows of the second table.That is if the first table has n rows and the second table has m rows, the output will have n*m rows.The following query will produce a Cartesian Product:SELECT FIRST_NAME, DEPARTMENT_NAMEFROM EMPLOYEES, DEPARTMENTS;**When table names are long, qualifying column names might be very time consuming. Usually peopleprefer to use table aliases for this purpose.Example: List the name of all employees who work for 'Purchasing' departmentSELECT E.FIRST_NAME "EMPLOYEE…arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education