Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create the Company database using the following steps. 1.1 Log in to your computer in the classroom or at home using your own account. 1.2

  1. Create the Company database using the following steps.

1.1 Log in to your computer in the classroom or at home using your own account.

1.2 Double-click the icon MySQL Workbench.

1.3 Following the instructions, connect to the database server.

1.4 Access the GUI of MySQL WorkBench.

1.5 Create your database using your first name and last name connected with an underscore. For example, my database should be chunlei_liu. Then you can find your created database in the left pane of the GUI.

1.6 Under the SQL editing window, Write use firstname_lastname; to choose the database you just created. Then write correct SQL statements to create the following tables in your database and populate each table. The resulting database should be exactly as shown in the following figure.

1.7 When you create each table, you need to explicitly specify the primary key constraint and foreign key constraint for that table.

1.8 Specify the data type for each attribute.

1.9 Impose the NOT NULL constraint to each attribute of the primary key of each table.

If anything of the above steps goes wrong and you want to start from scratch, you can right-click on the Schemas panel on the left of the MySQL WorkBench window, Refresh All, select your database, right-click, and then Drop Schema. It will delete all things in your database and allow you to run your script to create and populate the database again.

If a table contains a foreign key that references to another table that has not been created, you can create the first table without the foreign key specification. After you create the second table, you can use the ALTER command to add the foreign key specification to the first table, as explained on page 48 of cs4721_ch06.pptx or page 180 of the book.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions

Question

=+ a. a family deciding whether to buy a new car

Answered: 1 week ago

Question

=+10. How are inflation and unemployment related in the short run?

Answered: 1 week ago