Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1.Please create related three tables about a subjects (for exp. Students, Employees, Products, Books, Club_Membership, Hobbies etc.) must contain at least a default value definition

1.Please create related three tables about a subjects (for exp. Students, Employees, Products, Books, Club_Membership, Hobbies etc.) must contain at least a default value definition and a primary key, a foreign key,unique,not null and check constraints.

Persons Table -

CREATE TABLE Persons ( ID int NOT NULL, LastName varchar(255) NOT NULL, FirstName varchar(255), Age int CHECK (Age>=18), City varchar(255) DEFAULT 'Earth', PRIMARY KEY(ID) );

Orders Table

CREATE TABLE Orders ( OrderID int NOT NULL, PersonID int, PRIMARY KEY (OrderID), FOREIGN KEY (PersonID) REFERENCES Persons(ID) );

Resturants Table -

CREATE TABLE Resturants ( ID int NOT NULL, Name varchar(255) NOT NULL, Order_ID int, FOREIGN KEY (Order_ID) REFERENCES Orders(OrderID), UNIQUE (ID) );

these are the tables and below are the questions;

4. Create a sequence for primary key column on each table. (10 points) Write SQL commands below:

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

More Books

Students also viewed these Databases questions

Question

What can do in this situation to ensure successful communication?

Answered: 1 week ago

Question

For what purposes are departmental reports useful to management?

Answered: 1 week ago

Question

(1 point) Calculate 3 sin x cos x dx.

Answered: 1 week ago