I need help. I am trying to learn SQL

ashill07

New member
Local time
Today, 01:29
Joined
Apr 3, 2021
Messages
17
1. Create a project of a database for authors and books. Determine the necessary tables and their structure in the database.

2. The designed one should enable the following data to be recorded:

AUTHORS

- prof. Paul Beynon-Davies, b. 1964-03-23. Fees: PLN 6,000;

-prof. Andrzej Stachurski, b. 1960-12-24. Fees: 5500 PLN;

-prof. Andrzej Wierzbicki, born on 1961-03-11. Fees: PLN 3,000;

- Dr. Cassel Paul, b. 1970-05-13. Fees: 2200 PLN;

- prof. Palmer Pamela, b. 1963-10-14. Fees: PLN 4,000;

BOOK

- P. Beynon-Davies, Database Systems Warsaw, 2003. ISBN: 83-204-2726-6. Price: PLN 80, Scientific and Technical Publishers;

- C. Paul, P. Pamela, Access 2000 PL, Krakow, 1999. ISBN: 83-7197-128-1. Price: PLN 59, Helion, additional CD-ROM;

- A. Stachurski, A. Wierzbicki, Fundamentals of Optimization, Warsaw, 2001. ISBN: 83-7207-247-7. Price: PLN 26, Warsaw University of Technology Publishing House, addition in the form of a floppy disk with examples of optimization algorithms in C ++;

3. Write a script implementing the designed database structure or create a database "manually" and generate SQL code.

4. Propose indexes that should be included in the database.
 
Nobody is going to do your homework for you. What have you got so far, as far as tables go? What have you tried for a query? Note you can create a query in design view and then change to SQL view to see what gets created.
 
But this not homework. I am not studying. I am 38 years old. i find it i try to do but i have always error.

Create table Authors
(
AuthorID int identity(1,1) primary key,
Title varchar(10),
Name_Surname varchar(50) not null,
Birth_day date,
Salary decimal null
)

Create Table Books
(
BookID int identity(1,1) primary key,
Book_Subject varchar(100),
City varchar(10),
BDate decimal null,
ISBN_number numeric(13,0),
Price decimal null,
Publisher varchar(100)
)

Create Table BookAuthor
(
AuthorID int,
BookID int,
)
 
1617405227294.png
 
Well, what you posted in the first post certainly looks like an assignment. It appears you get the tables created, so what exactly is your error?
 
I only dont understand how shows like that "
BOOK
- P. Beynon-Davies, Database Systems Warsaw, 2003. ISBN: 83-204-2726-6. Price: PLN 80, Scientific and Technical Publishers;
- C. Paul, P. Pamela, Access 2000 PL, Krakow, 1999. ISBN: 83-7197-128-1. Price: PLN 59, Helion, additional CD-ROM;
- A. Stachurski, A. Wierzbicki, Fundamentals of Optimization, Warsaw, 2001. ISBN: 83-7207-247-7. Price: PLN 26, Warsaw University of Technology Publishing House, addition in the form of a floppy disk with examples of optimization algorithms in C ++;

and i didnt understand 3 and 4 question and how i can do it?
 
I don't think I've ever used Decimal without specifying precision and scale. Did that code work for you?
 
I think your SQL in post 3 is what question 3 is looking for. Here's one link among many on indexes:

 
creating table are works insert table are works
3. and 4. questions i dont know how to do.
I'm sorry, those statements don't make sense to me.

You say creating the table works. But you also say #3 (which refers to the script that would create the table), don't know how to do. Those two statements contradict each other.
 
I'll get out of the way.
 
I reckon ISBN should be Text...

ISBN_number numeric(13,0)
 
Book_Subject varchar(100),

Shouldn't that be Book_Title?
 

Users who are viewing this thread

Back
Top Bottom