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. 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.
Get Answers For Free
Most questions answered within 1 hours.