Question

The Shoe store’s database schema is as follows: Shoes(id, name, description, color1, color2, d_id) CK: name...

The Shoe store’s database schema is as follows:

Shoes(id, name, description, color1, color2, d_id)

CK: name

FK: d_id references Department(id)

Department(id, name, description)

CK: name

Orders(id, shoe, size, quantity, has_arrived)

FK: shoe references Shoes(id)

Step 1 (30 points): Write create statements for each of the above tables, making sure to have appropriate data types and with all keys declared. To receive full credit, you must have both your exact SQL statement and a screenshot showing the successful executing of your create statements.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

This demonstration is using SQL Server 2014.Database and Tables are created using SQL Server Management Studio (SSMS).

Database :

/*create database ShoeStoreDB*/
create database ShoeStoreDB;

/*use ShoeStoreDB database to create tables*/
use ShoeStoreDB;

Tables :

1.Table Name :Department

/*1.Table Name :Department*/
create table Department (
id int primary key,
name varchar(100) not null,
description text not null
);

Screen in SSMS :

2.Table Name :Shoes

/*2.Table Name :Shoes*/
create table Shoes(
id int primary key,
name varchar(100) not null unique ,
color1 varchar(20) not null,
color2 varchar(20) not null,
d_id int foreign key references Department(id)
);

Screen in SSMS :

3.Table Name : Orders

/*3.Table Name :Orders*/
create table Orders(
id int primary key,
shoe int ,
size int not null,
quantity int not null,
has_arrived varchar(20) not null,
foreign key (shoe) references Shoes(id)
);

Screen in SSMS :

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.

Add a comment
Know the answer?
Add Answer to:
The Shoe store’s database schema is as follows: Shoes(id, name, description, color1, color2, d_id) CK: name...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Consider a database schema consisting of two tables, Employee (ID, Name, Address), Project(PID, Name, Deadline), Assign...

    Consider a database schema consisting of two tables, Employee (ID, Name, Address), Project(PID, Name, Deadline), Assign (EID, PID, Date). Assign.EID is a foreign key referencing employee's ID and Assign.PID is a foreign key reference the project. Write the SQL query for 1. Find Projects that are not assigned to any employees(PID and Name of the project).

  • II. Fill in the blanks: (30 The relational database schema of Course Management System are defined...

    II. Fill in the blanks: (30 The relational database schema of Course Management System are defined as follows: Department (ID, Name, Head) Teacher (ID, Name, Position, DeptID) Student (ID, Name, Gender, Birthday, DeptID) Course (ID, Name, Room, TeacherID) Enroll (StudentID, CourseID, Grade) Please fill the blanks in the following SQL statements. 1. Create the Enroll table. CREATE TABLE Enroll ( char (8) NOT NULL StudentID [1] char (4) NOT NULL CourseID [2] int Grade CHECK (Grade IS NULL OR (Grade>-0...

  • Create the database and tables for the database. Show all SQL statements. Include primary and foreign...

    Create the database and tables for the database. Show all SQL statements. Include primary and foreign keys. Insert data into each table. Show select statements and display the output of each table. Note:Student’s name must be inserted into table as part of the data! Perform the SQL below: Query one table and use WHERE to filter the results. The SELECT clause should have a column list, not an asterisk (*). State the purpose of the query; show the query and...

  • Help In Database: Next comes the data entry: Make up data for your database, or find...

    Help In Database: Next comes the data entry: Make up data for your database, or find real data. You can enter the data with INSERT statements, but it is much easier to use PhpAdmin. It has a form where you can type the data directly. Alternatively, you can use PhpAdmin to import CSV data (comma-separated values), which you can export from Excel. Include at least 3 rows in each of the entity relations, and as many rows as you need...

  • You are given a database schema as follows: Transaction(TID, Staff, Shop) Item(ItemCode, Description, Price) TransItem(TID, ItemCode,...

    You are given a database schema as follows: Transaction(TID, Staff, Shop) Item(ItemCode, Description, Price) TransItem(TID, ItemCode, Quantity) Sample data of the tables are shown below: TID Staff Shop 1 Ann 1 2 Ann 1 3 Ben 2 Transaction ItemCode Description Price A1 Milk 6 B1 Bread 10 B2 Chocolate 20 Item TID ItemCode Quantity 1 A1 1 1 B2 2 2 B2 1 3 A1 4 3 B2 1 TransItem Assumptions: TID, Shop and Price are integers ItemCode contains a...

  • The relational schema for the Academics database is as follows: DEPARTMENT(deptnum, descrip, instname, deptname, state, postcode)...

    The relational schema for the Academics database is as follows: DEPARTMENT(deptnum, descrip, instname, deptname, state, postcode) ACADEMIC(acnum, deptnum*, famname, givename, initials, title) PAPER(panum, title) AUTHOR(panum*, acnum*) FIELD(fieldnum, id, title) INTEREST(fieldnum*, acnum*, descrip) Some notes on the Academics database: ● An academic department belongs to one institution (instname) and often has many academics. An academic only works for one department. ● Research papers (PAPER) are often authored by several academics, and of course an academic often writes several papers (AUTHOR). ●...

  • The relational schema for the Academics database is as follows DEPARTMENT(deptnum, descrip, instname, deptname, state,...

    The relational schema for the Academics database is as follows DEPARTMENT(deptnum, descrip, instname, deptname, state, postcode) ACADEMIC(acnum, deptnum*, famname, givename, initials, title) PAPER(panum, title) FIELD(fieldnum, id, title) INTEREST(fieldnum* acnumk, descrip) Some notes on the Academics database An academic department belongs to one institution (instname) and often has many academics. An academic only works for one department. Research papers (PAPER) are often authored by several academics, and of course an academic often writes several papers (AUTHOR) A research field (FIELD) often...

  • 1. Write a script that creates a user-defined database role named OrderEntry in the MyGuitarShop database....

    1. Write a script that creates a user-defined database role named OrderEntry in the MyGuitarShop database. Give INSERT and UPDATE permission to the new role for the Orders and OrderItems table. Give SELECT permission for all user tables. 2. Write a script that (1) creates a login ID named “RobertHalliday” with the password “HelloBob”; (2) sets the default database for the login to the MyGuitarShop database; (3) creates a user named “RobertHalliday” for the login; and (4) assigns the user...

  • The relational schema for the Academics database is as follows DEPARTMENT(deptnum, descrip, instname, deptname, state, postcode)...

    The relational schema for the Academics database is as follows DEPARTMENT(deptnum, descrip, instname, deptname, state, postcode) ACADEMIC(acnum, deptnum*, famname, givename, initials, title) PAPER(panum, title) FIELD(fieldnum, id, title) INTEREST(fieldnum* acnumk, descrip) Some notes on the Academics database An academic department belongs to one institution (instname) and often has many academics. An academic only works for one department. Research papers (PAPER) are often authored by several academics, and of course an academic often writes several papers (AUTHOR) A research field (FIELD) often...

  • Q.1] Write SQL statements based on the tennis database schema (practice homework 5) Get all the different tow...

    Q.1] Write SQL statements based on the tennis database schema (practice homework 5) Get all the different town names from the PLAYERS table. 2. For each town, find the number of players. 3. For each team, get the team number, the number of matches that has been played 'for that team, and the total number of sets won. 4. For each team that is captained by a player resident in "Eltham", get the team number and the number of matches...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT