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
  • 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...

  • Consider the following relations for course-enrollment database in a university: STUDENT(S-ID,S-Name, Department, Birth-date) COURSE(C-ID, C-Name, Department)...

    Consider the following relations for course-enrollment database in a university: STUDENT(S-ID,S-Name, Department, Birth-date) COURSE(C-ID, C-Name, Department) ENROLL(S-ID, C-ID, Grade) TEXTBOOK(B-ISBN, B-Title, Publisher, Author) BOOK-ADOPTION(C-ID, B-ISBN) (a) Draw the database relational schema and show the primary keys and referential integrity constraints on the schema. (b) How many superkeys does the relation TEXTBOOK have? List ALL of them. (c) Now assume each COURSE has distinct C-Name. (i) If C-ID is a primary key, what are the candidate keys and the unique keys...

  • Consider the database schema of college database. Students have a major department and take classes where...

    Consider the database schema of college database. Students have a major department and take classes where faculty can be met. Student (cwid int, name, text, age int, majorDept text) Department (name text, chair text) Faculty (name text, deptName text) Enrollment (facName text, studID int) Note that the underlined attributes are primary keys. studID, chair, deptName of Faculty, facName and majorDept of Student are foreign keys to cwid, name of Faculty, name of Department, name of Faculty and also name of...

  • For all problems, use the following schema: Musician(id, first_name, last_name, instrument, band_id) Band(id, name, years_together) Show(id,...

    For all problems, use the following schema: Musician(id, first_name, last_name, instrument, band_id) Band(id, name, years_together) Show(id, venue_id, date) Played_in(band_id, show_id) Venue(id, name, address) Album(id, name, year, band_id, genre_id) Genre(id, name, description) Song(id, name, album_id) Primary keys are in bold, foreign keys are in italics. For each problem, write a query once using relational algebra, and again using SQL. 12. Find the names of all bands that have a member who plays "Guitar", OR have a member that plays "Keyboard". 13....

  • Please HELP, THANK YOU SO MUCH Consider the below schema of the university database (keys are...

    Please HELP, THANK YOU SO MUCH Consider the below schema of the university database (keys are in bold and underline) Part(pid: string, pname: string, description: string, color: string) Department(did: string, dnamestring, address: string) Supplier(sid string,.sname:string, address:string) Order(did:string. sid string pidstring, time:string, quantityreal, pricereal) The key fields are underlined, and the domain of each field is listed after the field name. Thus pid is the key for Part, did is the key for Department, sid is the key for Supplier, and...

  • 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). ●...

  • 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...

  • 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...

  • 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...

  • 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...

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
ADVERTISEMENT