Question

This is SQL Help. How would I set up a table so that they have codes?...

This is SQL Help.

How would I set up a table so that they have codes? For example, if I had a table with sales, returns, and purchases, then I would want sales to have a code of s, returns to have a code of r, and purchases to have a code of p. Thank you.

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

Your question is not very clear. From what I can understand, you want to create tables with respective primary keys.

In that case, you can specify the same while creating the tables as shown below.

CREATE TABLE sales (

s INT PRIMARY KEY,

......... (your other columns goes here)

);

CREATE TABLE returns (

r INT PRIMARY KEY,

......... (your other columns goes here)

);

CREATE TABLE purchases (

p INT PRIMARY KEY,

......... (your other columns goes here)

);

NOTE: In case you have any doubts, reach out to me via the comments section.

Add a comment
Know the answer?
Add Answer to:
This is SQL Help. How would I set up a table so that they have codes?...
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
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