Your assignment begins by exporting and executing SQL statements to create the customer, employee, and order tables.
Question:
Your assignment begins by exporting and executing SQL statements to create the customer, employee, and order tables. You will then expand the SQL statements and populate the 3 tables in the database from the following 3 tables. Finally, you'll write a query that displays data for all objects (rows) and tuples (columns) in 3 tables of the database.
Important reminder, refer to the instructions from Module 1 for creating the database. This step must be completed before creating and populating tables within the database.
Instruction for Module 1
In this Critical Thinking Assignment, you will install the PostgreSQL software product and create and populate the JigSaw Operational database. Follow the instructions in the assignment module folder to 1)
install PostgreSQL10.
2) create the JigSaw database.
3) create the tables within the database, and 4) populate the tables with data.
Part I: Create a new database in PostgreSQL
- Expand the PostgreSQL item on the tree listing.
- Right-click to select the Databases item and then select Create - Database.
- The Create Database dialog window appears:
- Enter js in the Database name.
- Enter any comments you feel are appropriate.
- Click Save. The database js now appears in the tree listing on the left side of the screen.
- Right-click js and select Query tool.
- Open the js.sql file (in the module 1 folder) using a text editor, then:
- Select all of the SQL statements.
- Copy and paste the SQL into the Query tool
- Run the SQL.
- Click the lightning bolt to execute the SQL script. You should receive a Query Returned Successful
- Clear the Query tool
- Select all of the SQL
- Copy and paste the SQL into the Query tool
- Run the SQL.
- Click the lightning bolt to execute the SQL script. You should receive a Query Returned Successful message.
- Clear the Query tool
- Open the js_data.sql file (in the module 1 folder) using a text editor, then:
At this point, the js database and tables are created and populated. Use these procedures and SQL scripts as an example when creating the database and tables, and when populating the databases.