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
Question
For each table, identify the primary key and the foreign key(s). If a table does not have a foreign key, write None.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps
Knowledge Booster
Similar questions
- For this problem create a (temporary) table called instructor_course_nums. Write a procedure that accepts an instructor ID as input. The procedure calculates the total number of course sections taught by that instructor, and adds a tuple to the temporary table consisting of the instructors ID number, name, and total courses taught - call these attributes: ID, name, and tot_courses. If the instructor already has an entry in the table,then the procedure makes sure the total number of courses taught in the temporary table is up-to-date. You must name your procedure: Written in PostgreSQLarrow_forwardWrite queries in SQL to answer each of the following questions: 1. Find all students in Comp. Sci. dept 2. Find all students with total credits > 100 3. Find all students who took course in Spring 2010 (Remove duplicates please) 4. Find all courses taken by the student whose ID is 76543 and also find his name create table student (ID varchar(5), name varchar(20) not null, dept_name varchar(20), tot_cred numeric(3,0), primary key (ID) ); create table takes (ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), grade varchar(2), primary key (ID, course_id, sec_id, semester, year) ); insert into student values ('00128', 'Zhang', 'Comp. Sci.', '102'); insert into student values ('12345', 'Shankar', 'Comp. Sci.', '32'); insert into student values ('19991', 'Brandt', 'History', '80'); insert into student values ('23121', 'Chavez', 'Finance', '110'); insert into student values ('44553', 'Peltier', 'Physics', '56'); insert into student values…arrow_forwardLab #9 – Joining Data From Multiple Tables List the order number and order date for every order that was placed by Mary Nelson and that contains an order line for an iron. Use an INTERSECT operator. Lab #10 – Sub Queries Find the sales rep number, last name, and first name for every sales rep who represents at least one customer with a credit limit of $2000. List the order number and order date for every order that was placed by Mary Nelson and that contains an order line for an iron. Down below are the tables ORDER_LINE ORLN_ORDER_NUMBER ORLN_PART_NUMBER ORLN_NUMBER_ORDERED ORLN_QUOTED_PRICE ORDER_TABLE ORDR_ORDER_NUMBER ORDR_ORDER_DATE ORDR_CUSTOMER_NUMBER CUSTOMER CUST_NUMBER CUST_LAST CUST_FIRST CUST_STREET CUST_CITY CUST_STATE CUST_ZIP_CODE CUST_BALANCE CUST_CREDIT_LIMIT CUST_SALES_REP_NUM PART PART_NUMBER PART_DESCRIPTION UNITS_ON_HAND…arrow_forward
- In an OUTER JOIN query, the outer join operator (+) is placed after which table?arrow_forwardInconsistencies:Although update queries can help, you still need human intervention to remove inconsistent values. T to F?arrow_forwardInstructorld 1 • Courseld CourseCode 9630 MATH109 Course CourseName Linear Algebra Capacity 175 4964 PHILAT Intro to Philosophy 50 4253 MATH19 Number Theory 150 1896 HIST66 American History 25 8048 HIST58 World History 125 2133 Instructor Instructorld InstructorName Rank Department Del Day Associate Professor Math Rob Ruiz Associate Professor Philosophy Aya Diaz Associate Professor History Note: Both tables may not be necessary to complete this level. Select the rows returned by the query below. SELECT CourseName, Capacity, InstructorId FROM Course C WHERE Capacity > (SELECT AVG (Capacity) FROM Course WHERE InstructorId = c.InstructorId); CourseName Linear Algebra Capacity Instructorld 175 1 Intro to Philosophy 50 2 150 Number Theory American History 25 World History 125 2133arrow_forward
- Lab #9 – Joining Data From Multiple Tables List the order number and order date for every order that was placed by Mary Nelson and that contains an order line for an iron. Use an INTERSECT operator. Lab #10 – Sub Queries Find the sales rep number, last name, and first name for every sales rep who represents at least one customer with a credit limit of $2000. List the order number and order date for every order that was placed by Mary Nelson and that contains an order line for an iron. Repeat the exercise from the prior step using the ANY operator in the query instead of the ALL operator.arrow_forwardAdd a foreign key constraint to the movie table: the column prod_id is the foreign key, referencing the column id from the production table (use sql) following is movie and production tablearrow_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