a. Write in SQL a command that creates the table Books according to the above description b. Write in SQL a statement that adds a new column named publisherID of type Char(10). This column should be defined as a foreign key that relates the table Books to the table Publisher c. Write in SQL a command that deletes the books that are published before 20-Aug-2010
( Please answer this question immediately I do not have time )
Use the following table to answer the questions below:
Table name: Books | ||||
Column Name | Role | Data Type | Length | Constraint |
bookID | Stores the ID of a book | Number | 5 | Primary key |
bookTitle | Stores the title of a book | Varchar2 | 50 | - |
bookISBN | Stores the ISBN of a book | Number | 13 | Cannot be null and duplicated |
publicationDate | Store the publication date of a book | Date | - | Cannot be null |
bookPrice | Stores the price of a book | Number | 2,2 |
Cannot be null |
a. Write in SQL a command that creates the table Books according to the above description
b. Write in SQL a statement that adds a new column named publisherID of type Char(10). This column should be defined as a foreign key that relates the table Books to the table Publisher
c. Write in SQL a command that deletes the books that are published before 20-Aug-2010
d. Write a SQL query that displays the number of books that are published in the year 2018
e. Write in SQL a query that displays the ids of the cheapest books
f. Create a view named ‘BookDetails’ to hold all the details of books whose titles finish with ‘
Step by step
Solved in 4 steps