Concept explainers
Consider the following two relations for Millennium College:
STUDENT(StudentID, StudentName,
CampusAddress, GPA)
REGISTRATION (StudentID, CourselD, Grade)
Following is a typical query against these relations:
SELECT Student_T.StudentID, StudentName,
CourselD, Grade
FROM Student_T, Registration_T
WHERE Student_T.StudentID =
Registration_T.StudentID
AND GPA >3.0
ORDER BY StudentName;
- On what attributes should indexes be defined to speed up this query? Give the reasons for each attribute selected.
- Write SQL commands to create indexes for each attribute you identified in part a.
Learn your wayIncludes step-by-step video
Chapter 5 Solutions
Modern Database Management (12th Edition)
Additional Engineering Textbook Solutions
Database Concepts (7th Edition)
Starting Out with C++: Early Objects (9th Edition)
Starting Out with Programming Logic and Design (4th Edition)
Starting Out with Java: From Control Structures through Objects (6th Edition)
Artificial Intelligence: A Modern Approach
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
- Consider the following relational data model. Employee (empid, ename, address, title, headid) Works (Empid,Deptid,joindate) Department (Deptid, dname, block) Payment (title, salary) A) Write relational algebra for Display the employee name and department name of each employee. Display the employee who works as senior lecturer and belongs to BEI or BCT department. Display the employee name with corresponding department head. B) Write sql query for Creating the above relations; including appropriate versions of all primary and foreign key constraints Find the employee name and address whose address name ends with substring ‘pur’. Update the salary of senior lecturer by 25%.(Solve A - 1,2,3 only)arrow_forwardSTUDENT Student# Std-Name Address 1 Smith Jeddah 2 Bob Buraidah 3 Alice Dammam COURSE Student# Course Code Course-Name 1 IT241 Operating System 2 IT210 Computer Network 2 IT445 Decision Support System Write a query using the Right Outer Join to retrieve the record from the two relations. Also, construct the table displaying the output of your query. Consider the following enterprise scenario and answer the following questions. ABC is a wholesale company that sells electrical equipment and provides a website from which customers can inquiry about products and identify what they want to buy. When costumers order electrical equipment, they place their order on the ABC website. ABC does not own or hold any equipment as inventory. Rather, the ABC orders the equipment from the appropriate supplier and ranges for the equipment to be shipped directly from the supplier to the customers. The…arrow_forwardIn SQL, foreign key constraints can reference only the primary key attributes ofthe referenced relation or other attributes declared to be a superkey using theunique constraint. As a result, total participation constraints on a many-to-manyrelationship set (or on the “one” side of a one-to-many relationship set) cannotbe enforced on the relations created from the relationship set, using primarykey, foreign key, and not null constraints on the relations. Explain how to enforce total participation constraints using complexcheck constraints or assertions (see Section 4.4.8). (Unfortunately, thesefeatures are not supported on any widely used database currently.)arrow_forward
- The table STUDENT has the attributes STUDENT_ID, NAME, SCHOOL_ID, and ADDR. The table SCHOOL has the attributes SCHOOL_ID, NAME, and STATE_CODE. Assume that there is a 1:N relation between SCHOOL and STUDENT. Which of the following creates a table that shows the STUDENT attributes and the corresponding SCHOOL attributes? a. SELECT * SCHOOL_ID FROM STUDENT JOIN SCHOOL b. SELECT * SCHOOL_ID FROM STUDENT JOIN SCHOOL USING(SCHOOL_ID) c. SELECT * SCHOOL_ID FROM STUDENT NATURAL JOIN SCHOOL d. SELECT * SCHOOL_ID FROM STUDENT, SCHOOL WHERE SCHOOL_ID = SCHOOL_IDarrow_forwardIn SQL, foreign key constraints can reference only the primary key attributes ofthe referenced relation or other attributes declared to be a superkey using theunique constraint. As a result, total participation constraints on a many-to-manyrelationship set (or on the “one” side of a one-to-many relationship set) cannotbe enforced on the relations created from the relationship set, using primarykey, foreign key, and not null constraints on the relations. Explain whyarrow_forwardproduce a list of relations indicating the primary key, columns and foreign keys. Consider the following attributes for tables in a relational model designed to keep track of information for a moving company that moves residential customers, usually from one home or apartment to another:customerID, customerName, customerCurrentAddress, customerCurrentPhone, customerNewAddress, customerNewPhone, pickupLocation, dropOffLocation, dateOfMove, startingTime, estimatedWeight, estimatedCost, truck#Assigned, driverName, driverLicNo, actualCost, amountOfDamages, truckCapacity, costOfTolls, tax, finalAmount, invoiceNumber, amountPaid, datePaid, checkNumber, amountDueAssume:- Although in most cases the pickupLocation is the customer’s old address and the dropOffLocation is the new address, there are exceptions, such as when furniture is moved to or from storage.-An estimate is provided before the move using a pre-printed invoice containing a unique invoice number. The actual cost is recorded on…arrow_forward
- Consider the following SQL query on the university schema: select avg(salary)-(sum(salary) / count(*)) from instructorWe might expect that the result of this query is zero since the average of a set of numbers is defined to be the sum of the numbers divided by the number of numbers. Indeed this is true for the example instructor relation in Figure 2.1. However, there are other possible instances of that relation for which the result would not be zero. Give one such instance, and explain why the result would not be zero.arrow_forwardThe table STUDENT has the attributes STUDENT_ID, NAME, S_ID, and ADDR. The table SCHOOL has the attributes SCHOOL_ID, NAME, and STATE_CODE. Assume that there is a 1:N relation between SCHOOL and STUDENT where the common attributes are S_ID, and SCHOOL_ID. Which of the following creates a table that shows the STUDENT attributes and the corresponding SCHOOL attributes? a. SELECT * FROM STUDENT JOIN SCHOOL USING(SCHOOL_ID) b. SELECT * FROM STUDENT JOIN SCHOOL USING(S_ID) c. SELECT * FROM STUDENT NATURAL JOIN SCHOOL ON S_ID AND SCHOOL.SCHOOL_ID d. SELECT * FROM STUDENT JOIN SCHOOL ON STUDENT.S_ID = SCHOOL.SCHOOL_IDarrow_forwardStudent 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).arrow_forward
- DATABASE SYSTEMS 11.Which of the following query finds the names of the employees who have taught at least one course? a)SELECT DISTINCT e.ename FROM employee e, course c WHERE e.eid = c.cid; b)SELECT e.ename FROM employee, course WHERE e.eid = c.cid; c)None of these d)SELECT e.ename FROM employee e, course c WHERE e.eid = c.cid; 12.If A-> B, C,D,E and D -> E are functional dependencies of the relation R(A,B,C,D,E) Then identify the best normal form of the given relation R. a)2NF b)BCNF c)3NF d)1NF 13.The attributes of relationship completes in employee completes course should be a)empid, cno, cname, grade b)empid, cno, grade c)empid, ename, dept, phone no d)cno, cname, grade 14.What is the meaning of LIKE 'a%a%' a)Feature ends with two a's b)Feature begins with two a's c)Feature has two a's in it, at any position d)Feature begins with a and has at least one a's in it at any position 15.If in JOIN operation, conditions of JOIN operation are not satisfied then results of…arrow_forwardTransform the given ER model into a set of 3NF relations. Use the format shown below for relations. FACULTY (FacID, LastName, FirstName, Rank, DeptID) FK DeptID à DEPT DEPT (DeptID, DeptName, DeptPhone) You must underline all components of each primary key. Denote each foreign key directly beneath the relation that contains the foreign key, as shown above. Do not use the graphical notation from the textbook. The notation shown here is the notation you will be required to use on exams. Be sure that all relations are in 3NF. ******HOW DO WE DRAW THE MULTI VALUED ATTRIBUTEarrow_forwardTransform the given ER model into a set of 3NF relations. Use the format shown below for relations. FACULTY (FacID, LastName, FirstName, Rank, DeptID) FK DeptID à DEPT DEPT (DeptID, DeptName, DeptPhone) You must underline all components of each primary key. Denote each foreign key directly beneath the relation that contains the foreign key, as shown above. Do not use the graphical notation from the textbook. The notation shown here is the notation you will be required to use on exams. Be sure that all relations are in 3NF.arrow_forward
- 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