Question

Refer to Critical Thinking Assignment – Option 2 in Module 2. Your tasks begin by generating...

Refer to Critical Thinking Assignment – Option 2 in Module 2. Your tasks begin by generating and executing the SQL statements to create the Sales and Purchased Items tables. Next, you will develop and execute the SQL statements to populate the 2 database tables from the data in their respective tables in the Critical Thinking Assignment. Finally, you will write and execute queries to display all attributes (columns) and tuples (rows) in the 2 database tables.

Important reminder, refer to the instructions from Module 1 for creating database. This step must be completed before you can create and populate tables within the database.

The deliverables for this assignment are:

  1. Screenprint after the database is created.
  2. Screenprint after the 2 database tables are created.
  3. Screenprint of the query results for each table.
  4. A brief description of your key learnings from this assignment.

Homework Answers

Answer #1

1. To create table write following command:

create table sales(

columnname datatype,

-----

);

create table purchased_items(

columnName datatype,

------

);

In place of column name write your variable name and in datatype write the suitable datatype which can be int, varchar, date etc.

2. To populate the table write following command:

insert into tablename value(--------)

The order in which the value will be inserted should be same as that followed while creating the table.

3. To display the table write following command:

select * from sales

select * from purchased_items

* will select all the rows and columns and print the table. If you want any particular column to be printed then write that column name instead of star.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Assignment 2 Instructions You need to access to the database and write SQL queries on the...
Assignment 2 Instructions You need to access to the database and write SQL queries on the following site: https://www.w3schools.com/sql/trysql.asp?filename=trysql_op_in 1. Use INNER JOIN to create a report. In this report, list each customer’s CustomerID, CustomerName, and their each OrderID and each order’s OrderDate, if the customer has ever placed an order. You should use the Customers table and the Orders table in the database to complete this query.   2. Use INNER JOIN to create a report. In this report, list...
ACT506 Module 1 Critical Thinking Assignment Option #1 Peerless Products (parent company) purchased on January 02,...
ACT506 Module 1 Critical Thinking Assignment Option #1 Peerless Products (parent company) purchased on January 02, 20x7, Special Foods (subsidiary) for $300,000. Information for acquisition entry for January 02, 20x7. Peerless Products Fair Value Consideration: $300,000 Special Foods book value of equity: Common stock $100,000 Paid in capital 50,000 Retained earnings 150,000 1). Required entry for investment equity using cash 1/2/20x7 Debit $xxxx Credit $xxxx 2). Information to complete the parent company January to December 20x7 entries Parent Subsidiary   ...
-- Drop the tables if they existDROP TABLE REP CASCADE CONSTRAINTS;DROP TABLE CUSTOMER CASCADE CONSTRAINTS;DROP TABLE...
-- Drop the tables if they existDROP TABLE REP CASCADE CONSTRAINTS;DROP TABLE CUSTOMER CASCADE CONSTRAINTS;DROP TABLE ORDERS CASCADE CONSTRAINTS;DROP TABLE ITEM CASCADE CONSTRAINTS;DROP TABLE ORDER_LINE CASCADE CONSTRAINTS;-- You are to change CUSTOMER to CUSTOMERS for the Colonial database to avoid conflict with the CUSTOMER table in Tal.-- Create the tablesCREATE TABLE REP(REP_NUM CHAR(2) PRIMARY KEY,LAST_NAME CHAR(15),FIRST_NAME CHAR(15),STREET CHAR(15),CITY CHAR(15),STATE CHAR(2),POSTAL_CODE CHAR(5),COMMISSION DECIMAL(7,2),RATE DECIMAL(3,2) );CREATE TABLE CUSTOMER(CUSTOMER_NUM CHAR(3) PRIMARY KEY,CUSTOMER_NAME CHAR(35) NOT NULL,STREET CHAR(20),CITY CHAR(15),STATE CHAR(2),POSTAL_CODE CHAR(5),BALANCE DECIMAL(8,2),CREDIT_LIMIT DECIMAL(8,2),REP_NUM CHAR(2) );CREATE...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT