Modern Database Management
13th Edition
ISBN: 9780134773650
Author: Hoffer
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 5, Problem 5.17RQ
What is the difference between COUNT, COUNT DISTINCT, and COUNT(*) in SQL? When will these three commands generate the same and different results?
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Please answer as many questions as you can!
In SQL, how do you get the union of two tables?
In SQL, how do you find the intersection of two tables?
In SQL, how do you compute the difference between two tables?
Are the tables restricted in any way while executing any of these operations?
(a) How do you take union of two tables in SQL?
(b) How do you take the intersection of two tables in SQL?
(c) How do you take the difference of two tables in SQL?
(d) Are there any restrictions on the tables when performing any of these operations?
Chapter 5 Solutions
Modern Database Management
Ch. 5 - Define each of the following terms: data...Ch. 5 - Match the following terms to the appropriate...Ch. 5 - Prob. 5.3RQCh. 5 - Prob. 5.4RQCh. 5 - Prob. 5.5RQCh. 5 - Prob. 5.6RQCh. 5 - List six potential benefits of achieving an SQL...Ch. 5 - Prob. 5.8RQCh. 5 - Distinguish among data definition commands, data...Ch. 5 - Prob. 5.10RQ
Ch. 5 - Prob. 5.11RQCh. 5 - Explain the purpose of indexing in database...Ch. 5 - What are the potential consequence of...Ch. 5 - Prob. 5.14RQCh. 5 - Explain and provide at least one example Of how to...Ch. 5 - Prob. 5.16RQCh. 5 - What is the difference between COUNT, COUNT...Ch. 5 - What is the evaluation order for the Boolean...Ch. 5 - If an SQL statement includes a GROUP BY clause,...Ch. 5 - Prob. 5.20RQCh. 5 - Prob. 5.21RQCh. 5 - Prob. 5.22RQCh. 5 - Explain why SQL is called a set-oriented language.Ch. 5 - When would the use of the LIKE key word with the...Ch. 5 - Prob. 5.25RQCh. 5 - Prob. 5.26RQCh. 5 - In what order are the clauses of an SQL statement...Ch. 5 - Within which clauses of an SQL statement can a...Ch. 5 - Prob. 5.29RQCh. 5 - Prob. 5.30RQCh. 5 - Prob. 5.31RQCh. 5 - Explain the difference between the WHERE and...Ch. 5 - Prob. 5.33RQCh. 5 - Write a database description for each of the...Ch. 5 - Analyze the database to determine whether or not...Ch. 5 - Prob. 5.36PAECh. 5 - To enforce referential integrity, before any row...Ch. 5 - Write SQL data definition commands for each of the...Ch. 5 - Write SQL commands for the following: Create two...Ch. 5 - Write SQL queries to answer the following...Ch. 5 - Write SQL queries to answer the following...Ch. 5 - Write SQL queries to answer the following...Ch. 5 - Write SQL queries to answer the following...Ch. 5 - Prob. 5.44PAECh. 5 - Prob. 5.45PAECh. 5 - Prob. 5.46PAECh. 5 - What is the average Read score for all students?...Ch. 5 - Prob. 5.48PAECh. 5 - What are the TutorIDs for tutors who have not yet...Ch. 5 - Prob. 5.50PAECh. 5 - Prob. 5.51PAECh. 5 - Prob. 5.52PAECh. 5 - Prob. 5.53PAECh. 5 - Prob. 5.54PAECh. 5 - How many tutors have an Active status in the...Ch. 5 - Prob. 5.56PAECh. 5 - Modify the Product_T table by adding an attribute...Ch. 5 - Enter sample data of your own choosing into...Ch. 5 - Add an order to the Order_T table and include a...Ch. 5 - Use the Pine Valley database to answer the...Ch. 5 - Prob. 5.61PAECh. 5 - Prob. 5.62PAECh. 5 - Prob. 5.63PAECh. 5 - Prob. 5.64PAECh. 5 - Prob. 5.65PAECh. 5 - Prob. 5.66PAECh. 5 - Prob. 5.67PAECh. 5 - Modify query in P&E 5-67 by considering only those...Ch. 5 - Prob. 5.69PAECh. 5 - Prob. 5.70PAECh. 5 - Prob. 5.71PAECh. 5 - Prob. 5.72PAECh. 5 - Prob. 5.73PAECh. 5 - Prob. 5.74PAECh. 5 - Prob. 5.75PAECh. 5 - Prob. 5.76PAECh. 5 - Prob. 5.77PAECh. 5 - Assume that for those materials the ID of which...Ch. 5 - Prob. 5.79PAECh. 5 - Prob. 5.80PAECh. 5 - Prob. 5.81PAECh. 5 - Prob. 5.82PAECh. 5 - Prob. 5.83PAECh. 5 - Prob. 5.84PAECh. 5 - Prob. 5.85PAECh. 5 - Prob. 5.86PAECh. 5 - Prob. 5.87PAECh. 5 - Prob. 5.88PAECh. 5 - Prob. 5.89PAECh. 5 - Prob. 5.90PAECh. 5 - Prob. 5.91PAECh. 5 - Prob. 5.92PAECh. 5 - Prob. 5.93PAE
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Suppose your instructor gives three exams during the semester and you want to write a program that calculates y...
Starting out with Visual C# (4th Edition)
Porter’s competitive forces model: The model is used to provide a general view about the firms, the competitors...
Management Information Systems: Managing the Digital Firm (15th Edition)
Would you select a decoder/driver with active-HIGH or active-LOW outputs to drive a common-cathode 7-segment LE...
Digital Fundamentals (11th Edition)
Explain the difference between using a computer program and programming a computer.
Big Java Late Objects
Computers can do many different jobs because they can be_____.
Starting Out with C++: Early Objects (9th Edition)
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
- In PL/SQL, how do you assign variables the same type as a column in the database?arrow_forwardInstructions Write SQL queries to solve the following problems. We will be using the “university” database. All queries should involve only the instructor table. After you are done, save your work as .sql file and turn in the .sql file into Moodle for grading. Write a SQL statement to display all columns using the SQL asterisk (*) wild-card character. Write a SQL statement to display ID and name of the instructors (ID appears first). Write a SQL statement to display department names. Write a SQL statement to display unique department names. (expect 7 rows returned) Write a SQL statement to display all info about instructors having a salary greater than 75000. (expect 6 rows returned) Write a SQL statement to display department name, instructor name, and salary for instructors that have a salary less than 70000. Sort the results in ascending order by department name. (expect 4 rows returned) Write a SQL statement to display name, department name, and salary for instructors that have a…arrow_forwardWhat is the difference between COUNT, COUNT DISTINCT, and COUNT(•) in SQL? When will these threecommands genera te the same and different results?arrow_forward
- Instructor(Instructor_Id, Instructor_Name, specialization, Address,#Department_Id)Department(Department_Id, Department_Name)Course(Course_code, Course_Title,Credit_hours,Contact_hours,#Department_Id)Teaching(#Instructor_Id, #Course_code)a) Express in SQL the following queries:i. Change to 6 the number of contact hours of the course which has thecode “ITDR2104”.ii. Add a new column named instructorLoad of type Number(2) to thetable instructor.iii. List the details of all the courses having a code that starts with“ITDR”. The output should be sorted in descending order by credithours.iv. Find the number of courses taught by the instructor whose name is“Ahmed”.v. List the names of all departments along with the number of coursesoffered by each department.vi. Find the titles of courses, which are taught by the instructor who isnamed “Ahmed”.b) Create a view named instructor_of_DBCourse to contain the details(Instructor_Name, specialization, Address, Department_Id) ofinstructors who teach…arrow_forwardUse FOR loop for your cursor. Write a PL/SQL block to read and display the department name and number of employees per department. Accept input from the user to get the number of employees he wants to see in the output. Display also the number of records returned by your PL/SQL block.arrow_forwardAssume that you have these 5 tables.. Answer this question by using those tables. Please. Create in PL/SQL a stored Procedure called 'CheckavailabilityProc' to call the function 'Checkavailability' and display the appropriate message according to the value returned by the function (If function returns true, the procedure will display 'Salalah Hall is free on date ######' otherwise'Salalah Hall is busy on date ###### '). CREATE TABLE Student (studid Char(9) Primary Key,FirstName Varchar2(50) NOT NULL,LastName Varchar2(50) NOT NULL,Email Varchar2(50) NOT NULL UNIQUE,PhoneNumber Number(8) NOT NULL UNIQUE,GPA Number(1,2) NOT NULL); Insert into Student(studid, FirstName, LastName, Email, PhoneNumber, DateOfBirth, GPA) values (11,'Peter','Campbell','peter.campbell@abc.com',12345678,'12/1/2000',5)Insert into Student(studid, FirstName, LastName, Email, PhoneNumber, DateOfBirth, GPA) values (22,'Alex','Campbell','alex.campbell@abc.com',23456789,'12/2/2001',9)Insert into Student(studid,…arrow_forward
- Use the following relational schema write functions, procedures and triggers in PL/SQL:Student (studid, FirstName, LastName, Email, phoneNumber, DateofBirth, GPA)Club (clubid, ClubName, # studid)MemberOf (#clubid, #studid, joiningDate )Activities (actid, actdt, place, durationNbHour)Organize (#actid , #clubid , fee)1. Write a function called 'Checkavailability' that accepts a date and check whether 'SalalahHall' is busy or not on that date. 2. Write a function called 'CheckStudentClub' that accepts a student id and returns thename of the club in which the student is participating. 3. Write a procedure called ‘MainProc' to call the functions 'Checkavailability' and'CheckStudentClub'. This procedure should display the appropriate messages accordingto the values returned by the each of the called functions (For example: If the firstfunction returns true, the procedure will display 'Salalah Hall is free on date ######'otherwise 'Salalah Hall is busy on date ######')4. Write a Trigger that…arrow_forwardWrite the appropriate SQL query for each of the following questions: Display the list of students who are involved in the IT club Display the details of all the activities that have taken place in 'Salalah Hall'arrow_forwardFill the blanks with the suitable PL/SQL statements that correct each of the errors that appear in the given PL/SQL program. (display as -----------) Fill the blanks with the suitable PL/SQL statements that correct each of the errors that appear in the given PL/SQL program. DECLARE CURSOR cursor1 IS SELECT * FROM Students; line cursor1 %type; --------------- BEGIN OPEN cursor1; LOOP SELECT cursor1 inside line; --------------- DBMS_OUTPUT.PUT_LINE('first name= '|| line.fname || 'last name= '||line.lname); EXIT WHEN Cursor %FOUND; ------------------------ END LOOP; CLOSE cursor1; END;arrow_forward
- 9. Explain the use of ORDER BY clause in SQL.arrow_forwardWrite a stored procedure in MySQL, PL/SQL, or T-SQL that changes the price of an item with a given item ID. How would you use this stored procedure to change the price of item AD72 to $84.99?arrow_forwardUSE this part to write SQL statements Branch(branch_id:integer, branch_name:varchar(50), branch_location:varchar(40), money_on_hand:numeric(15,2) create table Branch (branch_id integer, branch_name varchar(50), branch_location varchar(40), money_on_hand numeric(15,2), primary key (branch_id)); Loan(loan_number:integer, branch_id:integer, amount:numeric(8,2)) foreign key branch_id references Branch(branch_id) create table Loan (loan_number integer, branch_id integer, amount numeric(8,2), primary key (loan_number), foreign key (branch_id) references Branch (branch_id)); Customer(customer_id:integer, customer_last_name:varchar(35),customer_first_name:varchar(25), customer_street:varchar(30), customer_zip:integer) create table…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 PtrDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781285196145Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos CoronelPublisher:Cengage LearningDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781305627482Author:Carlos Coronel, Steven MorrisPublisher:Cengage Learning
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781285196145
Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:Cengage Learning
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781305627482
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
SQL Basics for Beginners | Learn SQL | SQL Tutorial for Beginners | Edureka; Author: edureka;https://www.youtube.com/watch?v=zbMHLJ0dY4w;License: Standard YouTube License, CC-BY