Guide To SQL 9th Edition Pratt Solutions Manual 1
Guide To SQL 9th Edition Pratt Solutions Manual 1
Guide To SQL 9th Edition Pratt Solutions Manual 1
9th-edition-pratt-111152727x-9781111527273/
guide-to-sql-9th-edition-pratt-111152727x-9781111527273/
Solutions
1. Use the CREATE TABLE command to create a table by typing the table name and then listing
within a single set of parentheses the columns in the table.
2. Use the DROP TABLE command.
3. CHAR, VARCHAR, DATE, DECIMAL, INT, SMALLINT.
4. Best Data Type:
Oracle SQL Server Access
a. DATE DATETIME DATE
b. CHAR CHAR SHORT TEXT
c. CHAR CHAR SHORT TEXT
d. DECIMAL DECIMAL CURRENCY
5. Valid or Invalid
A Guide to SQL, Ninth Edition Solutions 3-2
1.
In Oracle, the command is:
CREATE TABLE SALES_REP
(REP_NUM CHAR(2) PRIMARY KEY,
LAST_NAME VARCHAR(15),
FIRST_NAME CHAR(15),
STREET CHAR(15),
CITY CHAR(15),
STATE CHAR(2),
POSTAL_CODE CHAR(5),
COMMISSION NUMBER(7,2),
RATE NUMBER(3,2) );
To describe the layout and characteristics of the SALES_REP table, use the DESCRIBE command in Oracle, the
Documenter in Access, and the stored procedure Exec sp_columns in SQL Server.
2.
INSERT INTO SALES_REP
VALUES
('35','Lim','Louise','535 Vincent Dr.','Grove','CA','90092',0,0.05);
3.
DROP TABLE SALES_REP;
4. You can obtain the scripts for this text via the Web at login.cengage.com.
5. Use the DESCRIBE command or the Documenter (Access) or exec sp_columns (SQL Server) to view the
layout and characteristics of the REP, CUSTOMER, ORDERS, ITEM, and ORDER_LINE tables.
6. Use the SELECT command to view the data in the REP, CUSTOMER, ORDERS, ITEM, and
ORDER_LINE tables.
7. [Critical Thinking] Answers will vary. The DESCRIPTION field could use the VARCHAR data type because the
descriptions vary in length. Only integers are stored in the ON_HAND and STOREHOUSE fields so these fields
could use the INT data type.
1.
In Oracle, the command is:
CREATE TABLE ADVENTURE_TRIP
(TRIP_ID DECIMAL(3,0) PRIMARY KEY,
TRIP_NAME VARCHAR(75),
START_LOCATION CHAR(50),
STATE CHAR(2),
DISTANCE NUMBER(4,0),
MAX_GRP_SIZE NUMBER(4,0),
TYPE CHAR(20),
SEASON CHAR(20) );
A Guide to SQL, Ninth Edition Solutions 3-4
To describe the layout and characteristics of the ADVENTURE_TRIP table, use the DESCRIBE command in
Oracle, the Documenter in Access, and the stored procedure Exec sp_columns in SQL Server.
2.
INSERT INTO ADVENTURE_TRIP
VALUES
(45,'Jay Peak','Jay','VT',8,8,'Hiking','Summer');
3.
DROP TABLE ADVENTURE_TRIP;
4. You can obtain the scripts for this text via the Web at login.cengage.com.
5. Use the DESCRIBE command or the Documenter (Access) or exec sp_columns (SQL Server) to view the
layout and characteristics of the GUIDE, TRIP, RESERVATION, CUSTOMER, and TRIP_GUIDES tables.
6. Use the SELECT command to view the data in the GUIDE, TRIP, RESERVATION, CUSTOMER, and
TRIP_GUIDES tables.
7. [Critical Thinking] Answers will vary. Both the TRIP_NAME and the START_LOCATION
fields could use the VARCHAR data types. The TRIP_ID and MAX_GRP_SIZE fields could
use the INT data type.
CREATE TABLE TRIP
(TRIP_ID INT PRIMARY KEY,
A Guide to SQL, Ninth Edition Solutions 3-5
TRIP_NAME VARCHAR(75),
START_LOCATION VARCHAR(50),
STATE CHAR(2),
DISTANCE DECIMAL(4,0),
MAX_GRP_SIZE INT
TYPE CHAR(20),
SEASON CHAR(20) );
7. [Critical Thinking]
CREATE TABLE TRIP
(TRIP_ID DECIMAL(3,0) PRIMARY KEY,
TRIP_NAME CHAR(75),
START_LOCATION CHAR(75),
STATE CHAR(2),
DISTANCE DECIMAL(4,0),
MAX_GRP_SIZE DECIMAL(4,0),
TYPE CHAR(20),
SEASON CHAR(20) );
Another document from Scribd.com that is
random and unrelated content:
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back
back