Assignment 2 Chapter 3
rtf
keyboard_arrow_up
School
CUNY Kingsborough Community College *
*We aren’t endorsed by this school
Course
100,007
Subject
Information Systems
Date
Dec 6, 2023
Type
rtf
Pages
8
Uploaded by NoNam4
Vasyl Yakovishak
Review Questions
1. How do you create a table using SOL?
Answer: CREATE TABLE
2. How do you delete a table using SOL?
Answer: DROP TABLE
3. What are the common data types used to define columns using SOL?
Answer: INT, DATE, VARCHAR, CHAR, DECIMAL, SMALLINT
4. Identify the best data type to use to store the following data in Oracle, in SOL Server, and in Access:
Answer:
A) DATE
B) INT C)VARCHAR
D)DECIMAL
5) Identify the following column names as valid or invalid in Oracle: Answer:
A) VALID
B) VALID
C)INVALID
D)INVALID
6. What is a null value? How do you use SOL to identify columns that cannot accept null values?
Answer:
NULL value means that there is no data or missing data, to make columns that can’t accept null values you can add NOT NULL in end.
7. Which SOL command do you use to add a row to a table?
Answer:
To add row in table you can use *INSERT TABLE NAME*
8. Which SOL command do you use to view the data in a table? Answer:
To view data in table have to use SELECT command to select specific table to view, "SELECT * FROM TABLE NAME"
9. Which SOL command do you use to change the value in a column in a table?
Answer:
To make changes or update value in colum in table, you can use UPDATE command
10. Which SOL command do you use to delete rows from a table?
Answer:
To delete rows from table, you can use DELECTE command
11. How do you display the columns in a table and their characteristics in Oracle?
Answer:
To display the columns in a table and their characteristics in Oracle, you can use DESCRIBE
12. Explain the difference between the CHAR data type and the VARCHAR data type. Use the Internet to find examples of when to use VARCHAR and when to use CHAR. Be sure to cite the URL(s) that provided the examples as references at the end of your document.
Answer:
CHAR is for sorting such as city, states, country, tags, etc.
VARCHAR is for sorting data that have random length such as name, address.
13. Use the Internet to research BOOLEAN data types. What is a BOOLEAN data type and what is it called
in Oracle, SOL Server, and Access? Be sure to cite the URL(s) that provided the information at the end of your document. Answer:
Boolean data is that store only true or false, otherwise 1 or 0. Boolean data in Oracle call BIT, in MS SQL it calls BOOLEAN, and in Access Database is YES/ON
TAL Distributors
1. Create a table named SALES REP. The table has the same structure as the REP table shown in Figure 3-11 except the LAST_NAME column should use the VARCHAR data type and the COMMISSION and RATE columns should use the NUMBER data type. Execute the command to describe the layout and characteristics of the SALES_REP table
CREATE TABLE REP
(Rep_Num Char(2) PRIMARY KEY,
LAST_NAME CHAR(15) NOT NULL,
FIRST_NAME VARCHAR(15) NOT NULL,
STREET CHAR(15),
CITY CHAR(15),
STATE CHAR(2),
POSTAL_CODE CHAR(5),
COMMISSION NUMBER (7,2),
RATE NUMBER (3,2) );
DESCRIBE SALES_REP; WAS NOT WORKING FOR ME
2. Add the following row to the SALES_REP table: rep number: 35, last name: Lim; first name: Louise; street: 535 Vincent Dr.; city: Grove; state: CA; postal code: 90092; commission: 0.00; and rate: 0.05. Display the contents of the SALES_REP table.
3. Delete the SALES REP table.
4. Run the script file for the TAL Distributors database to create the five tables and add records to the tables. Be sure to select the script file for the particular DBMS that you are using (Oracle, SOL Server, or Access). (Note: If you do not have the script files for this text, ask your instructor for assistance.)
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
5. Confirm that you have created the tables correctly by describing each table and comparing the results to Figures 3-11 , 3-30, 3-32, 3-34, and 3-36.
DESCRIBE COMMAND WAS NOT WORKING FOR ME BUT THAT HOW I WILL DO IT
DESCRIBE ORDERS
DESCRIBE CUSTOMER;
DESCRIBE REP;
DESCRIBE ORDER_LINE;
DESCRIBE ITEM;
6. Confirm that you have added all data correctly by viewing the data in each table and comparing the results to Figure 2-1 in Chapter 2.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
7. Review the data for the ITEM table in Figure 2-1 in Chapter 2 and then review the data types used to
create the ITEM table in Figure 3-34. Suggest alternate data types for the DESCRIPTION, ON_HAND, and STOREHOUSE fields and explain your recommendations.
Column DESCRIPTION can be changed to VARCHARD because set of character data of indeterminate length.
Column ON_HAND can be changed as SMALLINT because it can store 2 Bytes which goes up to 32,767 value
Column STOREHOUSE can be changed as TINYINT because it can store 1 Bytes which goes up to 255 value