Database System Concepts
7th Edition
ISBN: 9781260084504
Author: Abraham Silberschatz, S. Sudarshan, Abraham, Henry Korth, Silberschatz Abraham, Silberschatz Professor
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Expert Solution & Answer
Chapter 3, Problem 33E
Explanation of Solution
Query:
The query for the given scenario:
SELECT C.course_id,C.title FROM course C,section S, time_slot T WHERE C.course_id=S.course_id AND S.time_slot_id= T.time_slot_id AND C.dept_name='Comp. Sci.' AND T...
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Using the university schema, write an SQL query to find section(s) with maximum enrollment. The result columns should appear in the order “courseid, secid, year, semester, num”. (It may be convenient to use the with construct.)
Write a SQL query. List names of all employees who have sold to customer Rachel Patterson (Note: You can only use the information given in the question, i.e. you cannot first look up Rachel Patterson’s Customer ID and use that ID in your query).
Use SQL and TAL Distributors database to complete the following questions:List the customer number and name for all customers located in the city of Grove. Your query should ignore case. For example, a customer with the city Grove should be included as should customers whose city is GROVE, grove, GrOvE, and so on.
Chapter 3 Solutions
Database System Concepts
Ch. 3 - Prob. 1PECh. 3 - Prob. 2PECh. 3 - Prob. 3PECh. 3 -
Suppose that we have a relation marks(ID, score)...Ch. 3 - Suppose that we have a relation marks(ID, score)...Ch. 3 -
The SQL like operator is case sensitive (in most...Ch. 3 - Prob. 7PECh. 3 - Prob. 8PECh. 3 - Prob. 9PECh. 3 - Prob. 10PE
Ch. 3 - Prob. 11ECh. 3 - Prob. 12ECh. 3 - Prob. 13ECh. 3 -
Consider the insurance database of Figure 3.17,...Ch. 3 - Prob. 15ECh. 3 - Prob. 16ECh. 3 - Prob. 17ECh. 3 - Prob. 18ECh. 3 -
List two reasons why null values might be...Ch. 3 - Prob. 20ECh. 3 - Prob. 21ECh. 3 - Prob. 22ECh. 3 - Prob. 23ECh. 3 - Prob. 24ECh. 3 - Prob. 25ECh. 3 - Prob. 26ECh. 3 - Using the university schema, write an SQL query to...Ch. 3 - Prob. 28ECh. 3 - Prob. 29ECh. 3 - Prob. 30ECh. 3 - Prob. 31ECh. 3 - Prob. 32ECh. 3 - Prob. 33ECh. 3 - Prob. 34ECh. 3 - Prob. 35E
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
- Create a procedure in PL/SQL takes Department Id and return record data type has maximum salary, minimum salary, and average salaries of the employees in this department. Call this procedure from PL/SQL block by input the department id from the end user.arrow_forwardWrite SQL codes according to the requirements given. Tables are imaginary, column names can be made up. List the item ID, description, and category for each pair of items that are in the same category. (For example, one such pair would be item FS42 and item PF19, because the category for both items is FSH.) List the invoice number and invoice date for each invoice created for the customer James Gonzalez. Use a subquery to find the sales rep ID, first name, and last name of each sales rep who represents at least one customer with a credit limit of $500. List each sales rep only once in the results.arrow_forwardin pl/sql ,use Cursor to get all the records from table job_history for employee_id 121arrow_forward
- Write the following inserts, deletes, or updates in SQL, using the universityschema. Insert every student whose tot cred attribute is greater than 100 as an instructor in the same department, with a salary of $10,000.arrow_forwardWrite and execute a SQL query to list all patient numbers and encounter ids which do not have any data (missing rows) in VisitSummary table. Order the result by patient number, encounter id. Write and execute a SQL query to list all patients whose information about race or gender has changed during their future visits. A future visit is defined as T1.encounter_id < T2.encounter_id. Your output should have patient number, old and new race values, old and new gender values, and the encounter ids. Write and execute a SQL query to list all the patient data for all encounters. Even if patient data is missing in other tables, you still need to list the patient_nbr and encounter_id in your output. Your output should list all the columns (without repeating them) starting with encounter_id, patient_nbr... and it should be ordered by patient_nbr and then encounter_id. Write and execute a SQL query to list all the patient data for all encounters. If the patient data is missing…arrow_forwardWrite a SQL query, which shows a list of all employees last name, their department names and their department city where that department is located from the employees table. If an employee does not belong to a department, then their department number should show as “N/A” and their department city should show up as “No City info Found”. MAKE SURE you have all the employees displayed including the employees who do not have a department.arrow_forward
- Use %ROWTYPE for your cursor. You will use 3 tables in this activity - departments, locations, and countries. Write a PL/SQL block to read and display the department name, city and country name from departments 10, 30, and 90. Display also the number of records returned by your PL/SQL block.arrow_forwardInclude both SQL commands and SQL results in your answers: KimTay Pet Supplies is running a promotion that is valid for up to 20 days after an order is placed. List the invoice number, customer ID, customer first and last names, and the promotion date for each invoice. The promotion date is 20 days after the invoice was placed. Write PL/SQL (or MySQL) procedures to accomplish the following task: The procedure accepts the ID of a customer stored in the input variable named I_CUST_ID and displays the name (first name concatenated with last name) and credit limit of for this customer.arrow_forwardUsing the university schema, write an SQL query to find the ID and title of each course in Comp. Sci. that has had at least one section with afternoon hours (i.e., ends at or after 12:00). (You should eliminate duplicates if any.)arrow_forward
- Use %ROWTYPE for your cursor and use 3 tables in this activity - EMPLOYEES, JOBS, and DEPARTMENTS Write a PL/SQL block to read and display the last name, job title, and department name from departments 50 and 80 only. Display also the number of records returned by your PL/SQL block.arrow_forwardCreate a function to increment the salary of employees of an organization by 15%, and for employees with department ID 100 give another 10% hike on the updated salary. Also, write the query to update the salary of all records of the salary column in the employee table using the created function. In PL/SQLarrow_forwardUsing the university schema, write an SQL query to find the names and IDs of those instructors who teach every course taught in his or her department (i.e., every course that appears in the course relation with the instructor’s department name). Order result by name.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- A Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology Ptr
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr