Access over 35 million academic & study documents

Db Quest

Content type
User Generated
Subject
MySQL
Type
Homework
Rating
Showing Page:
1/5
1. Design a relational database schema.

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/5
2. Write CREATE TABLE statements to create tables based on your relational database
schema.
CREATE TABLE user (
user_id varchar(22) NOT NULL,
name varchar(15),
review_count int,
yelping_since date,
friends varchar(22),
useful int,
funny int,
cool int,
fans int,
elite int,
average_stars decimal(5,2),
compliment_hot int,
compliment_more int,
compliment_profile int,
compliment_cute int,
compliment_list int,
compliment_note int,
compliment_plain int,
compliment_cool int,
compliment_funny int,
compliment_writer int,
compliment_photos int,
CONSTRAINT PK_User PRIMARY KEY (user_id)

Sign up to view the full document!

lock_open Sign Up
Showing Page:
3/5

Sign up to view the full document!

lock_open Sign Up
End of Preview - Want to read all 5 pages?
Access Now
Unformatted Attachment Preview
1. Design a relational database schema. 2. Write CREATE TABLE statements to create tables based on your relational database schema. CREATE TABLE user ( user_id varchar(22) NOT NULL, name varchar(15), review_count int, yelping_since date, friends varchar(22), useful int, funny int, cool int, fans int, elite int, average_stars decimal(5,2), compliment_hot int, compliment_more int, compliment_profile int, compliment_cute int, compliment_list int, compliment_note int, compliment_plain int, compliment_cool int, compliment_funny int, compliment_writer int, compliment_photos int, CONSTRAINT PK_User PRIMARY KEY (user_id) ); CREATE TABLE business ( business_id varchar(22) NOT NULL, name varchar(15), neighborhood varchar(15), address varchar(15), city varchar(25), state char(2), postal_code varchar(10), latitude decimal, longitude decimal, stars decimal(2,1), review_count int, is_open int, categories varchar(15), CONSTRAINT PK_Business PRIMARY KEY (business_id) ); CREATE TABLE tip ( user_id varchar(22) NOT NULL, business_id varchar(22) NOT NULL, text varchar(250), date date, likes int, CONSTRAINT PK_Tip PRIMARY KEY (user_id, business_id), CONSTRAINT FK1_User FOREIGN KEY (user_id) REFERENCES user(user_id), CONSTRAINT FK2_Business FOREIGN KEY (business_id) REFERENCES business(business_id) ); CREATE TABLE checkin ( business_id varchar(22) NOT NULL, weekday varchar(9), hour int, checkins int, CONSTRAINT PK_Checkin PRIMARY KEY (business_id), CONSTRAINT FK_Business FOREIGN KEY (busi ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Anonymous
Just what I needed. Studypool is a lifesaver!

Studypool
4.7
Indeed
4.5
Sitejabber
4.4