Concept explainers
Use the following tables for your answers to questions 3.7 through 3.51 :
PET_OWNER (OwnerID, OwnerLasst Name, OwnerFirstName,
OwnerPhone, OwnerEmail)
PET (PetID, PeeetName, PetType, PetBreed, PetDOB, OwnerID)
Sample data for these tables are shown in Figures 3-27 and 3-28, For each SQL statement you write, show the results based on these data. If possible, run the statements you write for the questions that follow in an actual DBMS, as appropriate, to obtain results. Use data types that are consistent with the DBMS you are using. If you are not using an actual DBMS, consistently represent data types by using either the SQL Server, Oracle
3.7 Write an SQL CREATE TABLE statement to create the PET_OWNER table, with OwnerID as a surrogate key. Justify your choices of column properties.
Figure 3-27 PET_OWNER Data
Figure 3-28 PET Data
Want to see the full answer?
Check out a sample textbook solutionChapter 3 Solutions
Database Concepts (7th Edition)
Additional Engineering Textbook Solutions
Modern Database Management (12th Edition)
Starting Out With Visual Basic (7th Edition)
Artificial Intelligence: A Modern Approach
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Problem Solving with C++ (9th Edition)
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
- Write the SQL code to calculate the ASSIGN_CHARGE values in the ASSIGNMENT table in the Ch07_ConstructCo database. (See Figure P7.1.) Note that ASSIGN_CHARGE is a derived attribute that is calculated by multiplying ASSIGN_CHG_HR by ASSIGN_HOURS.arrow_forwardWrite the SQL code that will change the PROJ_NUM to 14 for employees who were hired before January 1, 1994, and whose job code is at least 501. (You may assume that the table will be restored to its condition preceding this question.)arrow_forward
- A Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology PtrDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781305627482Author:Carlos Coronel, Steven MorrisPublisher:Cengage Learning
- Database 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 Learning