Consider the following relation schemas: Emp (eid: integer, ename: string, age: integer, salary: real) Works (eid: integer, did: integer, pct_time: integer) Dept (did: integer, dname: string, budget: real, managerid: integer) (a) Write the SQL statements required to create the preceding relations, including appropriate versions of all primary and foreign key integrity constraints. (b) Define the Dept relation in SQL so that every department is guaranteed to have a manager.

Database Systems: Design, Implementation, & Management
12th Edition
ISBN:9781305627482
Author:Carlos Coronel, Steven Morris
Publisher:Carlos Coronel, Steven Morris
Chapter2: Data Models
Section: Chapter Questions
Problem 11P
icon
Related questions
Question

Show all the work

Consider the following relation schemas:
Emp (eid: integer, ename: string, age: integer, salary: real)
Works (eid: integer, did: integer, pct_time: integer)
Dept (did: integer, dname: string, budget: real, managerid: integer)
(a) Write the SQL statements required to create the preceding relations, including appropriate
versions of all primary and foreign key integrity constraints.
(b) Define the Dept relation in SQL so that every department is guaranteed to have a manager.
Transcribed Image Text:Consider the following relation schemas: Emp (eid: integer, ename: string, age: integer, salary: real) Works (eid: integer, did: integer, pct_time: integer) Dept (did: integer, dname: string, budget: real, managerid: integer) (a) Write the SQL statements required to create the preceding relations, including appropriate versions of all primary and foreign key integrity constraints. (b) Define the Dept relation in SQL so that every department is guaranteed to have a manager.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
CMPTR
CMPTR
Computer Science
ISBN:
9781337681872
Author:
PINARD
Publisher:
Cengage
Database Systems: Design, Implementation, & Manag…
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
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781285867168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning